compdata-param-0.8.0.2: Parametric Compositional Data Types

Copyright(c) 2011 Patrick Bahr, Tom Hvitved
LicenseBSD3
MaintainerTom Hvitved <hvitved@diku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Comp.Param.Difunctor

Description

This module defines difunctors (Meijer, Hutton, FPCA '95), i.e. binary type constructors that are contravariant in the first argument and covariant in the second argument.

Synopsis

Documentation

difmap :: Difunctor f => (a -> b) -> f c a -> f c b Source

class Difunctor f where Source

This class represents difunctors, i.e. binary type constructors that are contravariant in the first argument and covariant in the second argument.

Methods

dimap :: (a -> b) -> (c -> d) -> f b c -> f a d Source

Instances

Difunctor (->)

The canonical example of a difunctor.

Difunctor f => Difunctor ((:&:) f p) 
(Difunctor f, Difunctor g) => Difunctor ((:+:) f g)