Portability | non-portable (functional-dependencies) |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
A more categorical definition of Bifunctor
- class (Category r, Category t) => PFunctor p r t | p r -> t, p t -> r where
- first :: r a b -> t (p a c) (p b c)
- class (Category s, Category t) => QFunctor q s t | q s -> t, q t -> s where
- second :: s a b -> t (q c a) (q c b)
- class (PFunctor p r t, QFunctor p s t) => Bifunctor p r s t | p r -> s t, p s -> r t, p t -> r s where
- bimap :: r a b -> s c d -> t (p a c) (p b d)
- dimap :: Bifunctor f (Dual s) t u => s b a -> t c d -> u (f a c) (f b d)
- difirst :: PFunctor f (Dual s) t => s b a -> t (f a c) (f b c)