definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Algebra.Functor

Contents

Description

A module for functors

Synopsis

Documentation

class Functor f where Source #

Minimal complete definition

map

Methods

map :: (a -> b) -> f a -> f b Source #

Instances

Functor Strict Source # 

Methods

map :: (a -> b) -> Strict a -> Strict b Source #

Functor DeQue Source # 

Methods

map :: (a -> b) -> DeQue a -> DeQue b Source #

Functor TimeVal Source # 

Methods

map :: (a -> b) -> TimeVal a -> TimeVal b Source #

Functor (Increasing k) Source # 

Methods

map :: (a -> b) -> Increasing k a -> Increasing k b Source #

Functor (Const a) Source # 

Methods

map :: (a -> b) -> Const a a -> Const a b Source #

Functor f => Functor (Backwards f) Source # 

Methods

map :: (a -> b) -> Backwards f a -> Backwards f b Source #

Functor f => Functor (Zip f) Source # 

Methods

map :: (a -> b) -> Zip f a -> Zip f b Source #

Functor (ContT f) Source # 

Methods

map :: (a -> b) -> ContT f a -> ContT f b Source #

Functor w => Functor (Cofree w) Source # 

Methods

map :: (a -> b) -> Cofree w a -> Cofree w b Source #

Functor f => Functor (Free f) Source # 

Methods

map :: (a -> b) -> Free f a -> Free f b Source #

Functor m => Functor (StrictT m) Source # 

Methods

map :: (a -> b) -> StrictT m a -> StrictT m b Source #

Functor m => Functor (MaybeT m) Source # 

Methods

map :: (a -> b) -> MaybeT m a -> MaybeT m b Source #

Functor m => Functor (TreeT m) Source # 

Methods

map :: (a -> b) -> TreeT m a -> TreeT m b Source #

Functor m => Functor (ListT m) Source # 

Methods

map :: (a -> b) -> ListT m a -> ListT m b Source #

Functor (LogicT m) Source # 

Methods

map :: (a -> b) -> LogicT m a -> LogicT m b Source #

Functor (IOVar w) Source # 

Methods

map :: (a -> b) -> IOVar w a -> IOVar w b Source #

(Functor f, Functor g) => Functor ((:++:) f g) Source # 

Methods

map :: (a -> b) -> (f :++: g) a -> (f :++: g) b Source #

(Functor f, Functor g) => Functor ((:**:) f g) Source # 

Methods

map :: (a -> b) -> (f :**: g) a -> (f :**: g) b Source #

(Functor f, Functor g) => Functor ((:.:) f g) Source # 

Methods

map :: (a -> b) -> (f :.: g) a -> (f :.: g) b Source #

