type-compare 0.1.0 → 0.1.1
raw patch · 3 files changed
+18/−2 lines, 3 files
Files
- CHANGELOG.md +6/−0
- src/Kinds/Ord.hs +11/−1
- type-compare.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,9 @@+# 0.1.1 (2021-11-05)++* Adapt `SOrdering` from `numeric-kinds` into a backfill for `OrderingI`.+ * The type and its constructors have been renamed.+ * `EQI` now requires/proves nominal equality of its type parameters.+ # 0.1.0 (2021-11-05) Initial version, moved out of `numeric-kinds`.
src/Kinds/Ord.hs view
@@ -15,6 +15,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-}+{-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}@@ -36,6 +37,9 @@ -- ** Selection , Max, Min + -- ** Proof Witnesses+ , OrderingI(..)+ -- * Utility , Proven, OrdCond, CompareCond ) where@@ -45,7 +49,7 @@ ( Compare, OrdCond , type (<?), type (>?), type (<=?), type (>=?) , type (<=), type (>=), type (>)- , Max, Min+ , Max, Min, OrderingI(..) ) #else import GHC.TypeLits (CmpNat)@@ -112,4 +116,10 @@ #if !MIN_VERSION_base(4, 16, 0) type Min x y = CompareCond x y x x y type Max x y = CompareCond x y y y x++-- | Ordering results carrying evidence of type-level ordering relations.+data OrderingI m n where+ LTI :: Compare m n ~ 'LT => OrderingI m n+ EQI :: Compare m m ~ 'EQ => OrderingI m m+ GTI :: Compare m n ~ 'GT => OrderingI m n #endif
type-compare.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: type-compare-version: 0.1.0+version: 0.1.1 synopsis: Type-level Ord compatibility layer description: In @base-4.16.0.0@, an open type family @Compare@ was added as a type-level analog of @Ord@. This package provides a compatible interface on earlier