Commit df084681 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski

Always display inferred variables using braces

We now always show "forall {a}. T" for inferred variables,
previously this was controlled by -fprint-explicit-foralls.

This implements part 1 of https://github.com/ghc-proposals/ghc-proposals/pull/179.

Part of GHC ticket #16320.

Furthermore, when printing a levity restriction error, we now display
the HsWrap of the expression. This lets users see the full elaboration with
-fprint-typechecker-elaboration (see also #17670)
parent 6c2585e0
......@@ -758,11 +758,12 @@ positions in the kind of the tycon.
mkLHsWrap :: HsWrapper -> LHsExpr GhcTc -> LHsExpr GhcTc
mkLHsWrap co_fn (L loc e) = L loc (mkHsWrap co_fn e)
-- | Avoid @'HsWrap' co1 ('HsWrap' co2 _)@.
-- | Avoid @'HsWrap' co1 ('HsWrap' co2 _)@ and @'HsWrap' co1 ('HsPar' _ _)@
-- See Note [Detecting forced eta expansion] in "DsExpr"
mkHsWrap :: HsWrapper -> HsExpr GhcTc -> HsExpr GhcTc
mkHsWrap co_fn e | isIdHsWrapper co_fn = e
mkHsWrap co_fn (XExpr (HsWrap co_fn' e)) = mkHsWrap (co_fn <.> co_fn') e
mkHsWrap co_fn (HsPar x (L l e)) = HsPar x (L l (mkHsWrap co_fn e))
mkHsWrap co_fn e = XExpr (HsWrap co_fn e)
mkHsWrapCo :: TcCoercionN -- A Nominal coercion a ~N b
......
......@@ -1102,10 +1102,7 @@ pprIfaceForAllBndr :: IfaceForAllBndr -> SDoc
pprIfaceForAllBndr bndr =
case bndr of
Bndr (IfaceTvBndr tv) Inferred ->
sdocWithDynFlags $ \dflags ->
if gopt Opt_PrintExplicitForalls dflags
then braces $ pprIfaceTvBndr tv suppress_sig (UseBndrParens False)
else pprIfaceTvBndr tv suppress_sig (UseBndrParens True)
braces $ pprIfaceTvBndr tv suppress_sig (UseBndrParens False)
Bndr (IfaceTvBndr tv) _ ->
pprIfaceTvBndr tv suppress_sig (UseBndrParens True)
Bndr (IfaceIdBndr idv) _ -> pprIfaceIdBndr idv
......
This diff is collapsed.
......@@ -815,10 +815,8 @@ See also Note [Required, Specified, and Inferred for types] in TcTyClsDecls
Specified: a list of Specified binders is written between `forall` and `.`:
const :: forall a b. a -> b -> a
Inferred: with -fprint-explicit-foralls, Inferred binders are written
in braces:
Inferred: like Specified, but every binder is written in braces:
f :: forall {k} (a:k). S k a -> Int
Otherwise, they are printed like Specified binders.
Required: binders are put between `forall` and `->`:
T :: forall k -> *
......
......@@ -152,8 +152,7 @@ Note that ``k2`` is placed *before* ``k``, and that ``k`` is placed *before*
type and kind variables that GHC generalises
over, but not written in the original program, are not available for visible
type application. (These are called *inferred* variables.)
Such variables are written in braces with
:ghc-flag:`-fprint-explicit-foralls` enabled.
Such variables are written in braces.
The general principle is this:
......
......@@ -73,9 +73,9 @@ Because ``k`` was not written by the user, it will be unavailable for
type application in the type of the constructor ``Proxy``; only the ``a``
will be available.
When :ghc-flag:`-fprint-explicit-foralls` is enabled, inferred variables
are printed in braces. Thus, the type of the data constructor ``Proxy``
from the previous example would be ``forall {k} (a :: k). Proxy a``.
Inferred variables are printed in braces. Thus, the type of the data
constructor ``Proxy`` from the previous example is
``forall {k} (a :: k). Proxy a``.
We can observe this behavior in a GHCi session: ::
> :set -XTypeApplications -fprint-explicit-foralls
......
......@@ -771,9 +771,6 @@ messages and in GHCi:
(a Data.Type.Equality.:~: b) -> b Data.Type.Equality.:~: a
-- Defined in Data.Type.Equality
This flag also enables the printing of *inferred* type variables
inside braces. See :ref:`inferred-vs-specified`.
.. ghc-flag:: -fprint-explicit-kinds
:shortdesc: Print explicit kind foralls and kind arguments in types.
See also :extension:`KindSignatures`
......
......@@ -8,37 +8,37 @@ TYPE SIGNATURES
test1c ::
forall (f :: * -> *). Applicative f => (Int -> f Int) -> f Int
test2 ::
forall (f :: * -> *) t b.
forall {f :: * -> *} {t} {b}.
(Applicative f, Num t, Num b) =>
(t -> f b) -> f b
test2a ::
forall (f :: * -> *) t b.
forall {f :: * -> *} {t} {b}.
(Functor f, Num t, Num b) =>
(t -> f b) -> f b
test2b ::
forall (m :: * -> *) t a. (Monad m, Num t) => (t -> a) -> m a
forall {m :: * -> *} {t} {a}. (Monad m, Num t) => (t -> a) -> m a
test2c ::
forall (f :: * -> *) t b.
forall {f :: * -> *} {t} {b}.
(Functor f, Num t, Num b) =>
(t -> f b) -> f b
test2d ::
forall (f :: * -> *) t1 b t2.
forall {f :: * -> *} {t1} {b} {t2}.
(Functor f, Num t1, Num b) =>
(t1 -> f t2) -> f b
test3 ::
forall (m :: * -> *) t1 t2 a.
forall {m :: * -> *} {t1} {t2} {a}.
(Monad m, Num t1) =>
(t1 -> m t2) -> (t2 -> t2 -> m a) -> m a
test4 ::
forall (m :: * -> *) t a1 a2.
forall {m :: * -> *} {t} {a1} {a2}.
(Monad m, Num t) =>
(t -> m a1) -> (a1 -> a1 -> m a2) -> m a2
test5 ::
forall (m :: * -> *) t a1 a2.
forall {m :: * -> *} {t} {a1} {a2}.
(Monad m, Num t) =>
(t -> m a1) -> (a1 -> a1 -> m a2) -> m a2
test6 ::
forall (m :: * -> *) a p.
forall {m :: * -> *} {a} {p}.
(Monad m, Num (m a)) =>
(m a -> m (m a)) -> p -> m a
Dependent modules: []
......
T13233.hs:14:11: error:
Cannot use function with levity-polymorphic arguments:
GHC.Prim.(#,#) :: a -> a -> (# a, a #)
(#,#) :: a -> a -> (# a, a #)
(Note that levity-polymorphic primops such as 'coerce' and unboxed tuples
are eta-expanded internally because they must occur fully saturated.
Use -fprint-typechecker-elaboration to display the full expression.)
Levity-polymorphic arguments:
a :: TYPE rep
a :: TYPE rep
T13233.hs:22:16: error:
Cannot use function with levity-polymorphic arguments:
GHC.Prim.(#,#) :: forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep)
(a :: TYPE rep1) (b :: TYPE rep2).
a -> b -> (# a, b #)
(#,#) :: forall {rep1 :: RuntimeRep} {rep2 :: RuntimeRep}
{a :: TYPE rep1} {b :: TYPE rep2}.
a -> b -> (# a, b #)
(Note that levity-polymorphic primops such as 'coerce' and unboxed tuples
are eta-expanded internally because they must occur fully saturated.
Use -fprint-typechecker-elaboration to display the full expression.)
Levity-polymorphic arguments:
a :: TYPE rep1
b :: TYPE rep2
-- Same as T13233, but we compile with -fprint-typechecker-elaboration.
-- The error message should show an eta-expanded call to (#,#).
-- See comments at https://gitlab.haskell.org/ghc/ghc/merge_requests/2540
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MagicHash #-}
module Bug where
import GHC.Exts (TYPE, RuntimeRep, Weak#, State#, RealWorld, mkWeak# )
class Foo (a :: TYPE rep) where
bar :: forall rep2 (b :: TYPE rep2). (a -> a -> b) -> a -> a -> b
baz :: forall rep (a :: TYPE rep). Foo a => a -> a -> (# a, a #)
baz = bar (#,#)
obscure :: (forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep)
(a :: TYPE rep1) (b :: TYPE rep2).
a -> b -> (# a, b #)) -> ()
obscure _ = ()
quux :: ()
quux = obscure (#,#)
-- It used to be that primops has no binding. However, as described in
-- Note [Primop wrappers] in PrimOp we now rewrite unsaturated primop
-- applications to their wrapper, which allows safe use of levity polymorphism.
primop :: forall (rep :: RuntimeRep) (a :: TYPE rep) b c.
a -> b -> (State# RealWorld -> (# State# RealWorld, c #))
-> State# RealWorld -> (# State# RealWorld, Weak# b #)
primop = mkWeak#
T13233_elab.hs:17:11: error:
Cannot use function with levity-polymorphic arguments:
(#,#) @rep @rep @a @a :: a -> a -> (# a, a #)
Levity-polymorphic arguments:
a :: TYPE rep
a :: TYPE rep
T13233_elab.hs:25:16: error:
Cannot use function with levity-polymorphic arguments:
/\(@(rep1 :: RuntimeRep)).
/\(@(rep2 :: RuntimeRep)).
/\(@(a :: TYPE rep1)).
/\(@(b :: TYPE rep2)).
(#,#) @rep1 @rep2 @a @b :: forall {rep1 :: RuntimeRep}
{rep2 :: RuntimeRep} {a :: TYPE rep1} {b :: TYPE rep2}.
a -> b -> (# a, b #)
Levity-polymorphic arguments:
a :: TYPE rep1
b :: TYPE rep2
......@@ -4,3 +4,4 @@
# memcpy operations
test('T8131', [cmm_src, only_ways(llvm_ways)], compile_fail, [''])
test('T13233', normal, compile_fail, [''])
test('T13233_elab', normal, compile_fail, ['-fprint-typechecker-elaboration'])
T14066a.hs:13:3: warning:
Type family instance equation is overlapped:
forall c d (x :: c) (y :: d).
forall {c} {d} {x :: c} {y :: d}.
Bar x y = Bool -- Defined at T14066a.hs:13:3
TYPE SIGNATURES
x :: forall (x :: Bool). P (F Int) (x |> Sym (T14729.D:R:FInt[0]))
y :: forall (x :: Bool). P Bool x
y :: forall {x :: Bool}. P Bool x
TYPE CONSTRUCTORS
type family F{1} :: * -> *
roles nominal
......
BadTelescope4.hs:9:1: error:
• The kind of ‘Bad’ is ill-scoped
Inferred kind: Bad :: forall k (b :: Proxy a). forall (a :: k) ->
Inferred kind: Bad :: forall {k} (b :: Proxy a). forall (a :: k) ->
Proxy b -> forall (d :: Proxy a) -> SameKind b d -> *
NB: Inferred variables
(namely: k) always come first
......
......@@ -15,7 +15,7 @@ T14066d.hs:11:35: error:
In the expression: g y
In the expression: (fstOf3 y :: Proxy Maybe, g y)
• Relevant bindings include
y :: forall k1 k2 (a :: k1) (c :: k2). (Proxy a, Proxy c, b)
y :: forall {k1} {k2} (a :: k1) (c :: k2). (Proxy a, Proxy c, b)
(bound at T14066d.hs:15:5)
x :: b (bound at T14066d.hs:11:3)
f :: b -> (Proxy Maybe, ()) (bound at T14066d.hs:11:1)
......@@ -3,7 +3,7 @@ T14066e.hs:13:59: error:
• Couldn't match kind ‘k’ with ‘*’
‘k’ is a rigid type variable bound by
the type signature for:
j :: forall k k1 (c :: k) (b :: k1).
j :: forall {k} {k1} (c :: k) (b :: k1).
Proxy a -> Proxy b -> Proxy c -> Proxy b
at T14066e.hs:12:5-61
When matching kinds
......
T15591b.hs:9:3: error:
• The kind of ‘T4’ is ill-scoped
Inferred kind: T4 :: forall (b :: Proxy a). forall a ->
Inferred kind: T4 :: forall {b :: Proxy a}. forall a ->
Proxy b -> *
NB: Inferred variables (namely: (b :: Proxy a)) always come first
Perhaps try this order instead: a (b :: Proxy a) (c :: Proxy b)
......
T15591c.hs:9:3: error:
• The kind of ‘T5’ is ill-scoped
Inferred kind: T5 :: forall (b :: Proxy a).
Inferred kind: T5 :: forall {b :: Proxy a}.
Proxy b -> forall a -> *
NB: Inferred variables (namely: (b :: Proxy a)) always come first
Perhaps try this order instead: a (b :: Proxy a) (c :: Proxy b)
......
T15743c.hs:10:1: error:
• The kind of ‘T’ is ill-scoped
Inferred kind: T :: forall (d :: k).
Inferred kind: T :: forall {d :: k}.
forall k (c :: k) (a :: Proxy c) (b :: Proxy d) ->
SimilarKind a b -> *
NB: Inferred variables (namely: (d :: k)) always come first
......
[1 of 1] Compiling A ( A.hs, A.o )
TYPE SIGNATURES
test2 ::
forall (f :: * -> *) t b.
forall {f :: * -> *} {t} {b}.
(Applicative f, Num t, Num b) =>
(t -> f b) -> f b
Dependent modules: []
......@@ -10,7 +10,7 @@ Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
[1 of 1] Compiling A ( A.hs, A.o )
TYPE SIGNATURES
test2 ::
forall (f :: * -> *) t b.
forall {f :: * -> *} {t} {b}.
(Applicative f, Num t, Num b) =>
(t -> f b) -> f b
Dependent modules: []
......
......@@ -3,4 +3,4 @@
• Non type-variable argument in the constraint: HasField "name" r a
(Use FlexibleContexts to permit this)
• When checking the inferred type
foo :: forall r a. HasField "name" r a => r -> a
foo :: forall {r} {a}. HasField "name" r a => r -> a
......@@ -4,4 +4,4 @@
in the constraint: Num (t2 -> t1 -> t3)
(Use FlexibleContexts to permit this)
• When checking the inferred type
it :: forall t1 t2 t3. (Num t1, Num (t2 -> t1 -> t3)) => t3
it :: forall {t1} {t2} {t3}. (Num t1, Num (t2 -> t1 -> t3)) => t3
type role Foo1 phantom
type Foo1 :: forall k. k -> *
data Foo1 a where
MkFoo1a :: forall k (a :: k). Proxy a -> Int -> Foo1 a
MkFoo1b :: forall k (a :: k). {a :: Proxy a, b :: Int} -> Foo1 a
MkFoo1a :: forall {k} (a :: k). Proxy a -> Int -> Foo1 a
MkFoo1b :: forall {k} (a :: k). {a :: Proxy a, b :: Int} -> Foo1 a
-- Defined at T16030.hs:8:1
type Foo2 :: forall k. k -> *
data family Foo2 a
-- Defined at T16030.hs:12:1
data instance forall k (a :: k). Foo2 a where
MkFoo2a :: forall k (a :: k). Proxy a -> Int -> Foo2 a
MkFoo2b :: forall k (a :: k). {c :: Proxy a, d :: Int} -> Foo2 a
MkFoo2a :: forall {k} (a :: k). Proxy a -> Int -> Foo2 a
MkFoo2b :: forall {k} (a :: k). {c :: Proxy a, d :: Int} -> Foo2 a
-- Defined at T16030.hs:13:15
type role Foo1 nominal phantom
type Foo1 :: forall k. k -> *
data Foo1 @k a where
MkFoo1a :: forall k (a :: k). Proxy @{k} a -> Int -> Foo1 @k a
MkFoo1b :: forall k (a :: k).
MkFoo1a :: forall {k} (a :: k). Proxy @{k} a -> Int -> Foo1 @k a
MkFoo1b :: forall {k} (a :: k).
{a :: Proxy @{k} a, b :: Int} -> Foo1 @k a
-- Defined at T16030.hs:8:1
type Foo2 :: forall k. k -> *
data family Foo2 @k a
-- Defined at T16030.hs:12:1
data instance forall k (a :: k). Foo2 @k a where
MkFoo2a :: forall k (a :: k). Proxy @{k} a -> Int -> Foo2 @k a
MkFoo2b :: forall k (a :: k).
MkFoo2a :: forall {k} (a :: k). Proxy @{k} a -> Int -> Foo2 @k a
MkFoo2b :: forall {k} (a :: k).
{c :: Proxy @{k} a, d :: Int} -> Foo2 @k a
-- Defined at T16030.hs:13:15
......@@ -6,7 +6,7 @@ Collecting type info for 3 module(s) ...
% ^~~~~~^
>
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":uses T16804a.hs 1 8 1 14"
% file snippet:
......@@ -22,7 +22,7 @@ undefined :: forall a. a
% ^~~^
>
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 3 8 3 18 undefined"
% file snippet:
......@@ -31,7 +31,7 @@ undefined :: forall a. a
% ^~~~~~~~~~^
>
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 3 13 3 18 undefined"
% file snippet:
......@@ -40,7 +40,7 @@ undefined :: forall a. a
% ^~~~~^
>
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":uses T16804a.hs 3 8 3 11"
% file snippet:
......@@ -73,7 +73,7 @@ undefined :: forall a. a
% ^~~^
> deriving (Show)
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 13 5 13 undefined"
% file snippet:
......@@ -82,7 +82,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 15 5 15 undefined"
% file snippet:
......@@ -91,7 +91,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 5 17 5 17 undefined"
% file snippet:
......@@ -100,7 +100,7 @@ undefined :: forall a. a
% ^
> deriving (Show)
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 6 13 6 16 undefined"
% file snippet:
......@@ -160,7 +160,7 @@ T16804a.hs:(6,13)-(6,16)
% ^~~~~^
> mempty = A
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 7 17 7 20 undefined"
% file snippet:
......@@ -169,7 +169,7 @@ undefined :: forall a. a
% ^~~^
> mempty = A
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 7 10 7 20 undefined"
% file snippet:
......@@ -249,7 +249,7 @@ T16804a.hs:(8,3)-(8,8)
% ^~~~~~~~~~~^
> testFunction A B = True
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 13 1 13 12 undefined"
% file snippet:
......@@ -566,7 +566,7 @@ undefined :: Test
> B <> _ = B
% ^^
% output:
undefined :: forall a. a
undefined :: forall {a}. a
% executing: ":type-at T16804a.hs 29 8 29 8 undefined"
% file snippet:
......
......@@ -59,7 +59,7 @@
Type family equation violates the family's injectivity annotation.
Type/kind variable ‘k’ cannot be inferred from the right-hand side.
In the type family equation:
forall k (a :: k) (b :: k).
forall {k} {a :: k} {b :: k}.
Fc @k a b = Int -- Defined at <interactive>:64:15
<interactive>:68:15: error:
......@@ -67,7 +67,7 @@
Type/kind variables ‘k’, ‘a’, ‘b’
cannot be inferred from the right-hand side.
In the type family equation:
forall k (a :: k) (b :: k).
forall {k} {a :: k} {b :: k}.
Gc @k a b = Int -- Defined at <interactive>:68:15
<interactive>:81:15: error:
......
type role A phantom phantom
type A :: forall k k1. k -> k1 -> *
type A :: forall {k} {k1}. k -> k1 -> *
data A x y
-- Defined at <interactive>:2:1
A :: k1 -> k2 -> *
type role T phantom
type T :: forall k. k -> *
type T :: forall {k}. k -> *
data T a = forall a1. MkT a1
-- Defined at <interactive>:6:1
type D2 :: *
data D2
= forall k. MkD2 (forall (p :: k -> *) (a :: k). p a -> Int)
= forall {k}. MkD2 (forall (p :: k -> *) (a :: k). p a -> Int)
-- Defined at <interactive>:3:1
type D3 :: *
data D3 = MkD3 (forall k (p :: k -> *) (a :: k). p a -> Int)
......
type Foo :: forall k. k -> Constraint
type Foo :: forall {k}. k -> Constraint
class Foo a where
type Bar :: forall k. k -> * -> *
type Bar :: forall {k}. k -> * -> *
type family Bar a b
-- Defined at T7939.hs:6:4
Bar :: k -> * -> *
......@@ -19,13 +19,13 @@ type family H a where
H 'False = 'True
-- Defined at T7939.hs:14:1
H :: Bool -> Bool
type J :: forall k. [k] -> Bool
type J :: forall {k}. [k] -> Bool
type family J a where
J '[] = 'False
forall k (h :: k) (t :: [k]). J (h : t) = 'True
-- Defined at T7939.hs:17:1
J :: [k] -> Bool
type K :: forall a. [a] -> Maybe a
type K :: forall {a}. [a] -> Maybe a
type family K a1 where
K '[] = 'Nothing
forall a (h :: a) (t :: [a]). K (h : t) = 'Just h
......
f :: forall k1 k2 (a :: k1 -> k2 -> *) (b :: k1) (c :: k2).
f :: forall {k1} {k2} {a :: k1 -> k2 -> *} {b :: k1} {c :: k2}.
C a =>
a b c
......@@ -6,7 +6,7 @@ COERCION AXIOMS
forall k1 k2 (j :: k1) (c :: k2).
DF (Proxy c) = T15852.R:DFProxyProxy k1 k2 j c
FAMILY INSTANCES
data instance forall k1 k2 (j :: k1) (c :: k2).
data instance forall {k1} {k2} {j :: k1} {c :: k2}.
DF (Proxy c) -- Defined at T15852.hs:10:15
Dependent modules: []
Dependent packages: [base-4.14.0.0, ghc-prim-0.6.1,
......
......@@ -3,7 +3,9 @@ TYPE SIGNATURES
emptyL :: forall a. ListColl a
insert :: forall c. Coll c => Elem c -> c -> c
test2 ::
forall c a b. (Coll c, Num a, Num b, Elem c ~ (a, b)) => c -> c
forall {c} {a} {b}.
(Coll c, Num a, Num b, Elem c ~ (a, b)) =>
c -> c
TYPE CONSTRUCTORS
class Coll{1} :: * -> Constraint
associated type family Elem{1} :: * -> *
......
T15764.hs:14:2: error:
• The kind of ‘T6’ is ill-scoped
Inferred kind: T6 :: forall (a :: k) k (b :: Proxy a).
Inferred kind: T6 :: forall {a :: k} k (b :: Proxy a).
Proxy '(k, b) -> *
NB: Inferred variables
(namely: (a :: k)) always come first
......
......@@ -8,6 +8,6 @@ T1897b.hs:16:1: error:
• In the ambiguity check for the inferred type for ‘isValid’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type
isValid :: forall (t :: * -> *) a.
isValid :: forall {t :: * -> *} {a}.
(Foldable t, Bug a) =>
t (Depend a) -> Bool
TYPE SIGNATURES
bravo :: forall _. Num _ => _
bravo :: forall {_}. Num _ => _
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
bravo :: forall _. Num _ => _
bravo :: forall {_}. Num _ => _
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
barry :: forall _. _ -> (Either [Char] _, Either [Char] _)
barry :: forall {_}. _ -> (Either [Char] _, Either [Char] _)
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
every :: forall t. (t -> Bool) -> [t] -> Bool
every :: forall {t}. (t -> Bool) -> [t] -> Bool
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
every :: forall _. (_ -> Bool) -> [_] -> Bool
every :: forall {_}. (_ -> Bool) -> [_] -> Bool
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
isMeltdown :: forall param1 param2. NukeMonad param1 param2 Bool
unlessMeltdown ::
forall param1 param2.
forall {param1} {param2}.
NukeMonad param1 param2 () -> NukeMonad param1 param2 ()
TYPE CONSTRUCTORS
data type NukeMonad{3} :: * -> * -> * -> *
......
TYPE SIGNATURES
foo :: forall a. a -> a
foo :: forall {a}. a -> a
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
showTwo :: forall a. Show a => a -> String
showTwo :: forall {a}. Show a => a -> String
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
bar :: forall _. _ -> Bool
bar :: forall {_}. _ -> Bool
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
skipMany ::
forall tok st a. GenParser tok st a -> GenParser tok st ()
forall {tok} {st} {a}. GenParser tok st a -> GenParser tok st ()
skipMany' ::
forall tok st a. GenParser tok st a -> GenParser tok st ()
TYPE CONSTRUCTORS
......
TYPE SIGNATURES
unc :: forall _1 _2 _3. (_1 -> _2 -> _3) -> (_1, _2) -> _3
unc :: forall {_1} {_2} {_3}. (_1 -> _2 -> _3) -> (_1, _2) -> _3
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
unc :: forall a b _. (a -> b -> _) -> (a, b) -> _
unc :: forall {a} {b} {_}. (a -> b -> _) -> (a, b) -> _
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
TYPE SIGNATURES
bar :: forall t _. t -> (t -> _) -> _
foo :: forall a. (Show a, Enum a) => a -> String
bar :: forall {t} {_}. t -> (t -> _) -> _
foo :: forall {a}. (Show a, Enum a) => a -> String
Dependent modules: []
Dependent packages: [base-4.13.0.0, ghc-prim-0.6.1,
integer-gmp-1.0.2.0]
......
......@@ -3,9 +3,9 @@ NamedExtraConstraintsWildcard.hs:5:1: error:
• Could not deduce: _0
from the context: (Eq a, _)
bound by the inferred type for ‘foo’:
forall a (_ :: Constraint). (Eq a, _) => a -> a
forall a {_ :: Constraint}. (Eq a, _) => a -> a
at NamedExtraConstraintsWildcard.hs:5:1-15
• In the ambiguity check for the inferred type for ‘foo’
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
When checking the inferred type
foo :: forall a (_ :: Constraint). (Eq a, _) => a -> a
foo :: forall a {_ :: Constraint}. (Eq a, _) => a -> a
......@@ -3,10 +3,10 @@ NamedWildcardsNotInMonotype.hs:5:1: error:
• Could not deduce (Eq _0)
from the context: (Show a, Eq _, Eq a)
bound by the inferred type for ‘foo’:
forall a _. (Show a, Eq _, Eq a) =>