Skip to content

Add a strict over? #1016

@treeowl

Description

@treeowl

I don't see a strict version of over, which we could put in Control.Lens.Traversal.

over' :: ATraversal s t a b -> (a -> b) -> s -> t
over' l f = getSolo . cloneTraversal l (\old -> Solo $! f old)
  where
    getSolo (Solo x) = x

I don't remember how indexed stuff works, but I'm sure that's available too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions