Skip to content

view could be implemented in terms of MonadAsk #79

Open
@parsonsmatt

Description

@parsonsmatt

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions