compdata-0.5.2: Compositional Data Types

Portabilitynon-portable (GHC Extensions)
Stabilityexperimental
MaintainerTom Hvitved <hvitved@diku.dk>
Safe HaskellSafe-Infered

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 bSource

class Difunctor f whereSource

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 dSource

Instances

Difunctor (->)

The canonical example of a difunctor.

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