concat-classes-0.3.0.0: Constrained categories
Copyright(c) 2016 Conal Elliott
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConCat.Rep

Description

Convert to and from standard representations. TODO: Can I replace HasRep with Generic or Newtype?

Synopsis

Documentation

class HasRep a where Source #

Convert to and from standard representations. Used for transforming case expression scrutinees and constructor applications. The repr method should convert to a standard representation (unit, products, sums), or closer to such a representation, via another type with a HasRep instance. The abst method should reveal a constructor so that we can perform the case-of-known-constructor transformation. It is very important to give INLINE pragmas for repr and abst definitions.

Associated Types

type Rep a Source #

Methods

repr :: a -> Rep a Source #

abst :: Rep a -> a Source #

Instances

Instances details
HasRep All Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep All Source #

Methods

repr :: All -> Rep All Source #

abst :: Rep All -> All Source #

HasRep Any Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep Any Source #

Methods

repr :: Any -> Rep Any Source #

abst :: Rep Any -> Any Source #

HasRep Parity Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep Parity Source #

HasRep (Complex a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Complex a) Source #

Methods

repr :: Complex a -> Rep (Complex a) Source #

abst :: Rep (Complex a) -> Complex a Source #

HasRep (Identity a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Identity a) Source #

Methods

repr :: Identity a -> Rep (Identity a) Source #

abst :: Rep (Identity a) -> Identity a Source #

HasRep (Dual a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Dual a) Source #

Methods

repr :: Dual a -> Rep (Dual a) Source #

abst :: Rep (Dual a) -> Dual a Source #

HasRep (Endo a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Endo a) Source #

Methods

repr :: Endo a -> Rep (Endo a) Source #

abst :: Rep (Endo a) -> Endo a Source #

HasRep (Product a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Product a) Source #

Methods

repr :: Product a -> Rep (Product a) Source #

abst :: Rep (Product a) -> Product a Source #

HasRep (Sum a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Sum a) Source #

Methods

repr :: Sum a -> Rep (Sum a) Source #

abst :: Rep (Sum a) -> Sum a Source #

HasRep (Par1 p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Par1 p) Source #

Methods

repr :: Par1 p -> Rep (Par1 p) Source #

abst :: Rep (Par1 p) -> Par1 p Source #

HasRep (Add a) Source # 
Instance details

Defined in ConCat.Additive

Associated Types

type Rep (Add a) Source #

Methods

repr :: Add a -> Rep (Add a) Source #

abst :: Rep (Add a) -> Add a Source #

HasRep (Maybe a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Maybe a) Source #

Methods

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

abst :: Rep (Maybe a) -> Maybe a Source #

HasRep (WrappedMonad m a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (WrappedMonad m a) Source #

HasRep (Proxy a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (Proxy a) Source #

Methods

repr :: Proxy a -> Rep (Proxy a) Source #

abst :: Rep (Proxy a) -> Proxy a Source #

HasRep (U1 p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (U1 p) Source #

Methods

repr :: U1 p -> Rep (U1 p) Source #

abst :: Rep (U1 p) -> U1 p Source #

HasRep (ReaderT e m a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (ReaderT e m a) Source #

Methods

repr :: ReaderT e m a -> Rep (ReaderT e m a) Source #

abst :: Rep (ReaderT e m a) -> ReaderT e m a Source #

HasRep (StateT s m a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (StateT s m a) Source #

Methods

repr :: StateT s m a -> Rep (StateT s m a) Source #

abst :: Rep (StateT s m a) -> StateT s m a Source #

HasRep (WriterT w m a) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (WriterT w m a) Source #

Methods

repr :: WriterT w m a -> Rep (WriterT w m a) Source #

abst :: Rep (WriterT w m a) -> WriterT w m a Source #

HasRep (a, b, c) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c) Source #

Methods

repr :: (a, b, c) -> Rep (a, b, c) Source #

abst :: Rep (a, b, c) -> (a, b, c) Source #

HasRep ((f :*: g) p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep ((f :*: g) p) Source #

Methods

repr :: (f :*: g) p -> Rep ((f :*: g) p) Source #

abst :: Rep ((f :*: g) p) -> (f :*: g) p Source #

HasRep ((f :+: g) p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep ((f :+: g) p) Source #

Methods

repr :: (f :+: g) p -> Rep ((f :+: g) p) Source #

abst :: Rep ((f :+: g) p) -> (f :+: g) p Source #

HasRep (K1 i c p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (K1 i c p) Source #

Methods

repr :: K1 i c p -> Rep (K1 i c p) Source #

abst :: Rep (K1 i c p) -> K1 i c p Source #

HasRep (a, b, c, d) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c, d) Source #

Methods

repr :: (a, b, c, d) -> Rep (a, b, c, d) Source #

abst :: Rep (a, b, c, d) -> (a, b, c, d) Source #

HasRep ((g :.: f) p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep ((g :.: f) p) Source #

Methods

repr :: (g :.: f) p -> Rep ((g :.: f) p) Source #

abst :: Rep ((g :.: f) p) -> (g :.: f) p Source #

HasRep (M1 i c f p) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (M1 i c f p) Source #

Methods

repr :: M1 i c f p -> Rep (M1 i c f p) Source #

abst :: Rep (M1 i c f p) -> M1 i c f p Source #

HasRep (a, b, c, d, e) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c, d, e) Source #

Methods

repr :: (a, b, c, d, e) -> Rep (a, b, c, d, e) Source #

abst :: Rep (a, b, c, d, e) -> (a, b, c, d, e) Source #

HasRep ((k3 :**: k') a b) Source # 
Instance details

Defined in ConCat.Category

Associated Types

type Rep ((k3 :**: k') a b) Source #

Methods

repr :: (k3 :**: k') a b -> Rep ((k3 :**: k') a b) Source #

abst :: Rep ((k3 :**: k') a b) -> (k3 :**: k') a b Source #

HasRep (a, b, c, d, e, f) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c, d, e, f) Source #

Methods

repr :: (a, b, c, d, e, f) -> Rep (a, b, c, d, e, f) Source #

abst :: Rep (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

HasRep (a, b, c, d, e, f, g) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c, d, e, f, g) Source #

Methods

repr :: (a, b, c, d, e, f, g) -> Rep (a, b, c, d, e, f, g) Source #

abst :: Rep (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

HasRep (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in ConCat.Rep

Associated Types

type Rep (a, b, c, d, e, f, g, h) Source #

Methods

repr :: (a, b, c, d, e, f, g, h) -> Rep (a, b, c, d, e, f, g, h) Source #

abst :: Rep (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

inAbst :: (HasRep p, HasRep q) => (Rep p -> Rep q) -> p -> q Source #

inAbst2 :: (HasRep p, HasRep q, HasRep r) => (Rep p -> Rep q -> Rep r) -> p -> q -> r Source #

inAbstF1 :: (HasRep p, HasRep q, Functor f) => (f (Rep p) -> Rep q) -> f p -> q Source #

inRepr :: (HasRep p, HasRep q) => (p -> q) -> Rep p -> Rep q Source #

inRepr2 :: (HasRep p, HasRep q, HasRep r) => (p -> q -> r) -> Rep p -> Rep q -> Rep r Source #