definitive-base-1.2: The base modules of the Definitive framework.

Safe HaskellNone

Algebra.Functor

Description

A module for functors

Synopsis

Documentation

class Functor f whereSource

Methods

map :: (a -> b) -> f a -> f bSource

Instances

Functor [] 
Functor IO 
Functor Maybe 
Functor Set 
Functor Tree 
Functor Interleave 
Functor OrdList 
Functor Id 
Functor Strict 
Functor ((->) a) 
Functor (Either b) 
Functor ((,) b) 
Functor (Map k) 
Functor (Const a) 
Functor f => Functor (Backwards f) 
Functor f => Functor (Zip f) 
Functor m => Functor (MaybeT m) 
Functor m => Functor (TreeT m) 
Functor m => Functor (ListT m) 
(Functor f, Functor g) => Functor (:++: f g) 
(Functor f, Functor g) => Functor (:**: f g) 
(Functor f, Functor g) => Functor (:.: f g) 
(Functor f, Functor g) => Functor (Compose' f g) 
Functor f => Functor (Kleisli f a) 
Functor m => Functor (StateT s m) 
Functor m => Functor (ReaderT r m) 
Functor m => Functor (WriterT w m) 
Functor f => Functor (ContT r f) 
Functor m => Functor (EitherT e m) 
Functor m => Functor (ProbT t m) 
Functor m => Functor (WriterAccT w acc m) 
Functor f => Functor (RWST r w s f) 

class Cofunctor f whereSource

Methods

comap :: (a -> b) -> f b -> f aSource

Instances

(Functor f, Cofunctor g) => Cofunctor (:.: f g) 
Cofunctor (Flip (->) a) 

class Bifunctor p whereSource

Methods

dimap :: (c -> a) -> (b -> d) -> p a b -> p c dSource

Instances

Bifunctor (->) 

class Commutative f whereSource

Methods

commute :: f a b -> f b aSource

class Functor t => Contravariant t whereSource

Methods

collect :: Functor f => f (t a) -> t (f a)Source

newtype Strict a Source

Constructors

Strict 

Fields

lazy :: a
 

newtype Id a Source

The Identity Functor

Constructors

Id 

Fields

getId :: a
 

newtype Const a b Source

The Constant Functor

Constructors

Const 

Fields

getConst :: a
 

Instances

Isomorphic a b (Const a c) (Const b c) 
Monoid a => Unit (Const a) 
Monoid a => Applicative (Const a) 
Functor (Const a) 
Monoid a => Monoid (Const a b) 
Semigroup a => Semigroup (Const a b) 

newtype Flip f a b Source

A motherflippin' functor

Constructors

Flip 

Fields

unFlip :: f b a
 

Instances

Cofunctor (Flip (->) a) 
Isomorphic (f a b) (f c d) (Flip f b a) (Flip f d c) 
Monoid (f b a) => Monoid (Flip f a b) 
Semigroup (f b a) => Semigroup (Flip f a b) 
(Ord b, Ord a) => DataMap (Flip Bimap b a) b a 

newtype (f :.: g) a Source

The Composition functor

Constructors

Compose 

Fields

getCompose :: f (g a)
 

Instances

Monad m => ConcreteMonad (:.: m) 
Monad m => MonadTrans (:.: m) 
Isomorphic (f (g a)) (f' (g' b)) (:.: f g a) (:.: f' g' b) 
(Unit f, Unit g) => Unit (:.: f g) 
(MonadFix f, Traversable g, Monad g) => MonadFix (:.: f g) 
(Traversable f, Traversable g) => Traversable (:.: f g) 
(Foldable f, Foldable g) => Foldable (:.: f g) 
(Traversable g, Monad f, Monad g) => Monad (:.: f g) 
(Applicative f, Applicative g) => Applicative (:.: f g) 
(Functor f, Functor g) => Functor (:.: f g) 
(Functor f, Cofunctor g) => Cofunctor (:.: f g) 
(Applicative f, Monoid (g a)) => Monoid (:.: f g a) 
(Applicative f, Semigroup (g a)) => Semigroup (:.: f g a) 

data (f :**: g) a Source

Constructors

(f a) :**: (g a) 

Instances

(Unit f, Unit g) => Unit (:**: f g) 
(Traversable f, Traversable g) => Traversable (:**: f g) 
(Foldable f, Foldable g) => Foldable (:**: f g) 
(Applicative f, Applicative g) => Applicative (:**: f g) 
(Functor f, Functor g) => Functor (:**: f g) 

newtype (f :++: g) a Source

Constructors

Sum 

Fields

getSum :: f a :+: g a
 

Instances

(Traversable f, Traversable g) => Traversable (:++: f g) 
(Foldable f, Foldable g) => Foldable (:++: f g) 
(Functor f, Functor g) => Functor (:++: f g) 

flip :: (Contravariant c, Functor f) => f (c a) -> c (f a)Source

project :: (Contravariant c, Functor f) => (a -> c b) -> f a -> c (f b)Source

The Contravariant version of traverse

(<$>) :: Functor f => (a -> b) -> f a -> f bSource

(|||) :: (Choice k, Functor (k a), Functor (k b)) => k a c -> k b d -> k (a :+: b) (c :+: d)Source

(<$) :: Functor f => b -> f a -> f bSource

(<&>) :: Functor f => f a -> (a -> b) -> f bSource

void :: Functor f => f a -> f ()Source

left :: (Choice k, Functor (k a), Functor (k c)) => k a b -> k (a :+: c) (b :+: c)Source

right :: (Choice k, Functor (k a), Functor (k c)) => k a b -> k (c :+: a) (c :+: b)Source

promap :: Cofunctor (Flip f c) => (a -> b) -> f b c -> f a cSource

map2 :: (Functor f, Functor f') => (a -> b) -> f (f' a) -> f (f' b)Source

map3 :: (Functor f, Functor f', Functor f'') => (a -> b) -> f (f' (f'' a)) -> f (f' (f'' b))Source