optics-core-0.1

Safe HaskellNone
LanguageHaskell2010

Optics.AffineFold

Description

TODO: what's affine fold.

Synopsis

Documentation

data An_AffineFold :: OpticKind #

Tag for an affine fold.

Instances
Is An_AffineFold A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_AffineFold A_Fold p -> (Constraints An_AffineFold p -> r) -> Constraints A_Fold p -> r

Is A_Getter An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Getter An_AffineFold p -> (Constraints A_Getter p -> r) -> Constraints An_AffineFold p -> r

Is A_PrismaticGetter An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_PrismaticGetter An_AffineFold p -> (Constraints A_PrismaticGetter p -> r) -> Constraints An_AffineFold p -> r

Is An_AffineTraversal An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

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

Is A_Prism An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

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

Is A_Lens An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

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

Is An_Iso An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

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

Is An_Equality An_AffineFold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

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

ViewableOptic An_AffineFold r # 
Instance details

Defined in Optics.Internal.View

Associated Types

type ViewResult An_AffineFold r :: * #

Methods

view :: Optic' An_AffineFold is s r -> s -> ViewResult An_AffineFold r #

type ViewResult An_AffineFold r # 
Instance details

Defined in Optics.Internal.View

type AffineFold s a = Optic' An_AffineFold '[] s a #

Type synonym for an affine fold.

view01 :: Is k An_AffineFold => Optic' k is s a -> s -> Maybe a #

View through AffineFold.

>>> view01 _Right (Right 'x')
Just 'x'
>>> view01 _Right (Left 'y')
Nothing

afolding :: (s -> Maybe a) -> AffineFold s a #

Create a an AffineFold from a partial function.

>>> view01 (afolding listToMaybe) "foo"
Just 'f'