pandora-0.2.1: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Representable

Synopsis

Documentation

class Pointable t => Representable t where Source #

When providing a new instance, you should ensure it satisfies the three laws:
* 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 -> t a -> a 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 <#>

Instances
Representable ((->) e :: Type -> Type) Source # 
Instance details

Defined in Pandora.Pattern.Functor.Representable

Associated Types

type Representation ((->) e) :: Type Source #

Methods

(<#>) :: Representation ((->) e) -> (e -> a) -> a Source #

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

index :: (e -> a) -> Representation ((->) e) -> a Source #