packages feed

monomorphic 0.0.1.2 → 0.0.2.0

raw patch · 2 files changed

+9/−10 lines, 2 files

Files

Data/Type/Monomorphic.hs view
@@ -1,14 +1,13 @@ {-# LANGUAGE DataKinds, ExistentialQuantification, FlexibleContexts, GADTs #-} {-# LANGUAGE PolyKinds, RankNTypes, TypeFamilies, TypeOperators            #-} {-# LANGUAGE UndecidableInstances                                          #-}-module Data.Type.Monomorphic ( (:.:), Monomorphic (..), Monomorphicable(..)-                             , demote', demoteComposed, monomorphicCompose-                             , withPolymorhic, liftPoly, viaPoly, Compose(..)+module Data.Type.Monomorphic ( (:.:)(..), Monomorphic (..), Monomorphicable(..)+                             , demote', demoteCompd, monomorphicComp+                             , withPolymorhic, liftPoly, viaPoly                              ) where import Control.Arrow-import Data.Functor.Compose -type (:.:) f g = Compose f g+newtype (:.:) f g a = Comp (f (g a))  -- | A wrapper type for polymophic types. data Monomorphic k = forall a. Monomorphic (k a)@@ -27,11 +26,11 @@ demote' = demote . Monomorphic  -- | Demote polymorphic nested types directly into monomorphic representation.-demoteComposed :: Monomorphicable (f :.: g) => f (g a) -> MonomorphicRep (f :.: g)-demoteComposed = demote . Monomorphic . Compose+demoteCompd :: Monomorphicable (f :.: g) => f (g a) -> MonomorphicRep (f :.: g)+demoteCompd = demote . Monomorphic . Comp -monomorphicCompose :: f (g a) -> Monomorphic (f :.: g)-monomorphicCompose = Monomorphic . Compose+monomorphicComp :: f (g a) -> Monomorphic (f :.: g)+monomorphicComp = Monomorphic . Comp  -- | Apply dependently-typed function to the monomorphic representation. withPolymorhic :: Monomorphicable k
monomorphic.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                monomorphic-version:             0.0.1.2+version:             0.0.2.0 synopsis:            Library to convert polymorphic datatypes to/from its monomorphic represetation description:         This library provides the type-class and functions to convert between polymorphic data-types and its monomorphic representation type, such as length-indexed vectors, singletons for type-level natural numbers, etc. homepage:            https://github.com/konn/monomorphic