Commit 9e86bf1b authored by Simon Peyton Jones's avatar Simon Peyton Jones

Better type wildcard errors

Adopts sugggestion in Trac #10224, comment:3
parent 0a3c43fe
......@@ -697,9 +697,9 @@ mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })
| isOutOfScopeCt ct
= do { dflags <- getDynFlags
; rdr_env <- getGlobalRdrEnv
; mkLongErrAt (RealSrcSpan (tcl_loc lcl_env)) var_msg
; mkLongErrAt (RealSrcSpan (tcl_loc lcl_env)) out_of_scope_msg
(unknownNameSuggestions dflags rdr_env
(tcl_rdr lcl_env) (mkRdrUnqual occ)) }
(tcl_rdr lcl_env) (mkRdrUnqual occ)) }
| otherwise
= do { (ctxt, binds_doc, ct) <- relevantBindings False ctxt ct
......@@ -707,37 +707,41 @@ mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort })
; mkErrorMsgFromCt ctxt ct (hole_msg $$ binds_doc) }
where
ct_loc = ctLoc ct
lcl_env = ctLocEnv ct_loc
var_msg = hang herald -- Print v :: ty only if the type has structure
2 (if boring_type
then ppr occ
else pp_with_type)
ct_loc = ctLoc ct
lcl_env = ctLocEnv ct_loc
hole_ty = ctEvPred (ctEvidence ct)
tyvars = varSetElems (tyVarsOfType hole_ty)
boring_type = isTyVarTy hole_ty
hole_msg = vcat [ hang (ptext (sLit "Found hole:"))
2 pp_with_type
, tyvars_msg, hint ]
out_of_scope_msg -- Print v :: ty only if the type has structure
| boring_type = hang herald 2 (ppr occ)
| otherwise = hang herald 2 pp_with_type
pp_with_type = hang (pprPrefixOcc occ) 2 (dcolon <+> pprType hole_ty)
herald | isDataOcc occ = ptext (sLit "Data constructor not in scope:")
| otherwise = ptext (sLit "Variable not in scope:")
hole_ty = ctEvPred (ctEvidence ct)
tyvars = varSetElems (tyVarsOfType hole_ty)
hole_msg = case hole_sort of
ExprHole -> vcat [ hang (ptext (sLit "Found hole:"))
2 pp_with_type
, tyvars_msg, expr_hole_hint ]
TypeHole -> vcat [ hang (ptext (sLit "Found type wildcard") <+> quotes (ppr occ))
2 (ptext (sLit "standing for") <+> quotes (pprType hole_ty))
, tyvars_msg, type_hole_hint ]
tyvars_msg = ppUnless (null tyvars) $
ptext (sLit "Where:") <+> vcat (map loc_msg tyvars)
boring_type = isTyVarTy hole_ty
hint | TypeHole <- hole_sort
, HoleError <- cec_type_holes ctxt
type_hole_hint
| HoleError <- cec_type_holes ctxt
= ptext (sLit "To use the inferred type, enable PartialTypeSignatures")
| otherwise
= empty
| ExprHole <- hole_sort -- Give hint for, say, f x = _x
, lengthFS (occNameFS occ) > 1 -- Don't give this hint for plain "_"
expr_hole_hint -- Give hint for, say, f x = _x
| lengthFS (occNameFS occ) > 1 -- Don't give this hint for plain "_"
= ptext (sLit "Or perhaps") <+> quotes (ppr occ)
<+> ptext (sLit "is mis-spelled, or not in scope")
| otherwise
= empty
......
T10403.hs:15:7: warning:
Found hole ‘_’ with inferred constraints: Functor f
In the type signature for ‘h1’: _ => _
T10403.hs:15:12: warning:
Found hole: _ :: (a -> b) -> f a -> H f
Where: ‘f’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
‘b’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
‘a’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
In the type signature for ‘h1’: _ => _
T10403.hs:19:7: warning:
Found hole: _ :: (a -> b) -> f a -> H f
Where: ‘f’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
‘b’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
‘a’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
In the type signature for ‘h2’: _
T10403.hs:21:1: warning:
No instance for (Functor f)
When checking that ‘h2’ has the inferred type
h2 :: forall (f :: * -> *) b a. (a -> b) -> f a -> H f
Probable cause: the inferred type is ambiguous
T10403.hs:15:7: warning:
Found hole ‘_’ with inferred constraints: Functor f
In the type signature for ‘h1’: _ => _
T10403.hs:15:12: warning:
Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’
Where: ‘f’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
‘b’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
‘a’ is a rigid type variable bound by
the inferred type of h1 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:17:1
In the type signature for ‘h1’: _ => _
T10403.hs:19:7: warning:
Found type wildcard ‘_’ standing for ‘(a -> b) -> f a -> H f’
Where: ‘f’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
‘b’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
‘a’ is a rigid type variable bound by
the inferred type of h2 :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:21:1
In the type signature for ‘h2’: _
T10403.hs:21:1: warning:
No instance for (Functor f)
When checking that ‘h2’ has the inferred type
h2 :: forall (f :: * -> *) b a. (a -> b) -> f a -> H f
Probable cause: the inferred type is ambiguous
T10438.hs:7:22: warning:
Found hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of g :: w_1 -> w_1 at T10438.hs:6:9
Relevant bindings include
r :: w_1 (bound at T10438.hs:6:11)
g :: w_1 -> w_1 (bound at T10438.hs:6:9)
f :: t (bound at T10438.hs:5:5)
foo :: t -> w_ -> w_ (bound at T10438.hs:5:1)
In the type signature for ‘x’: _
In an equation for ‘g’:
g r
= x
where
x :: _
x = r
In an equation for ‘foo’:
foo f
= g
where
g r
= x
where
x :: _
x = r
T10438.hs:7:22: warning:
Found type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of g :: w_1 -> w_1 at T10438.hs:6:9
Relevant bindings include
r :: w_1 (bound at T10438.hs:6:11)
g :: w_1 -> w_1 (bound at T10438.hs:6:9)
f :: t (bound at T10438.hs:5:5)
foo :: t -> w_ -> w_ (bound at T10438.hs:5:1)
In the type signature for ‘x’: _
In an equation for ‘g’:
g r
= x
where
x :: _
x = r
In an equation for ‘foo’:
foo f
= g
where
g r
= x
where
x :: _
x = r
TYPE SIGNATURES
bar :: forall w_ w_1. w_ -> (w_ -> w_1) -> w_1
foo :: forall w_a. (Show w_a, Enum w_a) => w_a -> String
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base-4.8.2.0, ghc-prim-0.4.0.0,
integer-gmp-1.0.0.0]
WarningWildcardInstantiations.hs:5:14: warning:
Found hole: _a :: w_a
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a -> String
at WarningWildcardInstantiations.hs:6:1
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:5:18: warning:
Found hole ‘_’ with inferred constraints: Enum w_a
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:5:30: warning:
Found hole: _ :: String
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:8:8: warning:
Found hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
WarningWildcardInstantiations.hs:8:13: warning:
Found hole: _ :: w_ -> w_1
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
WarningWildcardInstantiations.hs:8:18: warning:
Found hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
TYPE SIGNATURES
bar :: forall w_ w_1. w_ -> (w_ -> w_1) -> w_1
foo :: forall w_a. (Show w_a, Enum w_a) => w_a -> String
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
Dependent packages: [base-4.8.2.0, ghc-prim-0.4.0.0,
integer-gmp-1.0.0.0]
WarningWildcardInstantiations.hs:5:14: warning:
Found type wildcard ‘_a’ standing for ‘w_a’
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a -> String
at WarningWildcardInstantiations.hs:6:1
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:5:18: warning:
Found hole ‘_’ with inferred constraints: Enum w_a
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:5:30: warning:
Found type wildcard ‘_’ standing for ‘String’
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WarningWildcardInstantiations.hs:8:8: warning:
Found type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
WarningWildcardInstantiations.hs:8:13: warning:
Found type wildcard ‘_’ standing for ‘w_ -> w_1’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
WarningWildcardInstantiations.hs:8:18: warning:
Found type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WarningWildcardInstantiations.hs:9:1
In the type signature for ‘bar’: _ -> _ -> _
InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
Found hole: _a :: b
Where: ‘b’ is a rigid type variable bound by
the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
at InstantiatedNamedWildcardsInConstraints.hs:4:8
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a -> (String, b)
InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
Found hole ‘_’ with inferred constraints: Show b
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a -> (String, b)
InstantiatedNamedWildcardsInConstraints.hs:4:14: error:
Found type wildcard ‘_a’ standing for ‘b’
Where: ‘b’ is a rigid type variable bound by
the inferred type of foo :: (Enum b, Show b) => b -> (String, b)
at InstantiatedNamedWildcardsInConstraints.hs:4:8
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a -> (String, b)
InstantiatedNamedWildcardsInConstraints.hs:4:18: error:
Found hole ‘_’ with inferred constraints: Show b
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Enum _a, _) => _a -> (String, b)
NamedWildcardsEnabled.hs:4:8: error:
Found hole: _a :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a -> _b
NamedWildcardsEnabled.hs:4:14: error:
Found hole: _b :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a -> _b
NamedWildcardsEnabled.hs:4:8: error:
Found type wildcard ‘_a’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a -> _b
NamedWildcardsEnabled.hs:4:14: error:
Found type wildcard ‘_b’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _a -> _b
PartialTypeSignaturesDisabled.hs:4:8: error:
Found hole: _ :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ -> _
PartialTypeSignaturesDisabled.hs:4:13: error:
Found hole: _ :: Bool
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ -> _
PartialTypeSignaturesDisabled.hs:4:8: error:
Found type wildcard ‘_’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ -> _
PartialTypeSignaturesDisabled.hs:4:13: error:
Found type wildcard ‘_’ standing for ‘Bool’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: _ -> _
TidyClash.hs:8:19: error:
Found hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_2 -> (w_2, w_ -> w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ -> (w_, _ -> _)
TidyClash.hs:8:24: error:
Found hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_2 -> (w_2, w_ -> w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ -> (w_, _ -> _)
TidyClash.hs:8:19: error:
Found type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_2 -> (w_2, w_ -> w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ -> (w_, _ -> _)
TidyClash.hs:8:24: error:
Found type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_2 -> (w_2, w_ -> w_1)
at TidyClash.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: w_ -> (w_, _ -> _)
Trac10045.hs:6:17: error:
Found hole: _ :: t1 -> a -> t2
Where: ‘t1’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
‘t2’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
‘a’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
ws1 :: () (bound at Trac10045.hs:5:11)
foo :: Meta -> t (bound at Trac10045.hs:5:1)
In the type signature for ‘copy’: _
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:7:9: error:
No instance for (Num a)
When checking that ‘copy’ has the inferred type
copy :: forall t t1 a. t -> a -> t1
Probable cause: the inferred type is ambiguous
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:6:17: error:
Found type wildcard ‘_’ standing for ‘t1 -> a -> t2’
Where: ‘t1’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
‘t2’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
‘a’ is a rigid type variable bound by
the inferred type of copy :: Num a => t1 -> a -> t2
at Trac10045.hs:7:9
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
ws1 :: () (bound at Trac10045.hs:5:11)
foo :: Meta -> t (bound at Trac10045.hs:5:1)
In the type signature for ‘copy’: _
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
Trac10045.hs:7:9: error:
No instance for (Num a)
When checking that ‘copy’ has the inferred type
copy :: forall t t1 a. t -> a -> t1
Probable cause: the inferred type is ambiguous
In the expression:
let
copy :: _
copy w from = copy w 1
in copy ws1 1
In an equation for ‘foo’:
foo (Meta ws1)
= let
copy :: _
copy w from = copy w 1
in copy ws1 1
WildcardInstantiations.hs:5:14: error:
Found hole: _a :: w_a
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a -> String
at WildcardInstantiations.hs:6:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:5:18: error:
Found hole ‘_’ with inferred constraints: Enum w_a
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:5:30: error:
Found hole: _ :: String
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:8:8: error:
Found hole: _ :: w_
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardInstantiations.hs:8:13: error:
Found hole: _ :: w_ -> w_1
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardInstantiations.hs:8:18: error:
Found hole: _ :: w_1
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardInstantiations.hs:5:14: error:
Found type wildcard ‘_a’ standing for ‘w_a’
Where: ‘w_a’ is a rigid type variable bound by
the inferred type of foo :: (Enum w_a, Show w_a) => w_a -> String
at WildcardInstantiations.hs:6:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:5:18: error:
Found hole ‘_’ with inferred constraints: Enum w_a
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:5:30: error:
Found type wildcard ‘_’ standing for ‘String’
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘foo’: (Show _a, _) => _a -> _
WildcardInstantiations.hs:8:8: error:
Found type wildcard ‘_’ standing for ‘w_’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardInstantiations.hs:8:13: error:
Found type wildcard ‘_’ standing for ‘w_ -> w_1’
Where: ‘w_’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardInstantiations.hs:8:18: error:
Found type wildcard ‘_’ standing for ‘w_1’
Where: ‘w_1’ is a rigid type variable bound by
the inferred type of bar :: w_ -> (w_ -> w_1) -> w_1
at WildcardInstantiations.hs:9:1
To use the inferred type, enable PartialTypeSignatures
In the type signature for ‘bar’: _ -> _ -> _
WildcardsInPatternAndExprSig.hs:4:18: error:
Found hole: _a :: w_c
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] -> w_c -> [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] -> w_c -> [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _a
In the pattern: x :: _a
In the pattern: [x :: _a]
WildcardsInPatternAndExprSig.hs:4:25: error:
Found hole: _ :: [w_c]
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] -> w_c -> [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] -> w_c -> [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: _
In the pattern: [x :: _a] :: _
In the pattern: Just ([x :: _a] :: _)
WildcardsInPatternAndExprSig.hs:4:38: error:
Found hole: _b :: w_c
Where: ‘w_c’ is a rigid type variable bound by
the inferred type of bar :: Maybe [w_c] -> w_c -> [w_c]
at WildcardsInPatternAndExprSig.hs:4:1
To use the inferred type, enable PartialTypeSignatures
Relevant bindings include
bar :: Maybe [w_c] -> w_c -> [w_c]
(bound at WildcardsInPatternAndExprSig.hs:4:1)
In a pattern type signature: Maybe [_b]
In the pattern: Just ([x :: _a] :: _) :: Maybe [_b]
In an equation for ‘bar’:
bar (Just ([x :: _a] :: _) :: Maybe [_b]) (z :: _c)
= [x, z] :: [_d]
WildcardsInPatternAndExprSig.hs:4:49: error:
Found hole: _c :: w_c
Where: ‘w_c’ is a rigid type variable bound by