Created
November 23, 2014 03:19
-
-
Save techtangents/0a45a34782379efff983 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Mappy where | |
import Control.Monad.State.Trans | |
import Data.Traversable | |
import Data.Tuple | |
import Control.Monad.State | |
import Control.Monad.State.Class | |
mapAccumL :: forall a b c t. (Traversable t) => (a -> b -> Tuple c a) -> a -> t b -> Tuple (t c) a | |
mapAccumL f s t = | |
runState (traverse (state <<< (flip f)) t) s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment