-- 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.2.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 work with an applicative phantom type parameter rather -- than explicit scope type variables by Edward Kmett. module Data.Reflection class ReifiesNum s reflectNum :: (ReifiesNum s, 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 reflectStorable :: (ReifiesStorable s, 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 reflect :: (Reifies s a) => Tagged s a reify :: a -> (forall s. (Reifies s a) => Tagged s w) -> w newtype Tagged a b Tagged :: b -> Tagged a b unTagged :: Tagged a b -> b instance Show (Pred s) instance Show (Succ s) instance Show (Twice s) instance Show Zero instance (Eq b) => Eq (Tagged a b) instance (Ord b) => Ord (Tagged a b) instance (Show b) => Show (Tagged a b) instance (Read b) => Read (Tagged a b) 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 instance Monad (Tagged a) instance Applicative (Tagged a) instance Functor (Tagged a)