reflection-0.3.2: Functional Pearl: Implicit Configurations

Portabilitynon-portable (scoped types, MPTCs, rank-n, FFI, kinds)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Data.Reflection

Contents

Description

Based on the Functional Pearl: Implicit Configurations paper by Oleg Kiselyov and Chung-chieh Shan.

http://www.cs.rutgers.edu/~ccshan/prepose/prepose.pdf

Modified to minimize extensions and work with Data.Tagged rather than explicit scoped type variables by Edward Kmett.

Synopsis

Reflect Integrals

class ReifiesNum s whereSource

Methods

reflectNum :: Num a => Tagged s aSource

Instances

ReifiesNum Zero 
ReifiesNum s => ReifiesNum (Pred s) 
ReifiesNum s => ReifiesNum (Succ s) 
ReifiesNum s => ReifiesNum (Twice s) 

reifyIntegral :: Integral a => a -> (forall s. ReifiesNum s => Tagged s w) -> wSource

Reflect Lists of Integrals

class ReifiesNums ss Source

Instances

ReifiesNums Nil 
(ReifiesNum s, ReifiesNums ss) => ReifiesNums (Cons s ss) 

reifyIntegrals :: Integral a => [a] -> (forall ss. ReifiesNums ss => Tagged ss w) -> wSource

Reflect Storables

class ReifiesStorable s whereSource

Methods

reflectStorable :: Storable a => Tagged (s a) aSource

Instances

ReifiesNums s => ReifiesStorable (Store s) 

reifyStorable :: Storable a => a -> (forall s. ReifiesStorable s => Tagged (s a) w) -> wSource

Reflect Anything

class Reifies s a | s -> a whereSource

Methods

reflect :: Tagged s aSource

Instances

ReifiesStorable s => Reifies (Stable s a) a 

reify :: a -> (forall s. Reifies s a => Tagged s w) -> wSource