| Safe Haskell | None |
|---|
SimpleH.Functor
Description
A module for functors
- class Functor f where
- map :: (a -> b) -> f a -> f b
- class Cofunctor f where
- comap :: (a -> b) -> f b -> f a
- class Bifunctor p where
- dimap :: (c -> a) -> (b -> d) -> p a b -> p c d
- newtype Id a = Id {
- getId :: a
- newtype Const a b = Const {
- getConst :: a
- newtype Flip f a b = Flip {
- unFlip :: f b a
- newtype Compose f g a = Compose {
- getCompose :: f (g a)
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- (|||) :: (Choice k, Functor (k a), Functor (k b)) => k a c -> k b d -> k (a :+: b) (c :+: d)
- (<$) :: Functor f => b -> f a -> f b
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- void :: Functor f => f a -> f ()
- left :: (Choice k, Functor (k a), Functor (k d)) => k a c -> k (:+: a d) (:+: c d)
- right :: (Choice k, Functor (k c), Functor (k b)) => k b d -> k (:+: c b) (:+: c d)
- promap :: Cofunctor (Flip f c) => (a -> b) -> f b c -> f a c
- map2 :: (Functor f, Functor f') => (a -> b) -> f (f' a) -> f (f' b)
- map3 :: (Functor f, Functor f', Functor f'') => (a -> b) -> f (f' (f'' a)) -> f (f' (f'' b))
Documentation
Instances
| Functor [] | |
| Functor IO | |
| Functor Maybe | |
| Functor Tree | |
| Functor Interleave | |
| Functor OrdList | |
| Functor Id | |
| Functor ZipTree | |
| Functor ZipList | |
| Functor TimeVal | |
| Functor ((->) a) | |
| Functor (Either b) | |
| Functor ((,) b) | |
| Functor (Map k) | |
| Functor (Const a) | |
| Functor f => Functor (Backwards f) | |
| Functor m => Functor (ListT m) | |
| Functor (Future t) | |
| Functor (Event t) | |
| (Functor f, Functor g) => Functor (Compose f g) | |
| Functor m => Functor (EitherT e m) | |
| Functor f => Functor (ContT r f) | |
| Functor m => Functor (WriterT w m) | |
| Functor m => Functor (ReaderT r m) | |
| Functor m => Functor (StateT s m) | |
| Functor m => Functor (ParserT w c m) | |
| Functor f => Functor (RWST r w s f) |
Instances
| Bifunctor (->) |
The Identity Functor
The Constant Functor
A motherflippin' functor
Instances
| Cofunctor (Flip (->) a) | |
| Isomorphic (f a b) (f c d) (Flip f b a) (Flip f d c) |
The Composition functor
Constructors
| Compose | |
Fields
| |
Instances
| Isomorphic (f (g a)) (f' (g' b)) (Compose f g a) (Compose f' g' b) | |
| (Unit f, Unit g) => Unit (Compose f g) | |
| (Traversable g, Monad f, Monad g) => Monad (Compose f g) | |
| (Applicative f, Applicative g) => Applicative (Compose f g) | |
| (Functor f, Functor g) => Functor (Compose f g) | |
| (Functor f, Cofunctor g) => Cofunctor (Compose f g) | |
| (Foldable f, Foldable g) => Foldable (Compose f g) | |
| (Traversable f, Traversable g) => Traversable (Compose f g) | |
| (Contravariant f, Monad f, Traversable g, MonadFix g) => MonadFix (Compose f g) | |
| (Applicative f, Monoid (g a)) => Monoid (Compose f g a) | |
| (Applicative f, Semigroup (g a)) => Semigroup (Compose f g a) |