(Functor f, Functor g) => Functor (Compose' f g) Source # 

Methods

map :: (a -> b) -> Compose' f g a -> Compose' f g b Source #

Functor f => Functor (Kleisli f a) Source # 

Methods

map :: (a -> b) -> Kleisli f a a -> Kleisli f a b Source #

Functor m => Functor (EitherT e m) Source # 

Methods

map :: (a -> b) -> EitherT e m a -> EitherT e m b Source #

Functor m => Functor (ReaderT r m) Source # 

Methods

map :: (a -> b) -> ReaderT r m a -> ReaderT r m b Source #

Functor m => Functor (StateT s m) Source # 

Methods

map :: (a -> b) -> StateT s m a -> StateT s m b Source #

Functor m => Functor (WriterT w m) Source # 

Methods

map :: (a -> b) -> WriterT w m a -> WriterT w m b Source #

Functor (ProbT t m) Source # 

Methods

map :: (a -> b) -> ProbT t m a -> ProbT t m b Source #

Functor (Queue push pop) Source # 

Methods

map :: (a -> b) -> Queue push pop a -> Queue push pop b Source #

Functor m => Functor (CounterT w acc m) Source # 

Methods

map :: (a -> b) -> CounterT w acc m a -> CounterT w acc m b Source #

Functor f => Functor (RWST r w s f) Source # 

Methods

map :: (a -> b) -> RWST r w s f a -> RWST r w s f b Source #

class Cofunctor f where Source #

Minimal complete definition

comap

Methods

comap :: (a -> b) -> f b -> f a Source #

Instances

(Functor f, Cofunctor g) => Cofunctor ((:.:) f g) Source # 

Methods

comap :: (a -> b) -> (f :.: g) b -> (f :.: g) a Source #

Cofunctor (Flip (->) a) Source # 

Methods

comap :: (a -> b) -> Flip (->) a b -> Flip (->) a a Source #

class Bifunctor p where Source #

Methods

dimap :: (c -> a) -> (b -> d) -> p a b -> p c d Source #

dimap :: (Functor (p a), Cofunctor (Flip p d)) => (c -> a) -> (b -> d) -> p a b -> p c d Source #

Instances

Bifunctor (->) Source # 

Methods

dimap :: (c -> a) -> (b -> d) -> (a -> b) -> c -> d Source #

class Commutative f where Source #

Minimal complete definition

commute

Methods

commute :: f a b -> f b a Source #

Instances

Commutative (,) Source # 

Methods

commute :: (a, b) -> (b, a) Source #

Commutative Bimap Source # 

Methods

commute :: Bimap a b -> Bimap b a Source #

Commutative (Relation e) Source # 

Methods

commute :: Relation e a b -> Relation e b a Source #

class Functor t => Contravariant t where Source #

Minimal complete definition

collect

Methods

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

Instances

Contravariant Id Source # 

Methods

collect :: Functor f => f (Id a) -> Id (f a) Source #

Contravariant Strict Source # 

Methods

collect :: Functor f => f (Strict a) -> Strict (f a) Source #

Contravariant ((->) a) Source # 

Methods

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

(Contravariant f, Contravariant g) => Contravariant ((:.:) f g) Source # 

Methods

collect :: Functor f => f ((f :.: g) a) -> (f :.: g) (f a) Source #

Contravariant f => Contravariant (Kleisli f a) Source # 

Methods

collect :: Functor f => f (Kleisli f a a) -> Kleisli f a (f a) Source #

newtype Strict a Source #

Constructors

Strict 

Fields

Instances

Unit Strict Source # 

Methods

pure :: a -> Strict a Source #

Monad Strict Source # 

Methods

join :: Strict (Strict a) -> Strict a Source #

(>>=) :: Strict a -> (a -> Strict b) -> Strict b Source #

Applicative Strict Source # 
SemiApplicative Strict Source # 

Methods

(<*>) :: Strict (a -> b) -> Strict a -> Strict b Source #

Functor Strict Source # 

Methods

map :: (a -> b) -> Strict a -> Strict b Source #

Contravariant Strict Source # 

Methods

collect :: Functor f => f (Strict a) -> Strict (f a) Source #

newtype Id a Source #

The Identity Functor

Constructors

Id 

Fields

Instances

Unit Id Source # 

Methods

pure :: a -> Id a Source #

Contravariant Id Source # 

Methods

collect :: Functor f => f (Id a) -> Id (f a) Source #

Isomorphic a b (Id a) (Id b) Source # 

Methods

i'_ :: Iso (Id b) (Id a) b a Source #

Show a => Show (Id a) Source # 

Methods

showsPrec :: Int -> Id a -> ShowS #

show :: Id a -> String #

showList :: [Id a] -> ShowS #

Semigroup (Id a) Source # 

Methods

(+) :: Id a -> Id a -> Id a Source #

StateRes r a b => StateRes (Id r) a b Source # 

Methods

evalS :: Id r -> b Source #

execS :: Id r -> a Source #

newtype Const a b Source #

The Constant Functor

Constructors

Const 

Fields

Instances

Isomorphic a b (Const a c) (Const b c) Source # 

Methods

i'_ :: Iso (Const b c) (Const a c) b a Source #

Monoid a => Unit (Const a) Source # 

Methods

pure :: a -> Const a a Source #

Monoid a => Applicative (Const a) Source # 
Monoid a => SemiApplicative (Const a) Source # 

Methods

(<*>) :: Const a (a -> b) -> Const a a -> Const a b Source #

Functor (Const a) Source # 

Methods

map :: (a -> b) -> Const a a -> Const a b Source #

Monoid a => Monoid (Const a b) Source # 

Methods

zero :: Const a b Source #

Semigroup a => Semigroup (Const a b) Source # 

Methods

(+) :: Const a b -> Const a b -> Const a b Source #

newtype Flip f a b Source #

A motherflippin' functor

Constructors

Flip 

Fields

Instances

Cofunctor (Flip (->) a) Source # 

Methods

comap :: (a -> b) -> Flip (->) a b -> Flip (->) a a Source #

Isomorphic (f a b) (f c d) (Flip f b a) (Flip f d c) Source # 

Methods

i'_ :: Iso (Flip f d c) (Flip f b a) (f c d) (f a b) Source #

Monoid (f b a) => Monoid (Flip f a b) Source # 

Methods

zero :: Flip f a b Source #

Semigroup (f b a) => Semigroup (Flip f a b) Source # 

Methods

(+) :: Flip f a b -> Flip f a b -> Flip f a b Source #

(Ord b, Ord a) => DataMap (Flip Bimap b a) b a Source # 

Methods

at :: b -> Lens' (Flip Bimap b a) (Maybe a) Source #

newtype (f :.: g) a Source #

The Composition functor

Constructors

Compose 

Fields

Instances

Isomorphic (f (g a)) (f' (g' b)) ((:.:) f g a) ((:.:) f' g' b) Source # 

Methods

