Portability | non-portable (rank-2 types, type families) |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Safe-Infered |
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 Reified s where
- reify :: a -> (forall s. (Reified s, Reflected s ~ a) => Proxy s -> w) -> w
- class ReifiedNum s where
- reflectNum :: Num a => p s -> a
- reifyIntegral :: Integral a => a -> (forall s. ReifiedNum s => Proxy s -> w) -> w
Reifying any term at the type level
ReifiedNum s => Reified (Stable s a) |
Reifying integral values at the type level
class ReifiedNum s whereSource
reflectNum :: Num a => p s -> aSource
ReifiedNum Zero | |
ReifiedNum s => ReifiedNum (PredTwice s) | |
ReifiedNum s => ReifiedNum (SuccTwice s) | |
ReifiedNum s => ReifiedNum (Twice s) |
reifyIntegral :: Integral a => a -> (forall s. ReifiedNum s => Proxy s -> w) -> wSource