Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active July 20, 2017 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/79eb9e2469fc917c96a49406341ca0af to your computer and use it in GitHub Desktop.
Save deque-blog/79eb9e2469fc917c96a49406341ca0af to your computer and use it in GitHub Desktop.
||| Given a mapper of type (a -> Foldable b), it transforms:
||| - a step function taking values of type `b`
||| - into one taking values of type `a`
catMapping : (Foldable t) => (a -> t b) -> Transducer acc s s a b
catMapping fn = statelessTransducer $
\next, acc, a => runSteps next acc (fn a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment