optics-core-0.4.1: Optics as an abstract interface: core definitions
Safe Haskell None
Language Haskell2010

Optics.Internal.Utils

Description

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

wrapIdentity' :: a -> Identity' a Source #

Mark a value for evaluation to whnf.

This allows us to, when applying a setter to a structure, evaluate only the parts that we modify. If an optic focuses on multiple targets, Applicative instance of Identity' makes sure that we force evaluation of all of them, but we leave anything else alone.

newtype Traversed f a Source #

Helper for traverseOf_ and the like for better efficiency than the foldr-based version.

Note that the argument a of the result should not be used.

Constructors

Traversed (f a)

data OrT f a Source #

Helper for failing family to visit the first fold only once.

Constructors

OrT ! Bool (f a)

Instances

Instances details
Functor f => Functor ( OrT f) Source #
Instance details

Defined in Optics.Internal.Utils

Methods

fmap :: (a -> b) -> OrT f a -> OrT f b Source #

(<$) :: a -> OrT f b -> OrT f a Source #

Applicative f => Applicative ( OrT f) Source #
Instance details

Defined in Optics.Internal.Utils

wrapOrT :: f a -> OrT f a Source #

Wrap the applicative action in OrT so that we know later that it was executed.

(#.) :: Coercible b c => (b -> c) -> (a -> b) -> a -> c infixr 9 Source #

Composition operator where the first argument must be an identity function up to representational equivalence (e.g. a newtype wrapper or unwrapper), and will be ignored at runtime.

(.#) :: Coercible a b => (b -> c) -> (a -> b) -> a -> c infixl 8 Source #

Composition operator where the second argument must be an identity function up to representational equivalence (e.g. a newtype wrapper or unwrapper), and will be ignored at runtime.

uncurry' :: (a -> b -> c) -> (a, b) -> c Source #

uncurry with no lazy pattern matching for more efficient code.

Since: 0.3