regular-0.3.4: Generic programming library for regular datatypes.

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org

Generics.Regular.Functions.GMap

Contents

Description

Summary: Monadic generic map.

Synopsis

Functorial map function

class Functor f where

The Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:

 fmap id  ==  id
 fmap (f . g)  ==  fmap f . fmap g

The instances of Functor for lists, Data.Maybe.Maybe and System.IO.IO satisfy these laws.

Methods

fmap :: (a -> b) -> f a -> f b

Instances

Functor [] 
Functor IO 
Functor Q 
Functor ReadPrec 
Functor ReadP 
Functor Maybe 
Functor U 
Functor I 
Functor ((->) r) 
Functor (Either a) 
Functor ((,) a) 
Functor (K a) 
Functor f => Functor (S c f) 
Functor f => Functor (C c f) 
(Functor f, Functor g) => Functor (:*: f g) 
(Functor f, Functor g) => Functor (:+: f g) 

Monadic functorial map function

class GMap f whereSource

The GMap class defines a monadic functorial map.

Methods

fmapM :: Monad m => (a -> m b) -> f a -> m (f b)Source

Instances

GMap U 
GMap I 
GMap (K a) 
GMap f => GMap (S s f) 
GMap f => GMap (C c f) 
(GMap f, GMap g) => GMap (:*: f g) 
(GMap f, GMap g) => GMap (:+: f g)