compdata-0.11: Compositional Data Types

Copyright(c) 2011 Patrick Bahr
LicenseBSD3
MaintainerPatrick Bahr <paba@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellSafe
LanguageHaskell98

Data.Comp.Multi.HFunctor

Description

This module defines higher-order functors (Johann, Ghani, POPL '08), i.e. endofunctors on the category of endofunctors.

Synopsis

Documentation

class HFunctor h where Source #

This class represents higher-order functors (Johann, Ghani, POPL '08) which are endofunctors on the category of endofunctors.

Minimal complete definition

hfmap

Methods

hfmap :: (f :-> g) -> h f :-> h g Source #

A higher-order functor f also maps a natural transformation g :-> h to a natural transformation f g :-> f h

Instances

HFunctor f => HFunctor (Cxt h f) Source # 

Methods

hfmap :: (f :-> g) -> Cxt h f f :-> Cxt h f g Source #

Functor f => HFunctor (Compose * * f) Source # 

Methods

hfmap :: (f :-> g) -> Compose * * f f :-> Compose * * f g Source #

HFunctor f => HFunctor ((:&:) * f a) Source # 

Methods

hfmap :: (f :-> g) -> (* :&: f) a f :-> (* :&: f) a g Source #

(HFunctor f, HFunctor g) => HFunctor ((:+:) * f g) Source # 

Methods

hfmap :: (f :-> g) -> (* :+: f) g f :-> (* :+: f) g g Source #

type (:->) f g = forall i. f i -> g i infixr 0 Source #

This type represents natural transformations.

type (:=>) f a = forall i. f i -> a infixr 0 Source #

This type represents co-cones from f to a. f :=> a is isomorphic to f :-> K a

type NatM m f g = forall i. f i -> m (g i) Source #

newtype I a Source #

The identity Functor.

Constructors

I 

Fields

Instances

Functor I Source # 

Methods

fmap :: (a -> b) -> I a -> I b #

(<$) :: a -> I b -> I a #

Foldable I Source # 

Methods

fold :: Monoid m => I m -> m #

foldMap :: Monoid m => (a -> m) -> I a -> m #

foldr :: (a -> b -> b) -> b -> I a -> b #

foldr' :: (a -> b -> b) -> b -> I a -> b #

foldl :: (b -> a -> b) -> b -> I a -> b #

foldl' :: (b -> a -> b) -> b -> I a -> b #

foldr1 :: (a -> a -> a) -> I a -> a #

foldl1 :: (a -> a -> a) -> I a -> a #

toList :: I a -> [a] #

null :: I a -> Bool #

length :: I a -> Int #

elem :: Eq a => a -> I a -> Bool #

maximum :: Ord a => I a -> a #

minimum :: Ord a => I a -> a #

sum :: Num a => I a -> a #

product :: Num a => I a -> a #

Traversable I Source # 

Methods

traverse :: Applicative f => (a -> f b) -> I a -> f (I b) #

sequenceA :: Applicative f => I (f a) -> f (I a) #

mapM :: Monad m => (a -> m b) -> I a -> m (I b) #

sequence :: Monad m => I (m a) -> m (I a) #

newtype K a i Source #

The parametrised constant functor.

Constructors

K 

Fields

Instances

Functor (K a) Source # 

Methods

fmap :: (a -> b) -> K a a -> K a b #

(<$) :: a -> K a b -> K a a #

Foldable (K a) Source # 

Methods

fold :: Monoid m => K a m -> m #

foldMap :: Monoid m => (a -> m) -> K a a -> m #

foldr :: (a -> b -> b) -> b -> K a a -> b #

foldr' :: (a -> b -> b) -> b -> K a a -> b #

foldl :: (b -> a -> b) -> b -> K a a -> b #

foldl' :: (b -> a -> b) -> b -> K a a -> b #

foldr1 :: (a -> a -> a) -> K a a -> a #

foldl1 :: (a -> a -> a) -> K a a -> a #

toList :: K a a -> [a] #

null :: K a a -> Bool #

length :: K a a -> Int #

elem :: Eq a => a -> K a a -> Bool #

maximum :: Ord a => K a a -> a #

minimum :: Ord a => K a a -> a #

sum :: Num a => K a a -> a #

product :: Num a => K a a -> a #

Traversable (K a) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> K a a -> f (K a b) #

sequenceA :: Applicative f => K a (f a) -> f (K a a) #

mapM :: Monad m => (a -> m b) -> K a a -> m (K a b) #

sequence :: Monad m => K a (m a) -> m (K a a) #

Eq a => KEq (K a) Source # 

Methods

keq :: K a i -> K a j -> Bool Source #

Ord a => KOrd (K a) Source # 

Methods

kcompare :: K a i -> K a j -> Ordering Source #

Eq a => Eq (K a i) Source # 

Methods

(==) :: K a i -> K a i -> Bool #

(/=) :: K a i -> K a i -> Bool #

Ord a => Ord (K a i) Source # 

Methods

compare :: K a i -> K a i -> Ordering #

(<) :: K a i -> K a i -> Bool #

(<=) :: K a i -> K a i -> Bool #

(>) :: K a i -> K a i -> Bool #

(>=) :: K a i -> K a i -> Bool #

max :: K a i -> K a i -> K a i #

min :: K a i -> K a i -> K a i #

data A f Source #

Constructors

A 

Fields

  • unA :: forall i. f i
     

data E f Source #

Constructors

E 

Fields

runE :: (f :=> b) -> E f -> b Source #

data (f :.: g) e t infixl 5 Source #

This data type denotes the composition of two functor families.

Constructors

Comp (f (g e) t)