Tag Archives: fsharp

Generating Permutations: Clojure or F#: Part 2

Marching on from the last post. Lazy Sequences This is my favorite feature ever. If I want to generate just a few of 10! (nobody even knows how much that is) permutations, I could: provided, the function is defined (as described in the first post): Here I am not sure which language I like more. […]


Modelling Stochastically Independent Processes with F# Computation Expressions: Part 1

The idea for doing this is not new. There is an excellent series of posts closely tracing an article on applications of functional programming to probability. A colleague of mine has recently called my attention to his own post of two years ago, where he describes a monad that models stochastically independent events in Clojure. […]


Modelling Stochastically Independent Processes with F# Computation Expressions: Part 2

Code for this entry: here. In this first part, we started shamelessly plagiarizing creatively reproducing a Clojure monad that does a great job describing stochastically independent processes. After a few trials I became convinced, that the approach in the blog post mentioned above was indeed optimal: a “natural” approach of modelling an event as a […]


Rosalind in F# – Finding a Protein Motif

Finding a Protein Motif is the problem we’ll be looking at today and it’s all about pattern matching. We’ll start by learning about motifs and their notation, and then we’ll move on to writing some code that can apply one to a protein string. By the time we’re done, we’ll be comfortable with regular expressions […]


FSharp and Tweetable Mathematical Art

Sorry, I didn’t update my blog for a while, though I know not many people are reading it. But I still need to write something to track my path on .Net. Let’s take a look at F#, the functional language in .Net Framework, it’s a dialect of Standard ML, the static type functional language. It […]


How to use the HDF5 Type Provider

A friendly reader left a comment reminding me that I never really told how the HDF5 Type Provider is used in a Visual Studio F# code project. In this post – sample code It has been a while since I last took a look at the HDF5 type provider example – or any F# type […]


Super skinny XML document generation with F#

I needed to generate some simple XML documents, in memory, from some F# script. From my C# days I was already familiar with the System.Xml.Linq namespace, which I still quite like. But it wasn’t particularly clean to use from F#. So I wrote a really simple F# wrapper for some of its most commonly used […]