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 … Continue reading Modelling Stochastically Independent Processes with F# Computation Expressions: Part 2

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. … Continue reading Modelling Stochastically Independent Processes with F# Computation Expressions: Part 1

Exploring Monadic Landscape: Sql Command Computation Expression

Most of the developers have dealt with calling SQL server stored procedures from their applications at least once or twice. In my last project, where intense data mining is done on the SQL side, this is basically all I am doing. There is always a desire to wrap and abstract the ever-repetitive code to get … Continue reading Exploring Monadic Landscape: Sql Command Computation Expression

Retry Monad: An Implementation

One application that seems quite intuitively to be a good case for "monadization" is that of retrying a function call upon an exception that is thrown while executing it. This may be needed for inherently unreliable operations, dependent on a network connection, for example. Discussions of this can be easily found. Here is one on … Continue reading Retry Monad: An Implementation

The Push Monad: Introduction

Chapter 5 of Friendly F# has a great practical explanation of F# computation expressions often called "monads" from their use in computer science and Haskell. The material in Chapter 5 of the book does a lot to demystify the concept, theoretical coverage of which is done well in this Wikipedia article. Monads are an example … Continue reading The Push Monad: Introduction

Push Operation. A Few Words on Computation Expressions/Monads

As we have seen in the previous post, it is easy to implement Push types and operations: Here is an example of an implementation of FLOAT./ operation: a division of two integers on top of the stack. Since in Push an operation is denoted by "OP_TYPE.OP_NAME", it is convenient from the implementation standpoint to group … Continue reading Push Operation. A Few Words on Computation Expressions/Monads