1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Construct a Stateful Monad

    javascriptJavaScript

    We define the State datatype and take a peek into its inner working. By manually constructing an instance, we’ll start to get a feel on how the type separates state management from our stateful computations. As State depends on a Pair type, we get to know how each portion can be extracted through the fst and snd Pair instance methods.