Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created January 20, 2017 20:59
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/47f74815c994ef89591b39b47568b50e to your computer and use it in GitHub Desktop.
Save deque-blog/47f74815c994ef89591b39b47568b50e to your computer and use it in GitHub Desktop.
type Algebra f = f (Fix f) -> Fix f
comp :: Algebra f -> Algebra f -> Algebra f
comp f g = f . unFix . g
compAll :: Foldable t => t (Algebra f) -> Algebra f
compAll fs = foldr1 comp fs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment