pandora-0.4.6: A box of patterns and paradigms
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pandora.Pattern.Functor.Representable

Synopsis

Documentation

class Representable t where Source #

When providing a new instance, you should ensure it satisfies:
* Isomorphism (to): tabulate . index ≡ identity
* Isomorphism (from): index . tabulate ≡ identity
* Right adjoint: tabulate . point ≡ point
* Interchange tabulation: comap f . tabulate ≡ tabulate . comap f

Minimal complete definition

(<#>), tabulate

Associated Types

type Representation t :: * Source #

Methods

(<#>) :: Representation t -> a <:= t infixr 6 Source #

Infix and flipped version of index

tabulate :: (Representation t -> a) -> t a Source #

index :: t a -> Representation t -> a Source #

Prefix and flipped version of <#>