lub-0.1.8: information operators: least upper bound (lub) and greatest lower bound (glb)
Copyright(c) Conal Elliott 2008
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Repr

Description

Deprecated: Use generics instead

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

This version uses associated types for HasRepr

Synopsis

Documentation

class HasRepr t r | t -> r where Source #

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

Methods

repr Source #

Arguments

:: t 
-> r

to representation

unrepr Source #

Arguments

:: r 
-> t

from representation

Instances

Instances details
HasRepr [a] (Either () (a, [a])) Source # 
Instance details

Defined in Data.Repr

Methods

repr :: [a] -> Either () (a, [a]) Source #

unrepr :: Either () (a, [a]) -> [a] Source #

HasRepr (Maybe a) (Either () a) Source # 
Instance details

Defined in Data.Repr

Methods

repr :: Maybe a -> Either () a Source #

unrepr :: Either () a -> Maybe a Source #

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

Apply a binary function on a repr

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

Apply a binary function on a repr