Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell2010 |

The Point data type which generalizes the different lenses and forms the
basis for vertical composition using the `Applicative`

type class.

## Synopsis

- data Point cat g i f o = Point (cat f o) (cat (cat o i, f) g)
- get :: Point cat g i f o -> cat f o
- modify :: Point cat g i f o -> cat (cat o i, f) g
- set :: Arrow arr => Point arr g i f o -> arr (i, f) g
- identity :: ArrowApply arr => Point arr f f o o
- compose :: ArrowApply cat => Point cat t i b o -> Point cat g t f b -> Point cat g i f o
- data Iso cat i o = Iso {}
- inv :: Iso cat i o -> Iso cat o i
- type Total = (->)
- type Partial = Kleisli Maybe
- type Failing e = Kleisli (Either e)
- class Arrow a => ArrowFail e a where
- failArrow :: a e c

# The point data type that generalizes lens.

data Point cat g i f o Source #

Abstract Point datatype. The getter and modifier operations work in some category. The type of the value pointed to might change, thereby changing the type of the outer structure.

Point (cat f o) (cat (cat o i, f) g) |

#### Instances

Arrow arr => Functor (Point arr f i f) Source # | |

Arrow arr => Applicative (Point arr f i f) Source # | |

Defined in Data.Label.Point pure :: a -> Point arr f i f a # (<*>) :: Point arr f i f (a -> b) -> Point arr f i f a -> Point arr f i f b # liftA2 :: (a -> b -> c) -> Point arr f i f a -> Point arr f i f b -> Point arr f i f c # (*>) :: Point arr f i f a -> Point arr f i f b -> Point arr f i f b # (<*) :: Point arr f i f a -> Point arr f i f b -> Point arr f i f a # | |

Alternative (Point Partial f view f) Source # | |

identity :: ArrowApply arr => Point arr f f o o Source #

Identity Point. Cannot change the type.

compose :: ArrowApply cat => Point cat t i b o -> Point cat g t f b -> Point cat g i f o Source #

Point composition.

# Working with isomorphisms.

# Specialized lens contexts.

type Failing e = Kleisli (Either e) Source #

Context that represents computations that might fail with some error.