Functional Programming

Trieng out ReasonML and ReasonReact

Trieng out ReasonML and ReasonReact

The title seems a little weird, looks like a typo, but there is a pun intended in here. The “Trie” in “Trieng“ stands for the Trie data-structure and in this blog post we’ll explore the world of ReasonML by taking an example of a Trie and implement a React app in ReasonReact. I wrote this post…

React and Finite State Machines

React and Finite State Machines

Finite state machines, generally speaking, are a computation model used to describe a system in terms of the transitions between it’s states. They make it possible to is really easy to visualize your computational model as a graph and make sure that your application isn’t left with unhandled cases or illegal states. Warning: Read the wikipedia page on Finite…

Everything you wanted to know about Sum Types (but were almost afraid to ask)

Everything you wanted to know about Sum Types (but were almost afraid to ask)

A lot of messy JavaScript has to do with loose typing, invalid values and the horrible chain of ternary expressions or — heaven forbid — if statements to handle them. With JavaScript, all functions run on the concept of “pretend what you are getting is what you asked for”. If the value is not valid for the kind of…