Portability | non-portable (scoped types, MPTCs, rank-n, FFI, kinds) |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
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.Proxy rather than explicit scoped type variables and undefined values by Edward Kmett.
- class ReifiesNum s where
- reflectNum :: Num a => Proxy s -> a
- reifyIntegral :: Integral a => a -> (forall s. ReifiesNum s => Proxy s -> w) -> w
- class ReifiesNums ss where
- reflectNums :: Num a => Proxy ss -> [a]
- reifyIntegrals :: Integral a => [a] -> (forall ss. ReifiesNums ss => Proxy ss -> w) -> w
- class ReifiesStorable s where
- reflectStorable :: Storable a => Proxy (s a) -> a
- reifyStorable :: Storable a => a -> (forall s. ReifiesStorable s => Proxy (s a) -> w) -> w
- class Reifies s a | s -> a where
- reify :: a -> (forall s. Reifies s a => Proxy s -> w) -> w
Reflect Integrals
class ReifiesNum s whereSource
reflectNum :: Num a => Proxy s -> aSource
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 => Proxy s -> w) -> wSource
Reflect Lists of Integrals
class ReifiesNums ss whereSource
reflectNums :: Num a => Proxy ss -> [a]Source
ReifiesNums Nil | |
(ReifiesNum s, ReifiesNums ss) => ReifiesNums (Cons s ss) |
reifyIntegrals :: Integral a => [a] -> (forall ss. ReifiesNums ss => Proxy ss -> w) -> wSource
Reflect Storables
class ReifiesStorable s whereSource
reflectStorable :: Storable a => Proxy (s a) -> aSource
ReifiesNums s => ReifiesStorable (Store s) |
reifyStorable :: Storable a => a -> (forall s. ReifiesStorable s => Proxy (s a) -> w) -> wSource
Reflect Anything
class Reifies s a | s -> a whereSource
ReifiesStorable s => Reifies (Stable s a) a |