Copyright | (c) 2009--2010 Universiteit Utrecht |
---|---|
License | BSD3 |
Maintainer | generics@haskell.org |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Variant of Generics.MultiRec.Fold where the result type is independent of the index.
Synopsis
- type Algebra' phi f r = forall ix. phi ix -> f (K0 r) ix -> r
- type Algebra phi r = Algebra' phi (PF phi) r
- type AlgebraF' phi f g r = forall ix. phi ix -> f (K0 r) ix -> g r
- type AlgebraF phi g r = AlgebraF' phi (PF phi) g r
- fold :: (Fam phi, HFunctor phi (PF phi)) => Algebra phi r -> phi ix -> ix -> r
- foldM :: (Fam phi, HFunctor phi (PF phi), Monad m) => AlgebraF phi m r -> phi ix -> ix -> m r
- type CoAlgebra' phi f r = forall ix. phi ix -> r -> f (K0 r) ix
- type CoAlgebra phi r = CoAlgebra' phi (PF phi) r
- type CoAlgebraF' phi f g r = forall ix. phi ix -> r -> g (f (K0 r) ix)
- type CoAlgebraF phi g r = CoAlgebraF' phi (PF phi) g r
- unfold :: (Fam phi, HFunctor phi (PF phi)) => CoAlgebra phi r -> phi ix -> r -> ix
- unfoldM :: (Fam phi, HFunctor phi (PF phi), Monad m) => CoAlgebraF phi m r -> phi ix -> r -> m ix
- type ParaAlgebra' phi f r = forall ix. phi ix -> f (K0 r) ix -> ix -> r
- type ParaAlgebra phi r = ParaAlgebra' phi (PF phi) r
- type ParaAlgebraF' phi f g r = forall ix. phi ix -> f (K0 r) ix -> ix -> g r
- type ParaAlgebraF phi g r = ParaAlgebraF' phi (PF phi) g r
- para :: (Fam phi, HFunctor phi (PF phi)) => ParaAlgebra phi r -> phi ix -> ix -> r
- paraM :: (Fam phi, HFunctor phi (PF phi), Monad m) => ParaAlgebraF phi m r -> phi ix -> ix -> m r
- type AlgPart f b ix = f (K0 b) ix -> b
- type (:->) f g b ix = f b ix -> g b ix
- (&) :: (AlgPart a :-> (AlgPart b :-> AlgPart (a :+: b))) c ix
- tag :: AlgPart a c ix -> AlgPart (a :>: ix) c ix'
- con :: AlgPart a b ix -> AlgPart (C c a) b ix
Generic fold and unfold
foldM :: (Fam phi, HFunctor phi (PF phi), Monad m) => AlgebraF phi m r -> phi ix -> ix -> m r Source #
type CoAlgebra' phi f r = forall ix. phi ix -> r -> f (K0 r) ix Source #
type CoAlgebra phi r = CoAlgebra' phi (PF phi) r Source #
type CoAlgebraF' phi f g r = forall ix. phi ix -> r -> g (f (K0 r) ix) Source #
type CoAlgebraF phi g r = CoAlgebraF' phi (PF phi) g r Source #
unfoldM :: (Fam phi, HFunctor phi (PF phi), Monad m) => CoAlgebraF phi m r -> phi ix -> r -> m ix Source #
type ParaAlgebra' phi f r = forall ix. phi ix -> f (K0 r) ix -> ix -> r Source #
type ParaAlgebra phi r = ParaAlgebra' phi (PF phi) r Source #
type ParaAlgebraF' phi f g r = forall ix. phi ix -> f (K0 r) ix -> ix -> g r Source #
type ParaAlgebraF phi g r = ParaAlgebraF' phi (PF phi) g r Source #
paraM :: (Fam phi, HFunctor phi (PF phi), Monad m) => ParaAlgebraF phi m r -> phi ix -> ix -> m r Source #