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

view could be implemented in terms of MonadAsk #79

Open
parsonsmatt opened this issue Dec 16, 2017 · 0 comments
Open

view could be implemented in terms of MonadAsk #79

parsonsmatt opened this issue Dec 16, 2017 · 0 comments

Comments

@parsonsmatt
Copy link

Generalizing view is nice, as it allows you to use view in a MonadAsk context like use in a MonadState context.

-- | View the focus of a `Getter`.
view :: forall s t a b m. MonadAsk s m => Getter s t a b -> m a
view l = ask >>= unwrap (l (Forget id))
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

1 participant