Skip to content

Instantly share code, notes, and snippets.

@oisdk
Created July 2, 2018 01:38
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 oisdk/4684a3faa84146765e64d60ef01d97e9 to your computer and use it in GitHub Desktop.
Save oisdk/4684a3faa84146765e64d60ef01d97e9 to your computer and use it in GitHub Desktop.
zipo :: Functor f => (f (Fix f -> a) -> f (Fix f) -> a) -> Fix f -> Fix f -> a
zipo alg = c where c = (\x -> alg x . unfix) . fmap c . unfix
newtype Fix f = Fix (f (Fix f))
unfix :: Fix f -> f (Fix f)
unfix (Fix f) = f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment