Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for meta #13

Open
kevinbarabash opened this issue Mar 20, 2020 · 1 comment
Open

Add support for meta #13

kevinbarabash opened this issue Mar 20, 2020 · 1 comment

Comments

@kevinbarabash
Copy link

I think this is this is the correct implementation (I followed what hylo does but reverse the order):

meta
    f a b
  . Functor f
   Coalgebra f a
   Algebra f b
   a
   b
meta f g = go
  where
  go a = g $ go <$> f a
@eviefp
Copy link
Member

eviefp commented Sep 25, 2020

If I understand correctly, this can also be implemented as

meta f g = hylo g f

Which then prompts the question, why not just use hylo? The implementation looks like it's in the reverse order, but it's really not, because the proposed solution also flips the argument order for Algebra and Coalgebra, so it ends up being actually an identical implementation with the first two arguments swapped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants