Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Pointable t => Representable t where
- type Representation t :: *
- (<#>) :: Representation t -> t a -> a
- tabulate :: (Representation t -> a) -> t a
- index :: t a -> Representation t -> a
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
type Representation t :: * Source #
(<#>) :: 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 # | |
Defined in Pandora.Pattern.Functor.Representable type Representation ((->) e) :: Type Source # (<#>) :: Representation ((->) e) -> (e -> a) -> a Source # tabulate :: (Representation ((->) e) -> a) -> e -> a Source # index :: (e -> a) -> Representation ((->) e) -> a Source # |