summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ellis <tom.ellis@microsoft.com>2020-05-29 16:58:19 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-01 06:39:55 -0400
commit68b71c4a99ef7c009e0095823950cd12408ad7fe (patch)
tree3be68edb5c47e45ea2efeacbe89cc422648218e4
parent8f2e5732b0eec2d99b821a7f622aee8b2c00739a (diff)
downloadhaskell-68b71c4a99ef7c009e0095823950cd12408ad7fe.tar.gz
Rename the singleton tuple GHC.Tuple.Unit to GHC.Tuple.Solo
-rw-r--r--compiler/GHC/Builtin/Types.hs32
-rw-r--r--compiler/GHC/Builtin/Utils.hs2
-rw-r--r--compiler/GHC/Core/Make.hs4
-rw-r--r--compiler/GHC/Hs/Expr.hs2
-rw-r--r--compiler/GHC/Hs/Pat.hs2
-rw-r--r--compiler/GHC/Hs/Type.hs4
-rw-r--r--compiler/GHC/HsToCore/Utils.hs22
-rw-r--r--compiler/GHC/Iface/Type.hs2
-rw-r--r--compiler/GHC/Tc/Gen/HsType.hs18
-rw-r--r--libraries/ghc-prim/GHC/Tuple.hs2
-rw-r--r--libraries/ghc-prim/changelog.md4
-rw-r--r--libraries/template-haskell/Language/Haskell/TH/Syntax.hs2
-rw-r--r--testsuite/tests/deriving/should_fail/T15073.stderr2
-rw-r--r--testsuite/tests/ghc-api/annotations/parseTree.stdout14
-rw-r--r--testsuite/tests/th/T17380.stderr28
-rw-r--r--testsuite/tests/th/T18097.hs8
-rw-r--r--testsuite/tests/th/T8761.stderr4
-rw-r--r--testsuite/tests/th/TH_1tuple.stderr10
-rw-r--r--testsuite/tests/th/TH_Promoted1Tuple.stderr2
-rw-r--r--testsuite/tests/th/TH_tuple1.stdout8
-rw-r--r--testsuite/tests/typecheck/should_compile/holes.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/holes3.stderr2
22 files changed, 89 insertions, 87 deletions
diff --git a/compiler/GHC/Builtin/Types.hs b/compiler/GHC/Builtin/Types.hs
index 11dbaec79b..d51f2243ca 100644
--- a/compiler/GHC/Builtin/Types.hs
+++ b/compiler/GHC/Builtin/Types.hs
@@ -723,10 +723,10 @@ bit odd:
1-tuples: ??
0-tuples: () ()#
-Zero-tuples have used up the logical name. So we use 'Unit' and 'Unit#'
+Zero-tuples have used up the logical name. So we use 'Solo' and 'Solo#'
for one-tuples. So in ghc-prim:GHC.Tuple we see the declarations:
data () = ()
- data Unit a = Unit a
+ data Solo a = Solo a
data (a,b) = (a,b)
There is no way to write a boxed one-tuple in Haskell using tuple syntax.
@@ -736,7 +736,7 @@ They can, however, be written using other methods:
2. They can be generated by way of Template Haskell or in `deriving` code.
There is nothing special about one-tuples in Core; in particular, they have no
-custom pretty-printing, just using `Unit`.
+custom pretty-printing, just using `Solo`.
Note that there is *not* a unary constraint tuple, unlike for other forms of
tuples. See [Ignore unary constraint tuples] in GHC.Tc.Gen.HsType for more
@@ -749,24 +749,24 @@ Note [Don't flatten tuples from HsSyn] in GHC.Core.Make.
-- Wrinkle: Make boxed one-tuple names have known keys
-----
-We make boxed one-tuple names have known keys so that `data Unit a = Unit a`,
+We make boxed one-tuple names have known keys so that `data Solo a = Solo a`,
defined in GHC.Tuple, will be used when one-tuples are spliced in through
Template Haskell. This program (from #18097) crucially relies on this:
- case $( tupE [ [| "ok" |] ] ) of Unit x -> putStrLn x
+ case $( tupE [ [| "ok" |] ] ) of Solo x -> putStrLn x
-Unless Unit has a known key, the type of `$( tupE [ [| "ok" |] ] )` (an
-ExplicitTuple of length 1) will not match the type of Unit (an ordinary
-data constructor used in a pattern). Making Unit known-key allows GHC to make
+Unless Solo has a known key, the type of `$( tupE [ [| "ok" |] ] )` (an
+ExplicitTuple of length 1) will not match the type of Solo (an ordinary
+data constructor used in a pattern). Making Solo known-key allows GHC to make
this connection.
-Unlike Unit, every other tuple is /not/ known-key
+Unlike Solo, every other tuple is /not/ known-key
(see Note [Infinite families of known-key names] in GHC.Builtin.Names). The
main reason for this exception is that other tuples are written with special
syntax, and as a result, they are renamed using a special `isBuiltInOcc_maybe`
function (see Note [Built-in syntax and the OrigNameCache] in GHC.Types.Name.Cache).
-In contrast, Unit is just an ordinary data type with no special syntax, so it
-doesn't really make sense to handle it in `isBuiltInOcc_maybe`. Making Unit
+In contrast, Solo is just an ordinary data type with no special syntax, so it
+doesn't really make sense to handle it in `isBuiltInOcc_maybe`. Making Solo
known-key is the next-best way to teach the internals of the compiler about it.
-}
@@ -791,7 +791,7 @@ isBuiltInOcc_maybe occ =
"->" -> Just funTyConName
-- boxed tuple data/tycon
- -- We deliberately exclude Unit (the boxed 1-tuple).
+ -- We deliberately exclude Solo (the boxed 1-tuple).
-- See Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
"()" -> Just $ tup_name Boxed 0
_ | Just rest <- "(" `BS.stripPrefix` name
@@ -801,7 +801,7 @@ isBuiltInOcc_maybe occ =
-- unboxed tuple data/tycon
"(##)" -> Just $ tup_name Unboxed 0
- "Unit#" -> Just $ tup_name Unboxed 1
+ "Solo#" -> Just $ tup_name Unboxed 1
_ | Just rest <- "(#" `BS.stripPrefix` name
, (commas, rest') <- BS.span (==',') rest
, "#)" <- rest'
@@ -851,17 +851,17 @@ mkTupleStr Unboxed = mkUnboxedTupleStr
mkBoxedTupleStr :: Arity -> String
mkBoxedTupleStr 0 = "()"
-mkBoxedTupleStr 1 = "Unit" -- See Note [One-tuples]
+mkBoxedTupleStr 1 = "Solo" -- See Note [One-tuples]
mkBoxedTupleStr ar = '(' : commas ar ++ ")"
mkUnboxedTupleStr :: Arity -> String
mkUnboxedTupleStr 0 = "(##)"
-mkUnboxedTupleStr 1 = "Unit#" -- See Note [One-tuples]
+mkUnboxedTupleStr 1 = "Solo#" -- See Note [One-tuples]
mkUnboxedTupleStr ar = "(#" ++ commas ar ++ "#)"
mkConstraintTupleStr :: Arity -> String
mkConstraintTupleStr 0 = "(%%)"
-mkConstraintTupleStr 1 = "Unit%" -- See Note [One-tuples]
+mkConstraintTupleStr 1 = "Solo%" -- See Note [One-tuples]
mkConstraintTupleStr ar = "(%" ++ commas ar ++ "%)"
commas :: Arity -> String
diff --git a/compiler/GHC/Builtin/Utils.hs b/compiler/GHC/Builtin/Utils.hs
index ab2aeed961..4dbbefd80c 100644
--- a/compiler/GHC/Builtin/Utils.hs
+++ b/compiler/GHC/Builtin/Utils.hs
@@ -127,7 +127,7 @@ knownKeyNames
all_names =
-- We exclude most tuples from this list—see
-- Note [Infinite families of known-key names] in GHC.Builtin.Names.
- -- We make an exception for Unit (i.e., the boxed 1-tuple), since it does
+ -- We make an exception for Solo (i.e., the boxed 1-tuple), since it does
-- not use special syntax like other tuples.
-- See Note [One-tuples] (Wrinkle: Make boxed one-tuple names have known keys)
-- in GHC.Builtin.Types.
diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs
index 5992bcc4f5..2156ce70ce 100644
--- a/compiler/GHC/Core/Make.hs
+++ b/compiler/GHC/Core/Make.hs
@@ -344,12 +344,12 @@ We could do one of two things:
mkCoreTup [e1] = e1
* Build a one-tuple (see Note [One-tuples] in GHC.Builtin.Types)
- mkCoreTup1 [e1] = Unit e1
+ mkCoreTup1 [e1] = Solo e1
We use a suffix "1" to indicate this.
Usually we want the former, but occasionally the latter.
-NB: The logic in tupleDataCon knows about () and Unit and (,), etc.
+NB: The logic in tupleDataCon knows about () and Solo and (,), etc.
Note [Don't flatten tuples from HsSyn]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs
index 880277d8fd..a170594511 100644
--- a/compiler/GHC/Hs/Expr.hs
+++ b/compiler/GHC/Hs/Expr.hs
@@ -983,7 +983,7 @@ ppr_expr (SectionR _ op expr)
ppr_expr (ExplicitTuple _ exprs boxity)
-- Special-case unary boxed tuples so that they are pretty-printed as
- -- `Unit x`, not `(x)`
+ -- `Solo x`, not `(x)`
| [L _ (Present _ expr)] <- exprs
, Boxed <- boxity
= hsep [text (mkTupleStr Boxed 1), ppr expr]
diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs
index 241e3c59e0..7a3f91072d 100644
--- a/compiler/GHC/Hs/Pat.hs
+++ b/compiler/GHC/Hs/Pat.hs
@@ -570,7 +570,7 @@ pprPat (SigPat _ pat ty) = ppr pat <+> dcolon <+> ppr_ty
pprPat (ListPat _ pats) = brackets (interpp'SP pats)
pprPat (TuplePat _ pats bx)
-- Special-case unary boxed tuples so that they are pretty-printed as
- -- `Unit x`, not `(x)`
+ -- `Solo x`, not `(x)`
| [pat] <- pats
, Boxed <- bx
= hcat [text (mkTupleStr Boxed 1), pprParendLPat appPrec pat]
diff --git a/compiler/GHC/Hs/Type.hs b/compiler/GHC/Hs/Type.hs
index 977e790a97..43e131ce0c 100644
--- a/compiler/GHC/Hs/Type.hs
+++ b/compiler/GHC/Hs/Type.hs
@@ -1663,7 +1663,7 @@ ppr_mono_ty (HsTyVar _ prom (L _ name))
ppr_mono_ty (HsFunTy _ ty1 ty2) = ppr_fun_ty ty1 ty2
ppr_mono_ty (HsTupleTy _ con tys)
-- Special-case unary boxed tuples so that they are pretty-printed as
- -- `Unit x`, not `(x)`
+ -- `Solo x`, not `(x)`
| [ty] <- tys
, BoxedTuple <- std_con
= sep [text (mkTupleStr Boxed 1), ppr_mono_lty ty]
@@ -1684,7 +1684,7 @@ ppr_mono_ty (HsExplicitListTy _ prom tys)
| otherwise = brackets (interpp'SP tys)
ppr_mono_ty (HsExplicitTupleTy _ tys)
-- Special-case unary boxed tuples so that they are pretty-printed as
- -- `'Unit x`, not `'(x)`
+ -- `'Solo x`, not `'(x)`
| [ty] <- tys
= quote $ sep [text (mkTupleStr Boxed 1), ppr_mono_lty ty]
| otherwise
diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs
index 194cf4e1ac..d7b6d8f358 100644
--- a/compiler/GHC/HsToCore/Utils.hs
+++ b/compiler/GHC/HsToCore/Utils.hs
@@ -567,10 +567,10 @@ There are two cases.
* The pattern binds exactly one variable
let !(Just (Just x) = e in body
==>
- let { t = case e of Just (Just v) -> Unit v
- ; v = case t of Unit v -> v }
+ let { t = case e of Just (Just v) -> Solo v
+ ; v = case t of Solo v -> v }
in t `seq` body
- The 'Unit' is a one-tuple; see Note [One-tuples] in GHC.Builtin.Types
+ The 'Solo' is a one-tuple; see Note [One-tuples] in GHC.Builtin.Types
Note that forcing 't' makes the pattern match happen,
but does not force 'v'.
@@ -584,8 +584,8 @@ There are two cases.
------ Examples ----------
* !(_, (_, a)) = e
==>
- t = case e of (_, (_, a)) -> Unit a
- a = case t of Unit a -> a
+ t = case e of (_, (_, a)) -> Solo a
+ a = case t of Solo a -> a
Note that
- Forcing 't' will force the pattern to match fully;
@@ -595,8 +595,8 @@ There are two cases.
* !(Just x) = e
==>
- t = case e of Just x -> Unit x
- x = case t of Unit x -> x
+ t = case e of Just x -> Solo x
+ x = case t of Solo x -> x
Again, forcing 't' will fail if 'e' yields Nothing.
@@ -607,12 +607,12 @@ work out well:
let Just (Just v) = e in body
==>
- let t = case e of Just (Just v) -> Unit v
- v = case t of Unit v -> v
+ let t = case e of Just (Just v) -> Solo v
+ v = case t of Solo v -> v
in body
==>
- let v = case (case e of Just (Just v) -> Unit v) of
- Unit v -> v
+ let v = case (case e of Just (Just v) -> Solo v) of
+ Solo v -> v
in body
==>
let v = case e of Just (Just v) -> v
diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs
index 2595ff46e4..26f7c89445 100644
--- a/compiler/GHC/Iface/Type.hs
+++ b/compiler/GHC/Iface/Type.hs
@@ -1524,7 +1524,7 @@ pprTuple ctxt_prec sort promoted args =
ppr_tuple_app :: [IfaceType] -> SDoc -> SDoc
ppr_tuple_app args_wo_runtime_reps ppr_args_w_parens
-- Special-case unary boxed tuples so that they are pretty-printed as
- -- `Unit x`, not `(x)`
+ -- `Solo x`, not `(x)`
| [_] <- args_wo_runtime_reps
, BoxedTuple <- sort
= let unit_tc_info = IfaceTyConInfo promoted IfaceNormalTyCon
diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs
index a3218936a6..cdbaab115b 100644
--- a/compiler/GHC/Tc/Gen/HsType.hs
+++ b/compiler/GHC/Tc/Gen/HsType.hs
@@ -1051,28 +1051,28 @@ GHC provides unary tuples and unboxed tuples (see Note [One-tuples] in
GHC.Builtin.Types) but does *not* provide unary constraint tuples. Why? First,
recall the definition of a unary tuple data type:
- data Unit a = Unit a
+ data Solo a = Solo a
-Note that `Unit a` is *not* the same thing as `a`, since Unit is boxed and
-lazy. Therefore, the presence of `Unit` matters semantically. On the other
+Note that `Solo a` is *not* the same thing as `a`, since Solo is boxed and
+lazy. Therefore, the presence of `Solo` matters semantically. On the other
hand, suppose we had a unary constraint tuple:
- class a => Unit% a
+ class a => Solo% a
-This compiles down a newtype (i.e., a cast) in Core, so `Unit% a` is
+This compiles down a newtype (i.e., a cast) in Core, so `Solo% a` is
semantically equivalent to `a`. Therefore, a 1-tuple constraint would have
no user-visible impact, nor would it allow you to express anything that
you couldn't otherwise.
-We could simply add Unit% for consistency with tuples (Unit) and unboxed
-tuples (Unit#), but that would require even more magic to wire in another
+We could simply add Solo% for consistency with tuples (Solo) and unboxed
+tuples (Solo#), but that would require even more magic to wire in another
magical class, so we opt not to do so. We must be careful, however, since
one can try to sneak in uses of unary constraint tuples through Template
Haskell, such as in this program (from #17511):
f :: $(pure (ForallT [] [TupleT 1 `AppT` (ConT ''Show `AppT` ConT ''Int)]
(ConT ''String)))
- -- f :: Unit% (Show Int) => String
+ -- f :: Solo% (Show Int) => String
f = "abc"
This use of `TupleT 1` will produce an HsBoxedOrConstraintTuple of arity 1,
@@ -1081,7 +1081,7 @@ it as thought it were a constraint tuple, which can potentially lead to
trouble if one attempts to look up the name of a constraint tuple of arity
1 (as it won't exist). To avoid this trouble, we simply take any unary
constraint tuples discovered when typechecking and drop them—i.e., treat
-"Unit% a" as though the user had written "a". This is always safe to do
+"Solo% a" as though the user had written "a". This is always safe to do
since the two constraints should be semantically equivalent.
-}
diff --git a/libraries/ghc-prim/GHC/Tuple.hs b/libraries/ghc-prim/GHC/Tuple.hs
index 51179167bc..aa53a023b6 100644
--- a/libraries/ghc-prim/GHC/Tuple.hs
+++ b/libraries/ghc-prim/GHC/Tuple.hs
@@ -29,7 +29,7 @@ data () = ()
-- The desugarer uses 1-tuples,
-- but "()" is already used up for 0-tuples
-- See Note [One-tuples] in GHC.Builtin.Types
-data Unit a = Unit a
+data Solo a = Solo a
data (a,b) = (a,b)
data (a,b,c) = (a,b,c)
diff --git a/libraries/ghc-prim/changelog.md b/libraries/ghc-prim/changelog.md
index ac7a138580..0973959910 100644
--- a/libraries/ghc-prim/changelog.md
+++ b/libraries/ghc-prim/changelog.md
@@ -1,4 +1,4 @@
-## 0.6.2 (edit as necessary)
+## 0.7.0 (edit as necessary)
- Shipped with GHC 8.12.1
@@ -17,6 +17,8 @@
If the folding function is known this allows for unboxing of the
Char argument resulting in much faster code.
+- Renamed the singleton tuple `GHC.Tuple.Unit` to `GHC.Tuple.Solo`.
+
## 0.6.1 (edit as necessary)
- Shipped with GHC 8.10.1
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 53d9aabb7d..6555380878 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -1587,7 +1587,7 @@ mk_tup_name n space boxed
withParens thing
| boxed = "(" ++ thing ++ ")"
| otherwise = "(#" ++ thing ++ "#)"
- tup_occ | n == 1 = if boxed then "Unit" else "Unit#"
+ tup_occ | n == 1 = if boxed then "Solo" else "Solo#"
| otherwise = withParens (replicate n_commas ',')
n_commas = n - 1
tup_mod = mkModName "GHC.Tuple"
diff --git a/testsuite/tests/deriving/should_fail/T15073.stderr b/testsuite/tests/deriving/should_fail/T15073.stderr
index 5c1d99768f..129efe496d 100644
--- a/testsuite/tests/deriving/should_fail/T15073.stderr
+++ b/testsuite/tests/deriving/should_fail/T15073.stderr
@@ -3,7 +3,7 @@ T15073.hs:8:12: error:
• Illegal unboxed tuple type as function argument: (# Foo a #)
Perhaps you intended to use UnboxedTuples
• In the type signature:
- p :: Foo a -> Unit# @'GHC.Types.LiftedRep (Foo a)
+ p :: Foo a -> Solo# @'GHC.Types.LiftedRep (Foo a)
When typechecking the code for ‘p’
in a derived instance for ‘P (Foo a)’:
To see the code I am typechecking, use -ddump-deriv
diff --git a/testsuite/tests/ghc-api/annotations/parseTree.stdout b/testsuite/tests/ghc-api/annotations/parseTree.stdout
index 2a53f37342..8d629fb90a 100644
--- a/testsuite/tests/ghc-api/annotations/parseTree.stdout
+++ b/testsuite/tests/ghc-api/annotations/parseTree.stdout
@@ -1,11 +1,11 @@
-[(AnnotationTuple.hs:14:20, [p], Unit 1),
- (AnnotationTuple.hs:14:23-29, [p], Unit "hello"),
- (AnnotationTuple.hs:14:35-37, [p], Unit 6.5),
+[(AnnotationTuple.hs:14:20, [p], Solo 1),
+ (AnnotationTuple.hs:14:23-29, [p], Solo "hello"),
+ (AnnotationTuple.hs:14:35-37, [p], Solo 6.5),
(AnnotationTuple.hs:14:39, [m], ()),
- (AnnotationTuple.hs:14:41-52, [p], Unit [5, 5, 6, 7]),
- (AnnotationTuple.hs:16:8, [p], Unit 1),
- (AnnotationTuple.hs:16:11-17, [p], Unit "hello"),
- (AnnotationTuple.hs:16:20-22, [p], Unit 6.5),
+ (AnnotationTuple.hs:14:41-52, [p], Solo [5, 5, 6, 7]),
+ (AnnotationTuple.hs:16:8, [p], Solo 1),
+ (AnnotationTuple.hs:16:11-17, [p], Solo "hello"),
+ (AnnotationTuple.hs:16:20-22, [p], Solo 6.5),
(AnnotationTuple.hs:16:24, [m], ()),
(AnnotationTuple.hs:16:25, [m], ()),
(AnnotationTuple.hs:16:26, [m], ()), (<no location info>, [m], ())]
diff --git a/testsuite/tests/th/T17380.stderr b/testsuite/tests/th/T17380.stderr
index 85724eb549..358e7f34f2 100644
--- a/testsuite/tests/th/T17380.stderr
+++ b/testsuite/tests/th/T17380.stderr
@@ -1,39 +1,39 @@
T17380.hs:9:7: error:
- • Couldn't match expected type ‘Unit (Maybe String)’
+ • Couldn't match expected type ‘Solo (Maybe String)’
with actual type ‘Maybe [Char]’
• In the expression: Just "wat"
In an equation for ‘foo’: foo = Just "wat"
T17380.hs:12:8: error:
• Couldn't match expected type ‘Maybe String’
- with actual type ‘Unit (Maybe [Char])’
- • In the expression: Unit Just "wat"
- In an equation for ‘bar’: bar = (Unit Just "wat")
+ with actual type ‘Solo (Maybe [Char])’
+ • In the expression: Solo Just "wat"
+ In an equation for ‘bar’: bar = (Solo Just "wat")
T17380.hs:15:6: error:
- • Couldn't match expected type ‘Unit (Maybe String)’
+ • Couldn't match expected type ‘Solo (Maybe String)’
with actual type ‘Maybe [Char]’
• In the pattern: Just "wat"
In an equation for ‘baz’: baz (Just "wat") = Just "frerf"
T17380.hs:18:7: error:
• Couldn't match expected type ‘Maybe String’
- with actual type ‘Unit (Maybe [Char])’
- • In the pattern: Unit(Just "wat")
- In an equation for ‘quux’: quux (Unit(Just "wat")) = Just "frerf"
+ with actual type ‘Solo (Maybe [Char])’
+ • In the pattern: Solo(Just "wat")
+ In an equation for ‘quux’: quux (Solo(Just "wat")) = Just "frerf"
T17380.hs:21:8: error:
- • Couldn't match type ‘Maybe String’ with ‘'Unit (Maybe String)’
- Expected type: Proxy ('Unit (Maybe String))
+ • Couldn't match type ‘Maybe String’ with ‘'Solo (Maybe String)’
+ Expected type: Proxy ('Solo (Maybe String))
Actual type: Proxy (Maybe String)
• In the expression: Proxy :: Proxy (Maybe String)
In an equation for ‘quuz’: quuz = Proxy :: Proxy (Maybe String)
T17380.hs:24:8: error:
- • Couldn't match type ‘'Unit (Maybe String)’ with ‘Maybe String’
+ • Couldn't match type ‘'Solo (Maybe String)’ with ‘Maybe String’
Expected type: Proxy (Maybe String)
- Actual type: Proxy ('Unit (Maybe String))
- • In the expression: Proxy :: Proxy ('Unit Maybe String)
+ Actual type: Proxy ('Solo (Maybe String))
+ • In the expression: Proxy :: Proxy ('Solo Maybe String)
In an equation for ‘fred’:
- fred = Proxy :: Proxy ('Unit Maybe String)
+ fred = Proxy :: Proxy ('Solo Maybe String)
diff --git a/testsuite/tests/th/T18097.hs b/testsuite/tests/th/T18097.hs
index 2263dfe018..2f905d9627 100644
--- a/testsuite/tests/th/T18097.hs
+++ b/testsuite/tests/th/T18097.hs
@@ -4,11 +4,11 @@ module T18097 where
import Language.Haskell.TH
import GHC.Tuple
-f = case $( tupE [ [| "ok" |] ] ) of Unit x -> putStrLn x
-g = case Unit "ok" of $( tupP [ [p| x |] ] ) -> putStrLn x
+f = case $( tupE [ [| "ok" |] ] ) of Solo x -> putStrLn x
+g = case Solo "ok" of $( tupP [ [p| x |] ] ) -> putStrLn x
h :: $( tupleT 1 ) String
-h = Unit "ok"
+h = Solo "ok"
-i :: Unit String
+i :: Solo String
i = $( tupE [ [| "ok" |] ] )
diff --git a/testsuite/tests/th/T8761.stderr b/testsuite/tests/th/T8761.stderr
index 79163dec51..eb45ff46eb 100644
--- a/testsuite/tests/th/T8761.stderr
+++ b/testsuite/tests/th/T8761.stderr
@@ -1,5 +1,5 @@
pattern Q1 x1_0 x2_1 x3_2 <- ((x1_0, x2_1), [x3_2], _, _)
-pattern x1_0 Q2 x2_1 = GHC.Tuple.Unit (x1_0, x2_1)
+pattern x1_0 Q2 x2_1 = GHC.Tuple.Solo (x1_0, x2_1)
pattern Q3 {qx3, qy3, qz3} <- ((qx3, qy3), [qz3]) where
Q3 qx3 qy3 qz3 = ((qx3, qy3), [qz3])
T8761.hs:(16,1)-(39,13): Splicing declarations
@@ -28,7 +28,7 @@ T8761.hs:(16,1)-(39,13): Splicing declarations
return pats
======>
pattern Q1 x1 x2 x3 <- ((x1, x2), [x3], _, _)
- pattern x1 `Q2` x2 = Unit(x1, x2)
+ pattern x1 `Q2` x2 = Solo(x1, x2)
pattern Q3{qx3, qy3, qz3} <- ((qx3, qy3), [qz3]) where
Q3 qx3 qy3 qz3 = ((qx3, qy3), [qz3])
T8761.hs:(42,1)-(46,29): Splicing declarations
diff --git a/testsuite/tests/th/TH_1tuple.stderr b/testsuite/tests/th/TH_1tuple.stderr
index 07b6584242..fad311b0c8 100644
--- a/testsuite/tests/th/TH_1tuple.stderr
+++ b/testsuite/tests/th/TH_1tuple.stderr
@@ -1,7 +1,7 @@
TH_1tuple.hs:11:6: error:
- • Expecting one more argument to ‘Unit’
- Expected a type, but ‘Unit’ has kind ‘* -> *’
- • In an expression type signature: Unit
- In the expression: 1 :: Unit
- In an equation for ‘y’: y = (1 :: Unit)
+ • Expecting one more argument to ‘Solo’
+ Expected a type, but ‘Solo’ has kind ‘* -> *’
+ • In an expression type signature: Solo
+ In the expression: 1 :: Solo
+ In an equation for ‘y’: y = (1 :: Solo)
diff --git a/testsuite/tests/th/TH_Promoted1Tuple.stderr b/testsuite/tests/th/TH_Promoted1Tuple.stderr
index d75a6260fa..bd71507e2e 100644
--- a/testsuite/tests/th/TH_Promoted1Tuple.stderr
+++ b/testsuite/tests/th/TH_Promoted1Tuple.stderr
@@ -1,3 +1,3 @@
TH_Promoted1Tuple.hs:7:2: error:
- Illegal type: ‘'Unit Int’ Perhaps you intended to use DataKinds
+ Illegal type: ‘'Solo Int’ Perhaps you intended to use DataKinds
diff --git a/testsuite/tests/th/TH_tuple1.stdout b/testsuite/tests/th/TH_tuple1.stdout
index 7e35530f6c..e681bf8b3b 100644
--- a/testsuite/tests/th/TH_tuple1.stdout
+++ b/testsuite/tests/th/TH_tuple1.stdout
@@ -1,10 +1,10 @@
SigE (AppE (AppE (ConE GHC.Tuple.(,)) (LitE (IntegerL 1))) (LitE (IntegerL 2))) (AppT (AppT (ConT GHC.Tuple.(,)) (ConT GHC.Integer.Type.Integer)) (ConT GHC.Integer.Type.Integer))
GHC.Tuple.(,) 1 2 :: GHC.Tuple.(,) GHC.Integer.Type.Integer
GHC.Integer.Type.Integer
-SigE (AppE (ConE GHC.Tuple.Unit) (LitE (IntegerL 1))) (AppT (ConT GHC.Tuple.Unit) (ConT GHC.Integer.Type.Integer))
-GHC.Tuple.Unit 1 :: GHC.Tuple.Unit GHC.Integer.Type.Integer
+SigE (AppE (ConE GHC.Tuple.Solo) (LitE (IntegerL 1))) (AppT (ConT GHC.Tuple.Solo) (ConT GHC.Integer.Type.Integer))
+GHC.Tuple.Solo 1 :: GHC.Tuple.Solo GHC.Integer.Type.Integer
SigE (AppE (AppE (ConE GHC.Tuple.(#,#)) (LitE (IntegerL 1))) (LitE (IntegerL 2))) (AppT (AppT (ConT GHC.Tuple.(#,#)) (ConT GHC.Integer.Type.Integer)) (ConT GHC.Integer.Type.Integer))
GHC.Tuple.(#,#) 1 2 :: GHC.Tuple.(#,#) GHC.Integer.Type.Integer
GHC.Integer.Type.Integer
-SigE (AppE (ConE GHC.Tuple.Unit#) (LitE (IntegerL 1))) (AppT (ConT GHC.Tuple.Unit#) (ConT GHC.Integer.Type.Integer))
-GHC.Tuple.Unit# 1 :: GHC.Tuple.Unit# GHC.Integer.Type.Integer
+SigE (AppE (ConE GHC.Tuple.Solo#) (LitE (IntegerL 1))) (AppT (ConT GHC.Tuple.Solo#) (ConT GHC.Integer.Type.Integer))
+GHC.Tuple.Solo# 1 :: GHC.Tuple.Solo# GHC.Integer.Type.Integer
diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index ec5e1bf229..9f4422909f 100644
--- a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ -90,7 +90,7 @@ holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
Nothing :: forall a. Maybe a
Just :: forall a. a -> Maybe a
[] :: forall a. [a]
- Unit :: forall a. a -> Unit a
+ Solo :: forall a. a -> Solo a
asTypeOf :: forall a. a -> a -> a
id :: forall a. a -> a
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
diff --git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr
index fa9590663b..fe6aaf391e 100644
--- a/testsuite/tests/typecheck/should_compile/holes3.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes3.stderr
@@ -93,7 +93,7 @@ holes3.hs:11:15: error:
Nothing :: forall a. Maybe a
Just :: forall a. a -> Maybe a
[] :: forall a. [a]
- Unit :: forall a. a -> Unit a
+ Solo :: forall a. a -> Solo a
asTypeOf :: forall a. a -> a -> a
id :: forall a. a -> a
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a