-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A small library providing a contravariant functor class -- -- This library provides a Cofunctor class useful for types that -- are sinks or make use of IO effects. See documentation for details. -- Some supporting constructions are also provided. @package cofunctor @version 0.1.0 module Data.Cofunctor -- | The Confunctor class is useful for "sink-like" types, especially when -- combined with GADTs. For instance: -- --
--   
--   data StringStack a where
--       StringStack :: (a -> String) -> [String] -> StringStack a
--   
--   emptyStack :: StringStack String
--   emptyStack = StringStack id []
--   
--   push :: a -> StringStack a -> StringStack a
--   push a (StringStack f ss) = StringStack f (f s : ss)
--   
--   instance Confunctor StringStack where
--       cofmap f (StringStack g ss) = StringStack (g . f) ss
--   
-- -- See the split-chan package for another example. -- -- A class for contravariant functors class Cofunctor f cofmap :: Cofunctor f => (b -> a) -> f a -> f b