packages feed

dependent-sum 0.6 → 0.6.1

raw patch · 4 files changed

+18/−7 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Data.Dependent.Sum: compareTagged :: forall tag f a. OrdTag tag f => tag a -> tag a -> f a -> f a -> Ordering
+ Data.Dependent.Sum: eqTagged :: forall tag f a. EqTag tag f => tag a -> tag a -> f a -> f a -> Bool
- Data.Dependent.Sum: compareTaggedPrec :: forall tag f a. (GCompare tag, Has' Ord tag f) => tag a -> tag a -> f a -> f a -> Ordering
+ Data.Dependent.Sum: compareTaggedPrec :: forall tag f a. (GCompare tag, Has' Eq tag f, Has' Ord tag f) => tag a -> tag a -> f a -> f a -> Ordering
- Data.Dependent.Sum: type OrdTag tag f = (GCompare tag, Has' Ord tag f)
+ Data.Dependent.Sum: type OrdTag tag f = (GCompare tag, Has' Eq tag f, Has' Ord tag f)

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Revision history for dependent-sum +## 0.6.1.0 - 2019-08-04++* Add legacy `eqTagged` and `compareTagged` functions. Fix deprecated `OrdTag` synonym (it was missing the `Has' Eq` constraint). To upgrade from dependent-sum <0.6, you will likely need to add enable the `FlexibleContexts` language extension, and possible others.+ ## 0.6 - 2019-03-21  * Use constraints-extras ArgDict/Has' to define the instances of Eq, Ord, Read and Show for DSum.
dependent-sum.cabal view
@@ -1,5 +1,5 @@ name:                   dependent-sum-version:                0.6+version:                0.6.1 stability:              provisional  cabal-version:          >= 1.6
src/Data/Dependent/Sum.hs view
@@ -87,7 +87,7 @@     compare (t1 :=> x1) (t2 :=> x2)  = case gcompare t1 t2 of         GLT -> LT         GGT -> GT-        GEQ -> has' @Ord @f t1 (x1 `compare` x2)+        GEQ -> has' @Eq @f t1 $ has' @Ord @f t1 (x1 `compare` x2)  {-# DEPRECATED ShowTag "Instead of 'ShowTag tag f', use '(GShow tag, Has' Show tag f)'" #-} type ShowTag tag f = (GShow tag, Has' Show tag f)@@ -109,11 +109,17 @@   Nothing -> False   Just Refl -> has' @Eq @f tag1 $ f1 == f2 -{-# DEPRECATED OrdTag "Instead of 'OrdTag tag f', use '(GCompare tag, Has' Ord tag f)'" #-}-type OrdTag tag f = (GCompare tag, Has' Ord tag f)+eqTagged :: forall tag f a. EqTag tag f => tag a -> tag a -> f a -> f a -> Bool+eqTagged k _ x0 x1 = has' @Eq @f k (x0 == x1) -compareTaggedPrec :: forall tag f a. (GCompare tag, Has' Ord tag f) => tag a -> tag a -> f a -> f a -> Ordering+{-# DEPRECATED OrdTag "Instead of 'OrdTag tag f', use '(GCompare tag, Has' Eq tag f, Has' Ord tag f)'" #-}+type OrdTag tag f = (GCompare tag, Has' Eq tag f, Has' Ord tag f)++compareTaggedPrec :: forall tag f a. (GCompare tag, Has' Eq tag f, Has' Ord tag f) => tag a -> tag a -> f a -> f a -> Ordering compareTaggedPrec tag1 tag2 f1 f2 = case tag1 `gcompare` tag2 of   GLT -> LT-  GEQ -> has' @Ord @f tag1 $ f1 `compare` f2+  GEQ -> has' @Eq @f tag1 $ has' @Ord @f tag1 $ f1 `compare` f2   GGT -> GT++compareTagged :: forall tag f a. OrdTag tag f => tag a -> tag a -> f a -> f a -> Ordering+compareTagged k _ x0 x1 = has' @Eq @f k $ has' @Ord @f k (compare x0 x1)
src/Data/Some.hs view
@@ -51,12 +51,13 @@ -- Some TagBool -- newtype Some tag = UnsafeSome (tag Any)+data SBox a = SBox !a  #if __GLASGOW_HASKELL__ >= 801 {-# COMPLETE Some #-} #endif pattern Some :: tag a -> Some tag-pattern Some x <- UnsafeSome ((unsafeCoerce :: tag Any -> tag a) -> x)+pattern Some x <- UnsafeSome (SBox . (unsafeCoerce :: tag Any -> tag a) -> SBox x)   where Some x = UnsafeSome ((unsafeCoerce :: tag a -> tag Any) x)  #if __GLASGOW_HASKELL__ >= 801