Recently I had a chance to talk about monads at the amazing WarsawJS Meetup. Below you can find a recording of the session.
Welcome to the second post in the series. In the first one, you had a chance to build your first monad in TypeScript. In this post, you’ll see how to take advantage of generators to make the monadic code more readable.
In the previous post I’ve explained what discriminated unions are in the TypeScript language. We’ll now look into a classic example of how this concept can be applied to a real-world scenario – building an interpreter.
In this post, we’re going to look into an interesting feature of the TypeScript language. It’s called discriminated unions and is also known as algebraic data types. The latter name comes from Functional Programming paradigm where such types are used very heavily.