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

Type signature of hoistCofree too restrictive #139

Closed
andrewthad opened this issue Aug 25, 2016 · 2 comments
Closed

Type signature of hoistCofree too restrictive #139

andrewthad opened this issue Aug 25, 2016 · 2 comments

Comments

@andrewthad
Copy link

The type signature of hoistCofree is currently:

hoistCofree :: Functor f => (forall x. f x -> g x) -> Cofree f a -> Cofree g a

However, it can be generalized to:

hoistCofree :: Functor f => (f (Cofree g a) -> g (Cofree g a)) -> Cofree f a -> Cofree g a
@RyanGlScott
Copy link
Collaborator

See also #104 and #131 (especially #131 (comment)).

tl;dr Changing the type signature of hoistCofree is controversial and not necessarily a clear win.

@andrewthad
Copy link
Author

Thanks. I had totally forgotten about the laws that hoistXXX functions were supposed to satisfy. I agree that it's better to universally quantify in this case to make sure that the argument is actually a natural transformation. Closing.

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

No branches or pull requests

2 participants