diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2019-09-28 15:20:39 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-30 22:43:31 -0400 |
commit | bdba6ac28cc90497e0f1d5d71fc62326455edaae (patch) | |
tree | 51fdedb227b5ee32ac361ed8af4cbd69aca9c0b1 | |
parent | b36dd49b6ce14c6d7781518091fd0d98d5730899 (diff) | |
download | haskell-bdba6ac28cc90497e0f1d5d71fc62326455edaae.tar.gz |
Do not rely on CUSKs in 'base'
Use standalone kind signatures instead of complete user-specified kinds
in Data.Type.Equality and Data.Typeable
-rw-r--r-- | libraries/base/Data/Type/Equality.hs | 7 | ||||
-rw-r--r-- | libraries/base/Data/Typeable/Internal.hs | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libraries/base/Data/Type/Equality.hs b/libraries/base/Data/Type/Equality.hs index f9c9cc23da..e900546671 100644 --- a/libraries/base/Data/Type/Equality.hs +++ b/libraries/base/Data/Type/Equality.hs @@ -12,6 +12,7 @@ {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} +{-# LANGUAGE StandaloneKindSignatures #-} {-# LANGUAGE Trustworthy #-} ----------------------------------------------------------------------------- @@ -122,7 +123,8 @@ deriving instance a ~ b => Bounded (a :~: b) -- inhabited by a terminating value if and only if @a@ is the same type as @b@. -- -- @since 4.10.0.0 -data (a :: k1) :~~: (b :: k2) where +type (:~~:) :: k1 -> k2 -> Type +data a :~~: b where HRefl :: a :~~: a -- | @since 4.10.0.0 @@ -163,7 +165,8 @@ instance TestEquality ((:~~:) a) where infix 4 == -- | A type family to compute Boolean equality. -type family (a :: k) == (b :: k) :: Bool where +type (==) :: k -> k -> Bool +type family a == b where f a == g b = f == g && a == b a == a = 'True _ == _ = 'False diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs index 5c087272fa..6135487e6e 100644 --- a/libraries/base/Data/Typeable/Internal.hs +++ b/libraries/base/Data/Typeable/Internal.hs @@ -18,6 +18,7 @@ {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE StandaloneKindSignatures #-} ----------------------------------------------------------------------------- -- | @@ -178,7 +179,8 @@ rnfTyCon (TyCon _ _ m n _ k) = rnfModule m `seq` rnfTrName n `seq` rnfKindRep k -- | A concrete representation of a (monomorphic) type. -- 'TypeRep' supports reasonably efficient equality. -data TypeRep (a :: k) where +type TypeRep :: k -> Type +data TypeRep a where -- The TypeRep of Type. See Note [Kind caching], Wrinkle 2 TrType :: TypeRep Type TrTyCon :: { -- See Note [TypeRep fingerprints] |