proton-0.0.4
Safe HaskellNone
LanguageHaskell2010

Proton

Synopsis

Documentation

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

class Profunctor p => Extraction p where Source #

Methods

extractions :: Comonad w => p (w a) b -> p (w a) (w b) Source #

Instances

Instances details
Distributive f => Extraction (Star f) Source # 
Instance details

Defined in Data.Profunctor.Extraction

Methods

extractions :: Comonad w => Star f (w a) b -> Star f (w a) (w b) Source #

Extraction (Forget r) Source # 
Instance details

Defined in Data.Profunctor.Extraction

Methods

extractions :: Comonad w => Forget r (w a) b -> Forget r (w a) (w b) Source #

Extraction ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Extraction

Methods

extractions :: Comonad w => (w a -> b) -> w a -> w b Source #

act :: (Star f a b -> Star f s t) -> (a -> f b) -> s -> f t Source #

t :: NonEmpty a -> Pair (Maybe a) Source #

coiterate :: forall w a b. (Traversable w, Comonad w) => (w a -> Either b a) -> w a -> w b Source #

class Profunctor p => MStrong p where Source #

Minimal complete definition

mfirst' | msecond'

Methods

mfirst' :: Monoid m => p a b -> p (a, m) (b, m) Source #

msecond' :: Monoid m => p a b -> p (m, a) (m, b) Source #

Instances

Instances details
Functor f => MStrong (Star f) Source # 
Instance details

Defined in Data.Profunctor.MStrong

Methods

mfirst' :: Monoid m => Star f a b -> Star f (a, m) (b, m) Source #

msecond' :: Monoid m => Star f a b -> Star f (m, a) (m, b) Source #

(Functor f, Foldable f) => MStrong (Costar f) Source # 
Instance details

Defined in Data.Profunctor.MStrong

Methods

mfirst' :: Monoid m => Costar f a b -> Costar f (a, m) (b, m) Source #

msecond' :: Monoid m => Costar f a b -> Costar f (m, a) (m, b) Source #

MStrong (Forget r) Source # 
Instance details

Defined in Data.Profunctor.MStrong

Methods

mfirst' :: Monoid m => Forget r a b -> Forget r (a, m) (b, m) Source #

msecond' :: Monoid m => Forget r a b -> Forget r (m, a) (m, b) Source #

