tomasp

Stories submitted by tomasp

F# Math - Writing generic numeric code(tomasp.net)

submitted by tomasptomasp(299) 5 months, 29 days ago

Writing generic numeric code in .NET is difficult, because .NET generics do not support constraints specifying that a type has to support certain numeric operations. In this article, we look how to solve the problem in F#. Using static member constraints, it is possible to write simple generic calculations and using the INumeric interface, we can capture numeric operations for a type and use them when implementing complex types such as a matrix. read more...

add a comment |category: |Views: 28

tags: another

F# Math - Using matrices for graph algorithms(tomasp.net)

submitted by tomasptomasp(299) 6 months, 18 days ago

This article introduces the matrix type available in F# PowerPack. It discusses how to create matrices, manipulate matrices using indexing and slices and how to use built-in functions for working with them. As a running example, we use matrix to represent a graph using an adjacency matrix. read more...

2 comments |category: |Views: 37

tags: another

Programming with F# asynchronous sequences(tomasp.net)

submitted by tomasptomasp(299) 9 months, 4 days ago

Asynchronous sequences provide a way to represent asynchronous computation that generates multiple values on demand. This article defines asynchronous sequences, combinators for working with them and "asyncSeq" computation builder. Then it implements several examples including a sequential asynchronous Web Crawler. read more...

add a comment |category: |Views: 2

tags: another

Safer asynchronous workflows for GUI programming(tomasp.net)

submitted by tomasptomasp(299) 11 months, 12 days ago

When writing reactive applications using F# asynchronous workflows, it is important to run some operations on the right thread. User interface elements are accessible only on GUI threads and CPU-intensive computations should be done on a background thread. This article describes an extension of F# asynchronous workflows that guarantees correct use of threads using types. read more...

add a comment |category: |Views: 5

tags: another

Writing non-blocking user-interfaces in F#(tomasp.net)

submitted by tomasptomasp(299) 11 months, 14 days ago

F# asynchronous workflows are mainly used for non-blocking I/O and concurrency, but they provide nice abstraction for writing user interface interactions. This article shows an Silverlight example and explains how F# makes it easy to write code that avoids blocking the user-interface when performing CPU-intensive processing. read more...

add a comment |category: |Views: 2

tags: another

Improve WordPress performance with Phalanger(www.php-compiler.net)

submitted by tomasptomasp(299) 1 year ago

Phalanger is a PHP language compiler for .NET. It is almost fully compatible with PHP, and it also adds several useful extensions. We recently spent some time tuning the Phalanger performance. This article shows that Phalanger is more efficient than standard PHP interpreter and is comparable to the fastest solutions using e.g. WinCache extension. read more...

add a comment |category: |Views: 5

tags: another

Variations in F#: Research compiler with Joinads and more!(tomasp.net)

submitted by tomasptomasp(299) 1 year, 2 months ago

Joinads are a research extension of the F# language. They simplify conrurrent programming with tasks, reactive programming with events, but can be also used for other types of computations. This article introduces the extension, which is now available, based on the open-source source-drop of F#. read more...

add a comment |category: |Views: 3

tags: another

Beyond the Monad fashion: Creating web forms with LINQ(tomasp.net)

submitted by tomasptomasp(299) 1 year, 2 months ago

Formlets are elegant functional abstraction for describing web forms that encapsulates both rendering and functionality. In this article, we look how to write formlets in C#. Although formlets are not monads, we can still use elegant LINQ syntax. Interestingly, using the join clause... read more...

add a comment |category: |Views: 5

tags: another

Beyond the Monad fashion: Writing idioms in LINQ (tomasp.net)

submitted by tomasptomasp(299) 1 year, 2 months ago

Everyone tells you that LINQ is a monad, but LINQ can be used to enocde other types of computations too. This article demonstrates that you can use LINQ to program using idioms, which are in some ways more useful than monads. read more...

add a comment |category: |Views: 52

tags: another

Announcing F# snippets web site(tomasp.net)

submitted by tomasptomasp(299) 1 year, 5 months ago

When writing F# programs, I often write some nice code snippet or some useful helper function that I'd like to share with the F# community. Unfortunately, there was no good web site for posting F# snippets - until now! The blog post announces http://fssnip.net - a web for sharing F# snippets that adds colorization and tool tips with type hints. read more...

add a comment |category: |Views: 4

tags: another

Asynchronous programming in C# and F#: How does it work?(tomasp.net)

submitted by tomasptomasp(299) 1 year, 6 months ago

In this article, we look at the internals of asynchronous programming models in F# and a future version of C#. We compare the compilation in C# (based on state machines) and the compilation in F# (based on combinators) and we look at advantages and disadvantages of both of the approaches. read more...

add a comment |category: |Views: 7

tags: another

F# in MonoDevelop and cross-platform web sites & screencasts(tomasp.net)

submitted by tomasptomasp(299) 1 year, 6 months ago

The first version of the F# language binding for MonoDevelop is now available. Using the F# compiler service, it provides autocompletion, information tool tips and background type-checking. For more information and installation instructions, watch two screencasts showing F# on Linux. read more...

add a comment |category: |Views: 2

tags: another

Asynchronous C# and F#: How do they differ?(tomasp.net)

submitted by tomasptomasp(299) 1 year, 6 months ago

The asynchronous programming support in C# announced at PDC 2010 is largely inspired by F# asynchronous workflows. In this article we look at some of the differences between the two including cancellation support in F# and the distinction between "hot task" model of C# and "task generator" model of F#. read more...

add a comment |category: |Views: 4

tags: another

Asynchronous programming in C# and F#: Simultaneous introduction (tomasp.net)

submitted by tomasptomasp(299) 1 year, 6 months ago

One of the exciting new technologies announced at PDC 2010 is a preview of asynchronous programming support for C#. In this article, I briefly introduce the new features and I demonstrate how they relate to F# asynchronous workflows already available in Visual Studio 2010. We'll also look at some differences between the two. read more...

add a comment |category: |Views: 6

tags: another

F# Parallel Extras: Financial dashboard with cancellation(tomasp.net)

submitted by tomasptomasp(299) 1 year, 7 months ago

In this article, we revisit an F# implementation of a financial dashboard example from Parallel Programming with .NET. The article explains and demonstrates how to use the built-in support for cancellation in F# asynchronous workflows. read more...

add a comment |category: |Views: 18

tags: another

F# Parallel Extras: Agent-based blocking queue (tomasp.net)

submitted by tomasptomasp(299) 1 year, 7 months ago

We implement an asynchronous blocking queue using F# agents. The queue is similar to BlockingCollection in .NET 4.0, but blocks asynchronously (using F# workflows), which is more scalable. The type can be used, for example, when implementing the pipeline pattern as demonstrated in previous article. read more...

add a comment |category: |Views: 8

tags: another