-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Functional Pearl: Implicit Configurations -- -- Implementation of the ideas presented in the paper Functional -- Pearl: Implicit Configurations by Oleg Kiselyov and Chung-chieh -- Shan. Modified to avoid the use of scoped type variables, and to use a -- phantom type wrapper rather than dummy arguments. @package reflection @version 0.4.0 -- | 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 by Edward Kmett. module Data.Reflection class ReifiesNum s reflectNum :: (ReifiesNum s, Num a) => Proxy s -> a reifyIntegral :: Integral a => a -> (forall s. ReifiesNum s => Proxy s -> w) -> w class ReifiesNums ss reifyIntegrals :: Integral a => [a] -> (forall ss. ReifiesNums ss => Proxy ss -> w) -> w class ReifiesStorable s reflectStorable :: (ReifiesStorable s, 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 reflect :: Reifies s a => Proxy s -> a reify :: a -> (forall s. Reifies s a => Proxy s -> w) -> w instance Show Zero instance Show (Twice s) instance Show (Succ s) instance Show (Pred s) instance ReifiesStorable s => Reifies (Stable s a) a instance Unused (Stable s a) instance ReifiesNums s => ReifiesStorable (Store s) instance Unused (Store s a) instance (ReifiesNum s, ReifiesNums ss) => ReifiesNums (Cons s ss) instance ReifiesNums Nil instance Unused (Cons s ss) instance Unused Nil instance ReifiesNum s => ReifiesNum (Pred s) instance ReifiesNum s => ReifiesNum (Succ s) instance ReifiesNum s => ReifiesNum (Twice s) instance ReifiesNum Zero instance Unused (Pred s) instance Unused (Succ s) instance Unused (Twice s) instance Unused Zero