Skip to content

Modify the definition of the asks function of ComonadEnv. #130

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

Closed
setsunica opened this issue Sep 14, 2020 · 2 comments · Fixed by #131
Closed

Modify the definition of the asks function of ComonadEnv. #130

setsunica opened this issue Sep 14, 2020 · 2 comments · Fixed by #131

Comments

@setsunica
Copy link
Contributor

The current definition is more restrictive than necessary. Modify as follows.

from
asks :: forall e1 e2 w. ComonadEnv e1 w => (e1 -> e2) -> w e1 -> e2
to
asks :: forall e1 e2 w a. ComonadEnv e1 w => (e1 -> e2) -> w a -> e2

The Haskell definition is as follows.
asks :: ComonadEnv e w => (e -> e') -> w a -> e'

@setsunica
Copy link
Contributor Author

Also, ComonadAsk instead of ComonadEnv may be sufficient.

@garyb
Copy link
Member

garyb commented Sep 15, 2020

👍 to both suggestions.

I'd say asks's type is a bug even, it makes no sense to require w e1, probably makes the function unusable most of the time.

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

Successfully merging a pull request may close this issue.

2 participants