A long overdue counterexample of a pure bind/return computation expression that does not satisfy any of the monad laws, as promised to @silverSpoon. This uses binary trees under the hood, which define a binary operation but do not satisfy any unit or associativity laws. Binary trees can also encode the syntactic structure of a computation expression, which is being captured using a state-updating bind implementation.
3 people like thisPosted: 9 years ago by Eirik Tsarpalis
Defines a generic `mutate : 'T -> 'T` function that structurally mutates every value in the object graph, without performing new allocations. Needless to say, this is intended for educational purposes only.
3 people like thisPosted: 7 years ago by Eirik Tsarpalis
c.f. http://fssnip.net/qR In this example different syntactic structures result in different types.
0 people like thisPosted: 9 years ago by Eirik Tsarpalis