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

Pandora.Pattern.Functor.Representable

Synopsis

Documentation

class Pointable t => 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 <#>

Instances

Instances details
Representable Identity Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Functor.Identity

Associated Types

type Representation Identity Source #

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

Defined in Pandora.Paradigm.Primary.Functor.Function

Associated Types

type Representation ((->) e) Source #

Methods

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

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

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