diff options
-rw-r--r-- | libraries/base/GHC/TypeLits.hs | 18 | ||||
-rw-r--r-- | libraries/base/GHC/TypeNats.hs | 8 | ||||
-rw-r--r-- | libraries/base/changelog.md | 2 |
3 files changed, 27 insertions, 1 deletions
diff --git a/libraries/base/GHC/TypeLits.hs b/libraries/base/GHC/TypeLits.hs index 288ec39fc2..ee88741a12 100644 --- a/libraries/base/GHC/TypeLits.hs +++ b/libraries/base/GHC/TypeLits.hs @@ -68,7 +68,7 @@ module GHC.TypeLits ) where -import GHC.Base ( Eq(..), Functor(..), Ord(..), Ordering(..), String +import GHC.Base ( Bool(..), Eq(..), Functor(..), Ord(..), Ordering(..), String , (.), otherwise, withDict, Void, (++) , errorWithoutStackTrace) import GHC.Types(Symbol, Char, TYPE) @@ -374,6 +374,14 @@ data KnownSymbolInstance (s :: Symbol) where knownSymbolInstance :: SSymbol s -> KnownSymbolInstance s knownSymbolInstance ss = withKnownSymbol ss KnownSymbolInstance +-- | @since 4.19.0.0 +instance Eq (SSymbol s) where + _ == _ = True + +-- | @since 4.19.0.0 +instance Ord (SSymbol s) where + compare _ _ = EQ + -- | @since 4.18.0.0 instance Show (SSymbol s) where showsPrec p (UnsafeSSymbol s) @@ -467,6 +475,14 @@ data KnownCharInstance (n :: Char) where knownCharInstance :: SChar c -> KnownCharInstance c knownCharInstance sc = withKnownChar sc KnownCharInstance +-- | @since 4.19.0.0 +instance Eq (SChar c) where + _ == _ = True + +-- | @since 4.19.0.0 +instance Ord (SChar c) where + compare _ _ = EQ + -- | @since 4.18.0.0 instance Show (SChar c) where showsPrec p (UnsafeSChar c) diff --git a/libraries/base/GHC/TypeNats.hs b/libraries/base/GHC/TypeNats.hs index 66361d66db..668df1e032 100644 --- a/libraries/base/GHC/TypeNats.hs +++ b/libraries/base/GHC/TypeNats.hs @@ -378,6 +378,14 @@ data KnownNatInstance (n :: Nat) where knownNatInstance :: SNat n -> KnownNatInstance n knownNatInstance sn = withKnownNat sn KnownNatInstance +-- | @since 4.19.0.0 +instance Eq (SNat n) where + _ == _ = True + +-- | @since 4.19.0.0 +instance Ord (SNat n) where + compare _ _ = EQ + -- | @since 4.18.0.0 instance Show (SNat n) where showsPrec p (UnsafeSNat n) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index ed9be1093d..3e1a49bbb0 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -14,6 +14,8 @@ * Add `Data.Functor.unzip` ([CLC proposal #88](https://github.com/haskell/core-libraries-committee/issues/88)) * Implement more members of `instance Foldable (Compose f g)` explicitly. ([CLC proposal #57](https://github.com/haskell/core-libraries-committee/issues/57)) + * Add `Eq` and `Ord` instances for `SSymbol`, `SChar`, and `SNat`. + ([CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148)) ## 4.18.0.0 *TBA* |