MStrong (Tagged :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.MStrong

Methods

mfirst' :: Monoid m => Tagged a b -> Tagged (a, m) (b, m) Source #

msecond' :: Monoid m => Tagged a b -> Tagged (m, a) (m, b) Source #

MStrong ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.MStrong

Methods

mfirst' :: Monoid m => (a -> b) -> (a, m) -> (b, m) Source #

msecond' :: Monoid m => (a -> b) -> (m, a) -> (m, b) Source #

(Traversable f, Distributive g) => MStrong (DoubleStar f g) Source # 
Instance details

Defined in Data.Profunctor.DoubleStar

Methods

mfirst' :: Monoid m => DoubleStar f g a b -> DoubleStar f g (a, m) (b, m) Source #

msecond' :: Monoid m => DoubleStar f g a b -> DoubleStar f g (m, a) (m, b) Source #

class MStrong p => Reflector p where Source #

Methods

reflected :: Applicative f => p a b -> p (f a) (f b) Source #

Instances

Instances details
Distributive f => Reflector (Star f) Source # 
Instance details

Defined in Data.Profunctor.Reflector

Methods

reflected :: Applicative f0 => Star f a b -> Star f (f0 a) (f0 b) Source #

Traversable f => Reflector (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Reflector

Methods

reflected :: Applicative f0 => Costar f a b -> Costar f (f0 a) (f0 b) Source #

Reflector (Tagged :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Reflector

Methods

reflected :: Applicative f => Tagged a b -> Tagged (f a) (f b) Source #

Reflector ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Reflector

Methods

reflected :: Applicative f => (a -> b) -> f a -> f b Source #

type Kaleidoscope' s a = Kaleidoscope s s a a Source #

type Kaleidoscope s t a b = forall p. Reflector p => p a b -> p s t Source #

type Lens' s a = Lens s s a a Source #

type Lens s t a b = forall p. Strong p => p a b -> p s t Source #

lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source #

_1 :: Lens (a, x) (b, x) a b Source #

_2 :: Lens (x, a) (x, b) a b Source #

achrom :: forall s t a b. (s -> Maybe (b -> t)) -> (s -> a) -> (b -> t) -> Lens s t a b Source #

type Prism' s a = Prism s s a a Source #

type Prism s t a b = forall p. Choice p => p a b -> p s t Source #

prism :: (b -> t) -> (s -> Either t a) -> Prism s t a b Source #

prism' :: (b -> s) -> (s -> Maybe a) -> Prism s s a b Source #

_Just :: Prism (Maybe a) (Maybe b) a b Source #

_Left :: Prism (Either a b) (Either a' b) a a' Source #

_Right :: Prism (Either a b) (Either a b') b b' Source #

withPrism :: forall s t a b r. Prism s t a b -> ((b -> t) -> (s -> Either t a) -> r) -> r Source #

matching :: Prism s t a b -> s -> Either t a Source #

type Setter' s a = Setter s s a a Source #

type Setter s t a b = (a -> b) -> s -> t Source #

set :: Setter s t a b -> s -> b -> t Source #

over :: Setter s t a b -> (a -> b) -> s -> t Source #

sets :: (forall p. Profunctor p => p a b -> p s t) -> Setter s t a b Source #

setter :: (s -> a) -> (b -> t) -> Setter s t a b Source #

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

(%~) :: Setter s t a b -> (a -> b) -> s -> t infixr 4 Source #

(.~) :: Setter s t a b -> b -> s -> t infixr 4 Source #

type CoindexedOptic' e p s a = CoindexedOptic e p s s a a Source #

type CoindexedOptic e p s t a b = Optical p (Coindexed e p) s t a b Source #

type IndexedOptic' i p s a = IndexedOptic i p s s a a Source #

type IndexedOptic i q s t a b = forall p. Indexable i p q => Optical p q s t a b Source #

type Optical' p q s a = Optical p q s s a a Source #

type Optical p q s t a b = p a b -> q s t Source #

type Optic' p s a = Optic p s s a a Source #

type Optic p s t a b = p a b -> p s t Source #

cat :: Expansive p => Optic p [a] b a b Source #

data CoPrism a b s t Source #

Constructors

CoPrism (s -> a) (b -> Either a t) 

Instances

Instances details
Profunctor (CoPrism a b) Source # 
Instance details

Defined in Proton.Loop

Methods

dimap :: (a0 -> b0) -> (c -> d) -> CoPrism a b b0 c -> CoPrism a b a0 d #

lmap :: (a0 -> b0) -> CoPrism a b b0 c -> CoPrism a b a0 c #

rmap :: (b0 -> c) -> CoPrism a b a0 b0 -> CoPrism a b a0 c #

(#.) :: forall a0 b0 c q. Coercible c b0 => q b0 c -> CoPrism a b a0 b0 -> CoPrism a b a0 c #

(.#) :: forall a0 b0 c q. Coercible b0 a0 => CoPrism a b b0 c -> q a0 b0 -> CoPrism a b a0 c #

Cochoice (CoPrism a b) Source # 
Instance details

Defined in Proton.Loop

Methods

unleft :: CoPrism a b (Either a0 d) (Either b0 d) -> CoPrism a b a0 b0 #

unright :: CoPrism a b (Either d a0) (Either d b0) -> CoPrism a b a0 b0 #

type Loop' s a = Loop s s a a Source #

type Loop s t a b = forall p. Cochoice p => p a b -> p s t Source #

loop :: forall p s t a b. Cochoice p => (s -> a) -> (b -> Either a t) -> Optic p s t a b Source #

iterM :: forall s t a. Optic (Star ((,) [a])) s t a a -> (a -> Either a a) -> s -> ([a], t) Source #

indexing :: Indexable i p q => (s -> i) -> p s t -> q s t Source #

itoListOf :: IndexedOptic i (Forget [(i, a)]) s t a b -> s -> [(i, a)] Source #

iover :: IndexedOptic i (->) s t a b -> (i -> a -> b) -> s -> t Source #

iset :: IndexedOptic i (->) s t a b -> (i -> b) -> s -> t Source #

newtype Zipping a b Source #

Constructors

Zipping (a -> a -> b) 

type Grate' s a = Grate s s a a Source #

type Grate s t a b = forall p. Closed p => p a b -> p s t Source #

grate :: (((s -> a) -> b) -> t) -> Grate s t a b Source #

distributed :: (Closed p, Representable g) => p a b -> p (g a) (g b) Source #

both :: Grate (a, a) (b, b) a b Source #

zipWithOf :: forall s t a b. Optic (Costar Pair) s t a b -> (a -> a -> b) -> s -> s -> t Source #

zipFWithOf :: forall f s t a b. Optic (Costar f) s t a b -> (f a -> b) -> f s -> t Source #

type Getter s t a b = forall p. Phantom p => p a b -> p s t Source #

to :: Profunctor p => (s -> a) -> Optic p s b a b Source #

to' :: (s -> a) -> Getter s t a b Source #

to'' :: (s -> a) -> Optic (Forget r) s t a b Source #

view :: Optic (Forget a) s t a b -> s -> a Source #

views :: Optic (Forget a) s t a b -> (a -> a') -> s -> a' Source #

like :: a -> Getter s t a b Source #

(^.) :: s -> Optic (Forget a) s t a b -> a infixl 8 Source #

type Review s t a b = forall p. (Profunctor p, Bifunctor p) => p a b -> p s t Source #

retagged :: forall p a b s. (Profunctor p, Bifunctor p) => p a b -> p s b Source #

review :: (Tagged a b -> Tagged s t) -> b -> t Source #

(#) :: (Tagged a b -> Tagged s t) -> b -> t infixr 8 Source #

reviews :: (Tagged a b -> Tagged s t) -> (t -> t') -> b -> t' Source #

re :: (Tagged a b -> Tagged s t) -> Getter b a t s Source #

unto :: forall (s :: *) t (a :: *) b. (b -> t) -> Tagged a b -> Tagged s t Source #

un :: Getter s t a b -> Tagged t s -> Tagged b a Source #

data Exchange a b s t Source #

Constructors

Exchange (s -> a) (b -> t) 

Instances

Instances details
Profunctor (Exchange a b) Source # 
Instance details

Defined in Proton.Iso

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 # 
Instance details

Defined in Proton.Iso

Methods

fmap :: (a0 -> b0) -> Exchange a b s a0 -> Exchange a b s b0 #

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

type Iso' s a = Iso s s a a Source #

type Iso s t a b = forall p. Profunctor p => p a b -> p s t Source #

iso :: (s -> a) -> (b -> t) -> Iso s t a b Source #

from :: Iso s t a b -> Iso b a t s Source #

withIso :: Iso s t a b -> ((s -> a) -> (b -> t) -> r) -> r Source #

under :: Iso s t a b -> (t -> s) -> b -> a Source #

mapping :: (Functor f, Functor g) => Iso s t a b -> Iso (f s) (g t) (f a) (g b) Source #

involuted :: (a -> a) -> Iso' a a Source #

type Glassed p = (Strong p, Closed p) Source #

type Glass' s a = Glass s s a a Source #

type Glass s t a b = forall p. (Strong p, Closed p) => Optic p s t a b Source #

glassed :: (Strong p, Closed p) => p a b -> p (s, u -> a) (s, u -> b) Source #

glass :: forall p s t a b. Glassed p => (((s -> a) -> b) -> s -> t) -> p a b -> p s t Source #

glassList :: forall a b. Glass [a] [b] a b Source #

extendOf :: Comonad w => Optic (Costar w) s t a b -> (w a -> b) -> w s -> w t Source #

traversed' :: forall f a b. Traversable f => Glass (f a) (f b) a b Source #

type Fold s t a b = forall p. (Traversing p, Phantom p) => p a b -> p s t Source #

folding :: (Foldable f, Phantom p, Traversing p) => (s -> f a) -> p a b -> p s t Source #

folded :: (Traversing p, Foldable f, Phantom p) => p a b -> p (f a) t Source #

foldOf :: Monoid a => Fold s t a b -> s -> a Source #

foldMapOf :: Monoid m => Optic (Forget m) s t a b -> (a -> m) -> s -> m Source #

toListOf :: Optic (Forget [a]) s t a b -> s -> [a] Source #

preview :: Optic (Forget (First a)) s t a b -> s -> Maybe a Source #

(^?) :: s -> Optic (Forget (First a)) s t a b -> Maybe a Source #

(^..) :: s -> Optic (Forget [a]) s t a b -> [a] Source #

(<+>) :: Semigroup r => Optic (Forget r) s t a b -> Optic (Forget r) s t' a b' -> Optic (Forget r) s t a b Source #

type Traversal' s a = forall p. Traversing p => p a a -> p s s Source #

type Traversal s t a b = forall p. Traversing p => p a b -> p s t Source #

traversed :: Traversable f => Traversal (f a) (f b) a b Source #

filtered :: (a -> Bool) -> Traversal' a a Source #

traverseOf :: Optic (Star f) s t a b -> (a -> f b) -> s -> f t Source #

(%%~) :: Optic (Star f) s t a b -> (a -> f b) -> s -> f t infixr 4 Source #

beside :: forall s t a b s' t' p r. (Representable p, Bitraversable r, Applicative (Rep p)) => Optic p s t a b -> Optic p s' t' a b -> Optic p (r s s') (r t t') a b Source #

unsafePartsOf :: forall s t a b. (forall p. Traversing p => p a b -> p s t) -> Lens s t [a] [b] Source #

partsOf :: forall s a. (forall p. Traversing p => p a a -> p s s) -> Lens' s [a] Source #

taking :: forall q s a. Traversing q => Int -> (forall p. Traversing p => p a a -> p s s) -> Optic' q s a Source #

dropping :: forall s a. Int -> Traversal' s a -> Traversal' s a Source #

type Grid' s a = Grid s s a a Source #

type Grid s t a b = forall p. (Traversing p, Closed p) => Optic p s t a b Source #

type Feedback' s a = Feedback s s a a Source #

type Feedback s t a b = forall p. Costrong p => p a b -> p s t Source #

feedback :: forall p s t a b. Costrong p => ((s, b) -> a) -> (b -> (t, b)) -> Optic p s t a b Source #

diffract :: Distributive f => Optic (Star f) s t a b -> (a -> f b) -> s -> f t Source #

class Profunctor p => MChoice p where Source #

Minimal complete definition

Nothing

Methods

mleft' :: p a b -> p (Either a m) (Either b m) Source #

mright' :: p a b -> p (Either m a) (Either m b) Source #

Instances

Instances details
Applicative f => MChoice (Star f) Source # 
Instance details

Defined in Proton.Coalgebraic

Methods

mleft' :: Star f a b -> Star f (Either a m) (Either b m) Source #

mright' :: Star f a b -> Star f (Either m a) (Either m b) Source #

Traversable f => MChoice (Costar f) Source # 
Instance details

Defined in Proton.Coalgebraic

Methods

mleft' :: Costar f a b -> Costar f (Either a m) (Either b m) Source #

mright' :: Costar f a b -> Costar f (Either m a) (Either m b) Source #

Monoid r => MChoice (Forget r) Source # 
Instance details

Defined in Proton.Coalgebraic

Methods

mleft' :: Forget r a b -> Forget r (Either a m) (Either b m) Source #

mright' :: Forget r a b -> Forget r (Either m a) (Either m b) Source #

MChoice ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Proton.Coalgebraic

Methods

mleft' :: (a -> b) -> Either a m -> Either b m Source #

mright' :: (a -> b) -> Either m a -> Either m b Source #

type Coalgebraic' s a = Coalgebraic s s a a Source #

type Coalgebraic s t a b = forall p. MChoice p => Optic p s t a b Source #

coprism :: (b -> t) -> (s -> Either t a) -> Coalgebraic s t a b Source #

coalgPrism :: Prism s t a b -> Coalgebraic s t a b Source #

type AlgebraicLens s t a b = forall p. MStrong p => p a b -> p s t Source #

algebraic :: forall m p s t a b. (Monoid m, MStrong p) => (s -> m) -> (s -> a) -> (m -> b -> t) -> Optic p s t a b Source #

listLens :: MStrong p => (s -> a) -> ([s] -> b -> t) -> Optic p s t a b Source #

altLens :: (Alternative f, MStrong p) => (s -> a) -> (f s -> b -> t) -> Optic p s t a b Source #

(?.) :: Optic (Costar f) s t a b -> b -> f s -> t infixr 4 Source #

(>-) :: Optic (Costar f) s t a b -> (f a -> b) -> f s -> t infixr 4 Source #