dependent-sum 0.2 → 0.2.0.1
raw patch · 6 files changed
+52/−8 lines, 6 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Dependent.Sum: instance Eq a => EqTag ((:=) a)
- Data.Dependent.Sum: instance EqTag tag => Eq (DSum tag)
- Data.Dependent.Sum: instance Ord a => OrdTag ((:=) a)
- Data.Dependent.Sum: instance OrdTag tag => Ord (DSum tag)
- Data.Dependent.Sum: instance Read a => ReadTag ((:=) a)
- Data.Dependent.Sum: instance ReadTag tag => Read (DSum tag)
- Data.Dependent.Sum: instance Show a => ShowTag ((:=) a)
- Data.Dependent.Sum: instance Show a => ShowTag (GOrdering a)
- Data.Dependent.Sum: instance ShowTag tag => Show (DSum tag)
- Data.Dependent.Sum: instance Typeable1 t => Typeable (DSum t)
- Data.GADT.Compare: instance Eq (GOrdering a b)
- Data.GADT.Compare: instance Eq (a := b)
- Data.GADT.Compare: instance GCompare ((:=) a)
- Data.GADT.Compare: instance GEq ((:=) a)
- Data.GADT.Compare: instance GRead ((:=) a)
- Data.GADT.Compare: instance GRead (GOrdering a)
- Data.GADT.Compare: instance GShow ((:=) a)
- Data.GADT.Compare: instance GShow (GOrdering a)
- Data.GADT.Compare: instance Ord (GOrdering a b)
- Data.GADT.Compare: instance Ord (a := b)
- Data.GADT.Compare: instance Read (a := a)
- Data.GADT.Compare: instance Show (GOrdering a b)
- Data.GADT.Compare: instance Show (a := b)
- Data.GADT.Compare: instance Typeable2 :=
- Data.GADT.Compare: instance Typeable2 GOrdering
+ Data.Dependent.Sum: instance [safe] Eq a => EqTag ((:=) a)
+ Data.Dependent.Sum: instance [safe] EqTag tag => Eq (DSum tag)
+ Data.Dependent.Sum: instance [safe] Ord a => OrdTag ((:=) a)
+ Data.Dependent.Sum: instance [safe] OrdTag tag => Ord (DSum tag)
+ Data.Dependent.Sum: instance [safe] Read a => ReadTag ((:=) a)
+ Data.Dependent.Sum: instance [safe] ReadTag tag => Read (DSum tag)
+ Data.Dependent.Sum: instance [safe] Show a => ShowTag ((:=) a)
+ Data.Dependent.Sum: instance [safe] Show a => ShowTag (GOrdering a)
+ Data.Dependent.Sum: instance [safe] ShowTag tag => Show (DSum tag)
+ Data.GADT.Compare: instance [safe] Eq (GOrdering a b)
+ Data.GADT.Compare: instance [safe] Eq (a := b)
+ Data.GADT.Compare: instance [safe] GCompare ((:=) a)
+ Data.GADT.Compare: instance [safe] GEq ((:=) a)
+ Data.GADT.Compare: instance [safe] GRead ((:=) a)
+ Data.GADT.Compare: instance [safe] GRead (GOrdering a)
+ Data.GADT.Compare: instance [safe] GShow ((:=) a)
+ Data.GADT.Compare: instance [safe] GShow (GOrdering a)
+ Data.GADT.Compare: instance [safe] Ord (GOrdering a b)
+ Data.GADT.Compare: instance [safe] Ord (a := b)
+ Data.GADT.Compare: instance [safe] Read (a := a)
+ Data.GADT.Compare: instance [safe] Show (GOrdering a b)
+ Data.GADT.Compare: instance [safe] Show (a := b)
+ Data.GADT.Compare: instance [safe] Typeable2 :=
+ Data.GADT.Compare: instance [safe] Typeable2 GOrdering
Files
- dependent-sum.cabal +4/−1
- src/Data/Dependent/Sum.hs +7/−7
- src/Data/Dependent/Sum.hs-boot +5/−0
- src/Data/Dependent/Sum/Typeable.hs +28/−0
- src/Data/GADT/Compare.hs +4/−0
- src/Data/GADT/Show.hs +4/−0
dependent-sum.cabal view
@@ -1,5 +1,5 @@ name: dependent-sum-version: 0.2+version: 0.2.0.1 stability: provisional cabal-version: >= 1.6@@ -28,4 +28,7 @@ exposed-modules: Data.Dependent.Sum Data.GADT.Compare Data.GADT.Show+ other-modules: Data.Dependent.Sum.Typeable build-depends: base >= 3 && <5+ if impl(ghc >= 7.2)+ ghc-options: -trust base
src/Data/Dependent/Sum.hs view
@@ -1,9 +1,15 @@ {-# LANGUAGE ExistentialQuantification, GADTs #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE CPP #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Safe #-}+#endif module Data.Dependent.Sum where +import Data.Dependent.Sum.Typeable ({- instance Typeable ... -})+ import Data.GADT.Show import Data.GADT.Compare-import Data.Typeable import Data.Maybe (fromMaybe) @@ -36,12 +42,6 @@ -- is equivalent to @foo bar (AString :=> "eep")@. data DSum tag = forall a. !(tag a) :=> a infixr 1 :=>--instance Typeable1 t => Typeable (DSum t) where- typeOf ds = mkTyConApp dSumCon [typeOfT]- where- dSumCon = mkTyCon "Data.Dependent.Sum.DSum"- typeOfT = typeOf1 $ (undefined :: DSum f -> f a) ds -- |In order to make a 'Show' instance for @DSum tag@, @tag@ must be able -- to show itself as well as any value of the tagged type. 'GShow' together
+ src/Data/Dependent/Sum.hs-boot view
@@ -0,0 +1,5 @@+{-# LANGUAGE ExistentialQuantification, TypeOperators #-}+module Data.Dependent.Sum where++data DSum tag = forall a. !(tag a) :=> a+infixr 1 :=>
+ src/Data/Dependent/Sum/Typeable.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE CPP #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Trustworthy #-}+#endif+-- |Separate module for Typeable declaration, to minimize the amount of+-- visual inspection required to determine that this package is "safe"+module Data.Dependent.Sum.Typeable where++import {-# SOURCE #-} Data.Dependent.Sum+import Data.Typeable++#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702++instance Typeable1 t => Typeable (DSum t) where+ typeOf ds = mkTyConApp dSumCon [typeOfT]+ where+ dSumCon = mkTyCon3 "dependent-sum" "Data.Dependent.Sum" "DSum"+ typeOfT = typeOf1 $ (undefined :: DSum f -> f a) ds++#else ++instance Typeable1 t => Typeable (DSum t) where+ typeOf ds = mkTyConApp dSumCon [typeOfT]+ where+ dSumCon = mkTyCon "Data.Dependent.Sum.DSum"+ typeOfT = typeOf1 $ (undefined :: DSum f -> f a) ds++#endif
src/Data/GADT/Compare.hs view
@@ -3,6 +3,10 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# OPTIONS_GHC -fno-warn-deprecated-flags #-} {-# LANGUAGE ImpredicativeTypes #-}+{-# LANGUAGE CPP #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Safe #-}+#endif module Data.GADT.Compare where import Data.Maybe
src/Data/GADT/Show.hs view
@@ -1,4 +1,8 @@ {-# LANGUAGE RankNTypes, ImpredicativeTypes #-}+{-# LANGUAGE CPP #-}+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE Safe #-}+#endif module Data.GADT.Show where -- |'Show'-like class for 1-type-parameter GADTs