lub-0.0.4: least upper bounds -- information merging

Stabilityexperimental
Maintainerconal@conal.net

Data.Repr

Description

Compute least upper bounds (lub / join) of two values

This version uses associated types for HasRepr

Synopsis

Documentation

class HasRepr t r | t -> r whereSource

A data type representation, in terms of standard data types. Requires that unrepr . repr == id.

Methods

reprSource

Arguments

:: t 
-> r

to representation

unreprSource

Arguments

:: r 
-> t

from representation

Instances

HasRepr [a] (Either () (a, [a])) 
HasRepr (Maybe a) (Either () a) 

onRepr :: (HasRepr a ra, HasRepr b rb) => (ra -> rb) -> a -> bSource

Apply a binary function on a repr

onRepr2 :: (HasRepr a ra, HasRepr b rb, HasRepr c rc) => (ra -> rb -> rc) -> a -> b -> cSource

Apply a binary function on a repr