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.Tagged rather than explicit scoped type variables by Edward Kmett.
- class ReifiesNum s where
- reflectNum :: Num a => Tagged s a
- reifyIntegral :: Integral a => a -> (forall s. ReifiesNum s => Tagged s w) -> w
- class ReifiesNums ss
- reifyIntegrals :: Integral a => [a] -> (forall ss. ReifiesNums ss => Tagged ss w) -> w
- class ReifiesStorable s where
- reflectStorable :: Storable a => Tagged (s a) a
- reifyStorable :: Storable a => a -> (forall s. ReifiesStorable s => Tagged (s a) w) -> w
- class Reifies s a | s -> a where
- reify :: a -> (forall s. Reifies s a => Tagged s w) -> w
Reflect Integrals
class ReifiesNum s whereSource
reflectNum :: Num a => Tagged 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 => Tagged s w) -> wSource
Reflect Lists of Integrals
class ReifiesNums ss Source
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
reflectStorable :: Storable a => Tagged (s a) aSource
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
ReifiesStorable s => Reifies (Stable s a) a |