-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Prelude classes using ConstraintKinds -- -- Please see README.org @package constraint-classes @version 0.1.0 module Control.ConstraintClasses class CFunctor f where type CFun f a :: Constraint type CFun f a = () where { type family CFun f a :: Constraint; type CFun f a = (); } cmap :: (CFunctor f, CFun f a, CFun f b) => (a -> b) -> f a -> f b class CFoldable f where type CFol f a :: Constraint type CFol f a = () cfold = cfoldMap id cfoldMap f = cfoldr (mappend . f) mempty clength = cfoldl (\ c _ -> c + 1) 0 cforM = flip cmapM cforM_ = flip cmapM_ where { type family CFol f a :: Constraint; type CFol f a = (); } cfoldr :: (CFoldable f, CFol f a) => (a -> b -> b) -> b -> f a -> b cfoldr' :: (CFoldable f, CFol f a) => (a -> b -> b) -> b -> f a -> b cfoldl :: (CFoldable f, CFol f b) => (a -> b -> a) -> a -> f b -> a cfoldl' :: (CFoldable f, CFol f b) => (a -> b -> a) -> a -> f b -> a cfold :: (CFoldable f, CFol f m, Monoid m) => f m -> m cfoldMap :: (CFoldable f, CFol f a, CFol f m, Monoid m) => (a -> m) -> f a -> m clength :: (CFoldable f, CFol f a) => f a -> Int cmapM :: (CFoldable f, Monad m, CFol f a, CFol f b) => (a -> m b) -> f a -> m (f b) cforM :: (CFoldable f, Monad m, CFol f a, CFol f b) => f a -> (a -> m b) -> m (f b) cmapM_ :: (CFoldable f, Monad m, CFol f a) => (a -> m b) -> f a -> m () cforM_ :: (CFoldable f, Monad m, CFol f a) => f a -> (a -> m b) -> m () module Control.ConstraintClasses.Extras class CFunctor f => CZippable f where czipWith f x y = cmap (uncurry f) (czip x y) czipWith3 f x y z = cmap ((uncurry . uncurry) f) (czip (czip x y) z) czip :: (CZippable f, CFun f a, CFun f b, CFun f (a, b)) => f a -> f b -> f (a, b) czipWith :: (CZippable f, CFun f a, CFun f b, CFun f (a, b), CFun f c) => (a -> b -> c) -> f a -> f b -> f c czipWith3 :: (CZippable f, CFun f a, CFun f b, CFun f c, CFun f (a, b), CFun f ((a, b), c), CFun f d) => (a -> b -> c -> d) -> f a -> f b -> f c -> f d czipWith4 :: (CZippable f, CFun f a, CFun f b, CFun f c, CFun f d, CFun f e) => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e