Copyright | (c) Fumiaki Kinoshita 2018 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Data.Extensible.Internal.Rig
Description
Re-implementation of lens combinators
Synopsis
- type Optic (p :: k -> k1 -> Type) (f :: k2 -> k1) (s :: k) (t :: k2) (a :: k) (b :: k2) = p a (f b) -> p s (f t)
- type Optic' (p :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = p a (f a) -> p s (f s)
- view :: Optic' (->) (Const a :: Type -> Type) s a -> s -> a
- views :: Optic' (->) (Const r :: Type -> Type) s a -> (a -> r) -> s -> r
- over :: Optic (->) Identity s t a b -> (a -> b) -> s -> t
- withIso :: Optic (Exchange a b) Identity s t a b -> ((s -> a) -> (b -> t) -> r) -> r
- data Exchange a b s t = Exchange (s -> a) (b -> t)
- review :: Optic' (Tagged :: Type -> Type -> Type) Identity s a -> a -> s
Documentation
type Optic (p :: k -> k1 -> Type) (f :: k2 -> k1) (s :: k) (t :: k2) (a :: k) (b :: k2) = p a (f b) -> p s (f t) Source #
type Optic' (p :: k -> k1 -> Type) (f :: k -> k1) (s :: k) (a :: k) = p a (f a) -> p s (f s) Source #
views :: Optic' (->) (Const r :: Type -> Type) s a -> (a -> r) -> s -> r Source #
views
:: Getter s a -> (a -> r) -> (s -> r)
over :: Optic (->) Identity s t a b -> (a -> b) -> s -> t Source #
over
:: Setter s t a b -> (a -> b) -> (s -> t)
withIso :: Optic (Exchange a b) Identity s t a b -> ((s -> a) -> (b -> t) -> r) -> r Source #
Recover tho functions from an Iso/
data Exchange a b s t Source #
Reifies the structure of Iso
s
Constructors
Exchange (s -> a) (b -> t) |
Instances
Profunctor (Exchange a b) Source # | |
Defined in Data.Extensible.Internal.Rig Methods dimap :: (a0 -> b0) -> (c -> d) -> Exchange a b b0 c -> Exchange a b a0 d # lmap :: (a0 -> b0) -> Exchange a b b0 c -> Exchange a b a0 c # rmap :: (b0 -> c) -> Exchange a b a0 b0 -> Exchange a b a0 c # (#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> Exchange a b a0 b0 -> Exchange a b a0 c # (.#) :: forall a0 b0 c q. Coercible b0 a0 => Exchange a b b0 c -> q a0 b0 -> Exchange a b a0 c # | |
Functor (Exchange a b s) Source # | |