Commit 4e47217f authored by Bodigrim's avatar Bodigrim Committed by Marge Bot

Make sameNat and sameSymbol proxy-polymorphic

parent a2b535d9
......@@ -203,7 +203,7 @@ type family TypeError (a :: ErrorMessage) :: b where
--
-- @since 4.7.0.0
sameSymbol :: (KnownSymbol a, KnownSymbol b) =>
Proxy a -> Proxy b -> Maybe (a :~: b)
proxy1 a -> proxy2 b -> Maybe (a :~: b)
sameSymbol x y
| symbolVal x == symbolVal y = Just (unsafeCoerce Refl)
| otherwise = Nothing
......
......@@ -223,7 +223,7 @@ type family Log2 (m :: Nat) :: Nat
--
-- @since 4.7.0.0
sameNat :: (KnownNat a, KnownNat b) =>
Proxy a -> Proxy b -> Maybe (a :~: b)
proxy1 a -> proxy2 b -> Maybe (a :~: b)
sameNat x y
| natVal x == natVal y = Just (unsafeCoerce Refl)
| otherwise = Nothing
......
......@@ -32,8 +32,7 @@ GHC.TypeLits.natVal' ::
GHC.TypeNats.KnownNat n => GHC.Prim.Proxy# n -> Integer
GHC.TypeLits.sameSymbol ::
(GHC.TypeLits.KnownSymbol a, GHC.TypeLits.KnownSymbol b) =>
Data.Proxy.Proxy a
-> Data.Proxy.Proxy b -> Maybe (a Data.Type.Equality.:~: b)
proxy1 a -> proxy2 b -> Maybe (a Data.Type.Equality.:~: b)
GHC.TypeLits.someNatVal :: Integer -> Maybe GHC.TypeNats.SomeNat
GHC.TypeLits.someSymbolVal :: String -> GHC.TypeLits.SomeSymbol
GHC.TypeLits.symbolVal ::
......@@ -84,5 +83,4 @@ type (GHC.TypeNats.^) :: GHC.Types.Nat
type family (GHC.TypeNats.^) a b
GHC.TypeNats.sameNat ::
(GHC.TypeNats.KnownNat a, GHC.TypeNats.KnownNat b) =>
Data.Proxy.Proxy a
-> Data.Proxy.Proxy b -> Maybe (a Data.Type.Equality.:~: b)
proxy1 a -> proxy2 b -> Maybe (a Data.Type.Equality.:~: b)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment