optics-core-0.1

Safe HaskellNone
LanguageHaskell2010

Optics.Setter

Synopsis

Documentation

data A_Setter :: OpticKind #

Tag for a setter.

Instances
UnindexableOptic A_Setter # 
Instance details

Defined in Optics.Unindexed

Methods

unIx :: CheckIndices i is => Optic A_Setter is s t a b -> Optic A_Setter [] s t a b #

Is A_Traversal A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Traversal A_Setter p -> (Constraints A_Traversal p -> r) -> Constraints A_Setter p -> r

Is An_AffineTraversal A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_AffineTraversal A_Setter p -> (Constraints An_AffineTraversal p -> r) -> Constraints A_Setter p -> r

Is A_Prism A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Prism A_Setter p -> (Constraints A_Prism p -> r) -> Constraints A_Setter p -> r

Is A_Lens A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Lens A_Setter p -> (Constraints A_Lens p -> r) -> Constraints A_Setter p -> r

Is An_Iso A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Iso A_Setter p -> (Constraints An_Iso p -> r) -> Constraints A_Setter p -> r

Is An_Equality A_Setter # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Equality A_Setter p -> (Constraints An_Equality p -> r) -> Constraints A_Setter p -> r

type Setter s t a b = Optic A_Setter '[] s t a b #

Type synonym for a type-modifying setter.

type Setter' s a = Optic' A_Setter '[] s a #

Type synonym for a type-preserving setter.

toSetter :: Is k A_Setter => Optic k is s t a b -> Optic A_Setter is s t a b #

Explicitly cast an optic to a setter.

over :: Is k A_Setter => Optic k is s t a b -> (a -> b) -> s -> t #

Apply a setter as a modifier.

set :: Is k A_Setter => Optic k is s t a b -> b -> s -> t #

Apply a setter.

>>> set _1 'x' ('y', 'z')
('x','z')

sets :: ((a -> b) -> s -> t) -> Setter s t a b #

Build a setter from a function to modify the element(s).

mapped :: Functor f => Setter (f a) (f b) a b #

Setter via the Functor class.