optics-core-0.1: Optics as an abstract interface: core definitions

Safe HaskellNone
LanguageHaskell2010

Optics.Internal.Utils

Description

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

Synopsis

Documentation

data Context a b t Source #

Constructors

Context (b -> t) a 
Instances
Functor (Context a b) Source # 
Instance details

Defined in Optics.Internal.Utils

Methods

fmap :: (a0 -> b0) -> Context a b a0 -> Context a b b0 #

(<$) :: a0 -> Context a b b0 -> Context a b a0 #

(#.) :: 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.

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) 
Instances
Applicative f => Semigroup (Traversed f a) Source # 
Instance details

Defined in Optics.Internal.Utils

Methods

(<>) :: Traversed f a -> Traversed f a -> Traversed f a #

sconcat :: NonEmpty (Traversed f a) -> Traversed f a #

stimes :: Integral b => b -> Traversed f a -> Traversed f a #

Applicative f => Monoid (Traversed f a) Source # 
Instance details

Defined in Optics.Internal.Utils

Methods

mempty :: Traversed f a #

mappend :: Traversed f a -> Traversed f a -> Traversed f a #

mconcat :: [Traversed f a] -> Traversed f a #

runTraversed :: Functor f => Traversed f a -> f () Source #

data OrT f a Source #

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

Constructors

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

Defined in Optics.Internal.Utils

Methods

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

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

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

Defined in Optics.Internal.Utils

Methods

pure :: a -> OrT f a #

(<*>) :: OrT f (a -> b) -> OrT f a -> OrT f b #

liftA2 :: (a -> b -> c) -> OrT f a -> OrT f b -> OrT f c #

(*>) :: OrT f a -> OrT f b -> OrT f b #

(<*) :: OrT f a -> OrT f b -> OrT f a #

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

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