yoko-0.1: generic programming with disbanded constructors

Portabilitysee LANGUAGE pragmas (... GHC)
Stabilityexperimental
Maintainernicolas.frisby@gmail.com

Data.Yoko.Reflect

Description

Definitions on top of the basic yoko reflection concepts Data.Yoko.ReflectBase.

Synopsis

Documentation

data IsDC dc whereSource

Constructors

IsDC :: DC dc => IsDC dc 

Instances

DC dc => dc ::: IsDC 

newtype RMNTo m b dc Source

Constructors

RMNTo 

Fields

rmnTo :: RMN m dc -> b
 

Instances

Wrapper (RMNTo m b) 

dcDispatch :: DT t => NT (DCU t) (RMNTo IdM b) -> t -> bSource

Just a specialization: dcDispatch = (. disband) . dcDispatch'.

dcDispatch' :: DT t => NT (DCU t) (RMNTo IdM b) -> Disbanded IdM t -> bSource

Just a specialization: dcDispatch' nt (NP (DCOf tag) fds) = appNT nt tag fds.

data TagRepIs tag c dc whereSource

A fundamental notion of identity in yoko, the TagRepIs tag c universe contains all constructor types dc where (Tag dc ~ tag, c ~ Rep dc).

  type instance Pred (TagRepIs tag c) dc =
    And (IsEQ (Compare (Tag dc) tag)) (IsEQ (Compare (Rep dc) c))

Constructors

TagRepIs :: (Tag dc ~ tag, c ~ Rep dc) => TagRepIs tag c dc 

Instances

(Tag dc ~ tag, c ~ Rep dc) => dc ::: (TagRepIs tag c) 

bandDCs :: DT t => Disbanded IdM t -> tSource

Just a specialization: bandDCs = band.

fr_DCOf :: DCOf t dc -> RMNI dc -> tSource