1. 8
    Combine Multiple State ADT Instances with the Same Input
    3m 31s

Combine Multiple State ADT Instances with the Same Input

Share this video with your friends

Send Tweet

When combining multiple State ADT instances that depend on the same input, using chain can become quite burdensome. We end up having to play leapfrog with values inside of nested chain statements. Very reminiscent of the old callback nastiness we had to deal with before Promises graced our existence.

But fear not, but taking advantage of the Applicative Functor portion of the State ADT in combination with the converge combinator, we can apply these types of transitions in unison, passing the value to both virtually simultaneously.