This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduce : (Foldable t) => Reducer st acc elem -> acc -> t elem -> acc | |
reduce step acc = | |
uncurry (complete step) -- 4) Call the completion on the result | |
. (\(acc, s) => (s, unStatus acc)) -- 3) Remove the wrapping status | |
. (flip runState (state step)) -- 2) Remove the state monad | |
. runSteps (runStep step) acc -- 1) Consume as many value as needed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment