multirec-0.2: Generic programming with systems of recursive datatypesSource codeContentsIndex
Generics.MultiRec.HFunctor
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Contents
Generic map
Description
The definition of functorial map.
Synopsis
class HFunctor f where
hmapA :: Applicative a => (forall ix. Ix s ix => s ix -> r ix -> a (r' ix)) -> f s r ix -> a (f s r' ix)
hmap :: HFunctor f => (forall ix. Ix s ix => s ix -> r ix -> r' ix) -> f s r ix -> f s r' ix
hmapM :: (HFunctor f, Monad m) => (forall ix. Ix s ix => s ix -> r ix -> m (r' ix)) -> f s r ix -> m (f s r' ix)
Generic map
class HFunctor f whereSource
Methods
hmapA :: Applicative a => (forall ix. Ix s ix => s ix -> r ix -> a (r' ix)) -> f s r ix -> a (f s r' ix)Source
show/hide Instances
hmap :: HFunctor f => (forall ix. Ix s ix => s ix -> r ix -> r' ix) -> f s r ix -> f s r' ixSource
The function hmap takes a functor f. All the recursive instances in that functor are wrapped by an application of r. The argument to hmap takes a function that transformes r occurrences into r' occurrences, for every ix. In order to associate the index ix with the correct system s, the argument to hmap is additionally parameterized by a witness of type s ix.
hmapM :: (HFunctor f, Monad m) => (forall ix. Ix s ix => s ix -> r ix -> m (r' ix)) -> f s r ix -> m (f s r' ix)Source
Monadic version of hmap.
Produced by Haddock version 2.4.2