i'_ :: Iso ((f' :.: g') b) ((f :.: g) a) (f' (g' b)) (f (g a)) Source #

(Unit f, Unit g) => Unit ((:.:) f g) Source # 

Methods

pure :: a -> (f :.: g) a Source #

(Functor f, Functor g) => Functor ((:.:) f g) Source # 

Methods

map :: (a -> b) -> (f :.: g) a -> (f :.: g) b Source #

(Contravariant f, Contravariant g) => Contravariant ((:.:) f g) Source # 

Methods

collect :: Functor f => f ((f :.: g) a) -> (f :.: g) (f a) Source #

(Functor f, Cofunctor g) => Cofunctor ((:.:) f g) Source # 

Methods

comap :: (a -> b) -> (f :.: g) b -> (f :.: g) a Source #

Eq (f (g a)) => Eq ((:.:) f g a) Source # 

Methods

(==) :: (f :.: g) a -> (f :.: g) a -> Bool #

(/=) :: (f :.: g) a -> (f :.: g) a -> Bool #

Ord (f (g a)) => Ord ((:.:) f g a) Source # 

Methods

compare :: (f :.: g) a -> (f :.: g) a -> Ordering #

(<) :: (f :.: g) a -> (f :.: g) a -> Bool #

(<=) :: (f :.: g) a -> (f :.: g) a -> Bool #

(>) :: (f :.: g) a -> (f :.: g) a -> Bool #

(>=) :: (f :.: g) a -> (f :.: g) a -> Bool #

max :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a #

min :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a #

(Applicative f, DataMap (g a) k' a, DataMap (f (g a)) k (g a)) => DataMap ((:.:) f g a) (k, k') a Source # 

Methods

at :: (k, k') -> Lens' ((f :.: g) a) (Maybe a) Source #

data (f :**: g) a Source #

Constructors

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

Instances

(Functor f, Functor g) => Functor ((:**:) f g) Source # 

Methods

map :: (a -> b) -> (f :**: g) a -> (f :**: g) b Source #

newtype (f :++: g) a Source #

Constructors

Sum 

Fields

Instances

(Functor f, Functor g) => Functor ((:++:) f g) Source # 

Methods

map :: (a -> b) -> (f :++: g) a -> (f :++: g) b Source #

newtype Increasing k a Source #

A functor for ordered lists

Constructors

Increasing ((OrdList :.: Assoc k) a) 

Instances

Functor (Increasing k) Source # 

Methods

map :: (a -> b) -> Increasing k a -> Increasing k b Source #

Ord k => Monoid (Increasing k a) Source # 

Methods

zero :: Increasing k a Source #

Ord k => Semigroup (Increasing k a) Source # 

Methods

(+) :: Increasing k a -> Increasing k a -> Increasing k a Source #

emerge :: (Functor f, Unit g) => (f :.: g) a -> (f :.: g) (g a) Source #

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

factor :: (Contravariant c, Unit c, Bifunctor f, Functor (f a)) => f (c a) (c b) -> c (f a b) Source #

(<$>) :: Functor f => (a -> b) -> f a -> f b infixr 2 Source #

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

(<$) :: Functor f => b -> f a -> f b infixr 2 Source #

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 Source #

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 c Source #

fill :: Functor f => b -> f a -> f b Source #

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 #

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

Orphan instances

MonadFix Id Source # 

Methods

mfix :: (a -> Id a) -> Id a Source #

Monad IO Source # 

Methods

join :: IO (IO a) -> IO a Source #

(>>=) :: IO a -> (a -> IO b) -> IO b Source #

Monad Id Source # 

Methods

join :: Id (Id a) -> Id a Source #

(>>=) :: Id a -> (a -> Id b) -> Id b Source #

Applicative IO Source # 
Applicative Id Source # 
SemiApplicative IO Source # 

Methods

(<*>) :: IO (a -> b) -> IO a -> IO b Source #

SemiApplicative Id Source # 

Methods

(<*>) :: Id (a -> b) -> Id a -> Id b Source #

Functor [] Source # 

Methods

map :: (a -> b) -> [a] -> [b] Source #

Functor Maybe Source # 

Methods

map :: (a -> b) -> Maybe a -> Maybe b Source #

Functor IO Source # 

Methods

map :: (a -> b) -> IO a -> IO b Source #

Functor Tree Source # 

Methods

map :: (a -> b) -> Tree a -> Tree b Source #

Functor Interleave Source # 

Methods

map :: (a -> b) -> Interleave a -> Interleave b Source #

Functor OrdList Source # 

Methods

map :: (a -> b) -> OrdList a -> OrdList b Source #

Functor Id Source # 

Methods

map :: (a -> b) -> Id a -> Id b Source #

Functor ((->) a) Source # 

Methods

map :: (a -> b) -> (a -> a) -> a -> b Source #

Functor (Either b) Source # 

Methods

map :: (a -> b) -> Either b a -> Either b b Source #

Functor ((,) b) Source # 

Methods

map :: (a -> b) -> (b, a) -> (b, b) Source #

Functor (Assoc k) Source # 

Methods

map :: (a -> b) -> Assoc k a -> Assoc k b Source #