summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci
diff options
context:
space:
mode:
authorDaniel Rogozin <daniel.rogozin@serokell.io>2020-05-27 13:35:24 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-06 09:26:51 -0500
commit7f3524efcbd58ca6837ec0ffca6ddd121d64e4de (patch)
treeaa296d28ed6475799ef369b0608736afcb467495 /testsuite/tests/ghci
parent640a3ece333d1b0d0af8f353c3e1df9dd0cb9ef3 (diff)
downloadhaskell-7f3524efcbd58ca6837ec0ffca6ddd121d64e4de.tar.gz
The Char kind (#11342)
Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io> Implement GHC Proposal #387 * Parse char literals 'x' at the type level * New built-in type families CmpChar, ConsSymbol, UnconsSymbol * New KnownChar class (cf. KnownSymbol and KnownNat) * New SomeChar type (cf. SomeSymbol and SomeNat) * CharTyLit support in template-haskell Updated submodules: binary, haddock. Metric Decrease: T5205 haddock.base Metric Increase: Naperian T13035
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r--testsuite/tests/ghci/scripts/T9181.stdout24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T9181.stdout b/testsuite/tests/ghci/scripts/T9181.stdout
index 170e17b995..d4e869f073 100644
--- a/testsuite/tests/ghci/scripts/T9181.stdout
+++ b/testsuite/tests/ghci/scripts/T9181.stdout
@@ -1,9 +1,14 @@
type GHC.TypeLits.AppendSymbol :: GHC.Types.Symbol
-> GHC.Types.Symbol -> GHC.Types.Symbol
type family GHC.TypeLits.AppendSymbol a b
+type GHC.TypeLits.CmpChar :: Char -> Char -> Ordering
+type family GHC.TypeLits.CmpChar a b
type GHC.TypeLits.CmpSymbol :: GHC.Types.Symbol
-> GHC.Types.Symbol -> Ordering
type family GHC.TypeLits.CmpSymbol a b
+type GHC.TypeLits.ConsSymbol :: Char
+ -> GHC.Types.Symbol -> GHC.Types.Symbol
+type family GHC.TypeLits.ConsSymbol a b
type GHC.TypeLits.ErrorMessage :: *
data GHC.TypeLits.ErrorMessage
= GHC.TypeLits.Text GHC.Types.Symbol
@@ -14,10 +19,19 @@ data GHC.TypeLits.ErrorMessage
| GHC.TypeLits.ErrorMessage
GHC.TypeLits.:$$:
GHC.TypeLits.ErrorMessage
+type GHC.TypeLits.KnownChar :: Char -> Constraint
+class GHC.TypeLits.KnownChar n where
+ GHC.TypeLits.charSing :: GHC.TypeLits.SChar n
+ {-# MINIMAL charSing #-}
type GHC.TypeLits.KnownSymbol :: GHC.Types.Symbol -> Constraint
class GHC.TypeLits.KnownSymbol n where
GHC.TypeLits.symbolSing :: GHC.TypeLits.SSymbol n
{-# MINIMAL symbolSing #-}
+type GHC.TypeLits.SomeChar :: *
+data GHC.TypeLits.SomeChar
+ = forall (n :: Char).
+ GHC.TypeLits.KnownChar n =>
+ GHC.TypeLits.SomeChar (Data.Proxy.Proxy n)
type GHC.TypeLits.SomeSymbol :: *
data GHC.TypeLits.SomeSymbol
= forall (n :: GHC.Types.Symbol).
@@ -26,13 +40,23 @@ data GHC.TypeLits.SomeSymbol
type GHC.TypeLits.TypeError :: forall b.
GHC.TypeLits.ErrorMessage -> b
type family GHC.TypeLits.TypeError a where
+type GHC.TypeLits.UnconsSymbol :: GHC.Types.Symbol
+ -> Maybe (Char, GHC.Types.Symbol)
+type family GHC.TypeLits.UnconsSymbol a
+GHC.TypeLits.charVal :: GHC.TypeLits.KnownChar n => proxy n -> Char
+GHC.TypeLits.charVal' ::
+ GHC.TypeLits.KnownChar n => GHC.Prim.Proxy# n -> Char
GHC.TypeLits.natVal ::
GHC.TypeNats.KnownNat n => proxy n -> Integer
GHC.TypeLits.natVal' ::
GHC.TypeNats.KnownNat n => GHC.Prim.Proxy# n -> Integer
+GHC.TypeLits.sameChar ::
+ (GHC.TypeLits.KnownChar a, GHC.TypeLits.KnownChar b) =>
+ proxy1 a -> proxy2 b -> Maybe (a Data.Type.Equality.:~: b)
GHC.TypeLits.sameSymbol ::
(GHC.TypeLits.KnownSymbol a, GHC.TypeLits.KnownSymbol b) =>
proxy1 a -> proxy2 b -> Maybe (a Data.Type.Equality.:~: b)
+GHC.TypeLits.someCharVal :: Char -> GHC.TypeLits.SomeChar
GHC.TypeLits.someNatVal :: Integer -> Maybe GHC.TypeNats.SomeNat
GHC.TypeLits.someSymbolVal :: String -> GHC.TypeLits.SomeSymbol
GHC.TypeLits.symbolVal ::