name: open-typerep version: 0.6 synopsis: Open type representations and dynamic types description: This package uses Data Types à la Carte to provide open type representations and dynamic types/coercions for open type universes. . Example 1 (dynamic types): . > type MyUniverse = IntType :+: BoolType > > hlist :: [Dynamic MyUniverse] > hlist = [toDyn True, toDyn (1 :: Int)] . > *Main> hlist > [True,1] . Note that if we were using "Data.Dynamic", it would just print . > [<>,<>] . Example 2 (dynamically typed addition): . > addDyn :: (TypeEq ts ts, PWitness Num ts ts) => Dynamic ts -> Dynamic ts -> Maybe (Dynamic ts) > addDyn (Dyn ta a) (Dyn tb b) = do > Dict <- typeEq ta tb > Dict <- pwit pNum ta > return (Dyn ta (a+b)) . "Data.Dynamic" could only do this monomorphically, for one 'Num' type at a time. author: Emil Axelsson maintainer: emax@chalmers.se copyright: Copyright (c) 2014-2016, Emil Axelsson license: BSD3 license-file: LICENSE homepage: https://github.com/emilaxelsson/open-typerep bug-reports: https://github.com/emilaxelsson/open-typerep/issues category: Dependent Types stability: experimental build-type: Simple cabal-version: >=1.10 extra-source-files: examples/*.hs source-repository head type: git location: https://github.com/emilaxelsson/open-typerep library hs-source-dirs: src exposed-modules: Data.TypeRep.Representation Data.TypeRep.TH Data.TypeRep.Types.Basic Data.TypeRep.Types.Basic.Typeable Data.TypeRep.Types.Tuple Data.TypeRep.Types.Tuple.Typeable Data.TypeRep.Types.IntWord Data.TypeRep.Types.IntWord.Typeable Data.TypeRep.VarArg Data.TypeRep other-modules: Data.TypeRep.Sub build-depends: base >=4 && <5, constraints >=0.3, mtl >=2.2.1, -- Smallest version that has Control.Monad.Except syntactic >=3.1, -- Smallest version that has Language.Syntactic.TH tagged >=0.4, template-haskell if impl(ghc < 7.10) build-depends: base-orphans default-language: Haskell2010 default-extensions: ConstraintKinds FlexibleContexts FlexibleInstances GADTs MultiParamTypeClasses Rank2Types ScopedTypeVariables TypeFamilies TypeOperators test-suite examples type: exitcode-stdio-1.0 hs-source-dirs: examples tests main-is: Tests.hs default-language: Haskell2010 build-depends: base, open-typerep, syntactic default-language: Haskell2010 default-extensions: FlexibleContexts FlexibleInstances GADTs MultiParamTypeClasses ScopedTypeVariables TypeOperators benchmark dynamic-bench type: exitcode-stdio-1.0 hs-source-dirs: benchmarks main-is: Dynamic.hs build-depends: base, criterion >= 1, open-typerep default-language: Haskell2010 default-extensions: FlexibleInstances GADTs MultiParamTypeClasses TypeOperators other-extensions: TemplateHaskell