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
Category: Push
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
Implementing a Push Type
From a developer's point of view, a Push type is implemented through a class, derived from PushTypeBase, as mentioned in the previous post. Once the type is implemented in any .NET language the system will hook it into the currently available types, will add a parser and a stack for it. All that needs to … Continue reading Implementing a Push Type
Defining a Base for Push Types
Let's take a look at how the base from which all Push types derive is defined. Push types are represented (in all .NET languages) by classes derived from PushTypeBase. This is an abstract class and the listing above shows its definition. Two properties are essential for all classes, deriving from PushTypeBase: • Value – an … Continue reading Defining a Base for Push Types