Commit 5879d5aa authored by Simon Peyton Jones's avatar Simon Peyton Jones

Report arity errors correctly despite kinds

Trac #10516 pointed out that when reporting arity errors
(like "T needs 2 arguments but has been given 1"), we should
not count kind arguments, since they are implicit.  If we
include kind args in the count, we get very confusing error
messages indeed.

I did a little bit of refactoring which make some
error messages wobble around.  But the payload of
this fix is in TcValidity.tyConArityErr
parent 023a0ba9
......@@ -989,7 +989,7 @@ tcConArgs :: ConLike -> [TcSigmaType]
tcConArgs con_like arg_tys (PrefixCon arg_pats) penv thing_inside
= do { checkTc (con_arity == no_of_args) -- Check correct arity
(arityErr "Constructor" con_like con_arity no_of_args)
(arityErr "constructor" con_like con_arity no_of_args)
; let pats_w_tys = zipEqual "tcConArgs" arg_pats arg_tys
; (arg_pats', res) <- tcMultiple tcConArg pats_w_tys
penv thing_inside
......@@ -1000,7 +1000,7 @@ tcConArgs con_like arg_tys (PrefixCon arg_pats) penv thing_inside
tcConArgs con_like arg_tys (InfixCon p1 p2) penv thing_inside
= do { checkTc (con_arity == 2) -- Check correct arity
(arityErr "Constructor" con_like con_arity 2)
(arityErr "constructor" con_like con_arity 2)
; let [arg_ty1,arg_ty2] = arg_tys -- This can't fail after the arity check
; ([p1',p2'], res) <- tcMultiple tcConArg [(p1,arg_ty1),(p2,arg_ty2)]
penv thing_inside
......
......@@ -2305,14 +2305,7 @@ addTyThingCtxt thing
where
name = getName thing
flav = case thing of
ATyCon tc
| isClassTyCon tc -> ptext (sLit "class")
| isTypeFamilyTyCon tc -> ptext (sLit "type family")
| isDataFamilyTyCon tc -> ptext (sLit "data family")
| isTypeSynonymTyCon tc -> ptext (sLit "type")
| isNewTyCon tc -> ptext (sLit "newtype")
| isDataTyCon tc -> ptext (sLit "data")
ATyCon tc -> text (tyConFlavour tc)
_ -> pprTrace "addTyThingCtxt strange" (ppr thing)
Outputable.empty
......
......@@ -23,7 +23,7 @@ import TcSimplify ( simplifyAmbiguityCheck )
import TypeRep
import TcType
import TcMType
import TysWiredIn ( coercibleClass, eqTyConName )
import TysWiredIn ( coercibleClass, eqTyCon )
import PrelNames
import Type
import Unify( tcMatchTyX )
......@@ -439,7 +439,7 @@ check_syn_tc_app :: UserTypeCtxt -> Rank -> KindOrType
-- which must be saturated,
-- but not data families, which need not be saturated
check_syn_tc_app ctxt rank ty tc tys
| tc_arity <= n_args -- Saturated
| tc_arity <= length tys -- Saturated
-- Check that the synonym has enough args
-- This applies equally to open and closed synonyms
-- It's OK to have an *over-applied* type synonym
......@@ -462,11 +462,8 @@ check_syn_tc_app ctxt rank ty tc tys
= mapM_ check_arg tys
| otherwise
= failWithTc (arityErr flavour (tyConName tc) tc_arity n_args)
= failWithTc (tyConArityErr tc tys)
where
flavour | isTypeFamilyTyCon tc = "Type family"
| otherwise = "Type synonym"
n_args = length tys
tc_arity = tyConArity tc
check_arg | isTypeFamilyTyCon tc = check_arg_type ctxt rank
| otherwise = check_mono_type ctxt synArgMonoType
......@@ -642,12 +639,10 @@ check_eq_pred :: DynFlags -> PredType -> [TcType] -> TcM ()
check_eq_pred dflags pred tys
= -- Equational constraints are valid in all contexts if type
-- families are permitted
do { checkTc (n_tys == 3)
(arityErr "Equality constraint" eqTyConName 3 n_tys)
do { checkTc (length tys == 3)
(tyConArityErr eqTyCon tys)
; checkTc (xopt Opt_TypeFamilies dflags || xopt Opt_GADTs dflags)
(eqPredTyErr pred) }
where
n_tys = length tys
check_tuple_pred :: Bool -> DynFlags -> UserTypeCtxt -> PredType -> [PredType] -> TcM ()
check_tuple_pred under_syn dflags ctxt pred ts
......@@ -710,18 +705,15 @@ solved to add+canonicalise another (Foo a) constraint. -}
check_class_pred :: DynFlags -> UserTypeCtxt -> PredType -> Class -> [TcType] -> TcM ()
check_class_pred dflags ctxt pred cls tys
| isIPClass cls
= do { checkTc (arity == n_tys) arity_err
; checkTc (okIPCtxt ctxt) (badIPPred pred) }
= do { check_arity
; checkTc (okIPCtxt ctxt) (badIPPred pred) }
| otherwise
= do { checkTc (arity == n_tys) arity_err
= do { check_arity
; checkTc arg_tys_ok (predTyVarErr pred) }
where
class_name = className cls
arity = classArity cls
n_tys = length tys
arity_err = arityErr "Class" class_name arity n_tys
check_arity = checkTc (classArity cls == length tys)
(tyConArityErr (classTyCon cls) tys)
flexible_contexts = xopt Opt_FlexibleContexts dflags
undecidable_ok = xopt Opt_UndecidableInstances dflags
......@@ -806,9 +798,28 @@ constraintSynErr kind = hang (ptext (sLit "Illegal constraint synonym of kind:")
dupPredWarn :: [[PredType]] -> SDoc
dupPredWarn dups = ptext (sLit "Duplicate constraint(s):") <+> pprWithCommas pprType (map head dups)
tyConArityErr :: TyCon -> [TcType] -> SDoc
-- For type-constructor arity errors, be careful to report
-- the number of /type/ arguments required and supplied,
-- ignoring the /kind/ arguments, which the user does not see.
-- (e.g. Trac #10516)
tyConArityErr tc tks
= arityErr (tyConFlavour tc) (tyConName tc)
tc_type_arity tc_type_args
where
tvs = tyConTyVars tc
kbs :: [Bool] -- True for a Type arg, false for a Kind arg
kbs = map isTypeVar tvs
-- tc_type_arity = number of *type* args expected
-- tc_type_args = number of *type* args encountered
tc_type_arity = count id kbs
tc_type_args = count (id . fst) (kbs `zip` tks)
arityErr :: Outputable a => String -> a -> Int -> Int -> SDoc
arityErr kind name n m
= hsep [ text kind, quotes (ppr name), ptext (sLit "should have"),
arityErr what name n m
= hsep [ ptext (sLit "The") <+> text what, quotes (ppr name), ptext (sLit "should have"),
n_arguments <> comma, text "but has been given",
if m==0 then text "none" else int m]
where
......
......@@ -68,6 +68,7 @@ module TyCon(
tyConArity,
tyConRoles,
tyConParent,
tyConFlavour,
tyConTuple_maybe, tyConClass_maybe,
tyConFamInst_maybe, tyConFamInstSig_maybe, tyConFamilyCoercion_maybe,
synTyConDefn_maybe, synTyConRhs_maybe, famTyConFlav_maybe,
......@@ -1763,6 +1764,24 @@ instance Outputable TyCon where
-- corresponding TyCon, so we add the quote to distinguish it here
ppr tc = pprPromotionQuote tc <> ppr (tyConName tc)
tyConFlavour :: TyCon -> String
tyConFlavour (AlgTyCon { algTcParent = parent, algTcRhs = rhs })
| ClassTyCon _ <- parent = "class"
| otherwise = case rhs of
TupleTyCon { tup_sort = sort }
| isBoxed (tupleSortBoxity sort) -> "tuple"
| otherwise -> "unboxed tuple"
DataTyCon {} -> "data type"
NewTyCon {} -> "newtype"
DataFamilyTyCon {} -> "data family"
AbstractTyCon {} -> "abstract type"
tyConFlavour (FamilyTyCon {}) = "type family"
tyConFlavour (SynonymTyCon {}) = "type synonym"
tyConFlavour (FunTyCon {}) = "built-in type"
tyConFlavour (PrimTyCon {}) = "built-in type"
tyConFlavour (PromotedDataCon {}) = "promoted data constructor"
tyConFlavour (PromotedTyCon {}) = "promoted type constructor"
pprPromotionQuote :: TyCon -> SDoc
pprPromotionQuote (PromotedDataCon {}) = char '\'' -- Quote promoted DataCons
-- in types
......
T3163.hs:8:5:
Illegal polymorphic or qualified type: forall s. s
In the definition of data constructor ‘Unreached’
In the data declaration for ‘Taker’
T3163.hs:8:5: error:
Illegal polymorphic or qualified type: forall s. s
In the definition of data constructor ‘Unreached’
In the data type declaration for ‘Taker’
gadt11.hs:12:3:
Data constructor ‘L2’ returns type ‘T1 Bool’
instead of an instance of its parent type ‘T2 a’
In the definition of data constructor ‘L2’
In the data declaration for ‘T2’
gadt11.hs:12:3: error:
Data constructor ‘L2’ returns type ‘T1 Bool’
instead of an instance of its parent type ‘T2 a’
In the definition of data constructor ‘L2’
In the data type declaration for ‘T2’
gadtSyntaxFail001.hs:8:5:
Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C2’
In the data declaration for ‘Foo’
gadtSyntaxFail001.hs:8:5: error:
Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
gadtSyntaxFail002.hs:8:5:
Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a a
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C2’
In the data declaration for ‘Foo’
gadtSyntaxFail002.hs:8:5: error:
Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a a
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
gadtSyntaxFail003.hs:7:5:
Data constructor ‘C1’ has existential type variables, a context, or a specialised result type
C1 :: forall b a c. a -> Int -> c -> Foo b a
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C1’
In the data declaration for ‘Foo’
gadtSyntaxFail003.hs:7:5: error:
Data constructor ‘C1’ has existential type variables, a context, or a specialised result type
C1 :: forall b a c. a -> Int -> c -> Foo b a
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C1’
In the data type declaration for ‘Foo’
records-fail1.hs:7:1:
Constructors T1 and T4 have a common field ‘x’,
but have different result types
In the data declaration for ‘T’
records-fail1.hs:7:1: error:
Constructors T1 and T4 have a common field ‘x’,
but have different result types
In the data type declaration for ‘T’
<interactive>:5:1:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
ghci057.hs:3:3:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data declaration for ‘T’
ghci057.hs:3:3:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data declaration for ‘T’
<interactive>:5:1: error:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
ghci057.hs:3:3: error:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data type declaration for ‘T’
ghci057.hs:3:3: error:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data type declaration for ‘T’
<interactive>:5:1:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
ghci057.hs:3:3:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data declaration for ‘T’
ghci057.hs:3:3:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data declaration for ‘T’
<interactive>:5:1: error:
Illegal generalised algebraic data declaration for ‘T’
(Use GADTs to allow GADTs)
In the data declaration for ‘T’
ghci057.hs:3:3: error:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data type declaration for ‘T’
ghci057.hs:3:3: error:
Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
(Use ExistentialQuantification or GADTs to allow this)
In the definition of data constructor ‘C’
In the data type declaration for ‘T’
BadSock.hs:30:5:
Type family ‘Readable’ should have 1 argument, but has been given none
In the equations for closed type family ‘Foo’
In the type family declaration for ‘Foo’
BadSock.hs:30:5: error:
The type family ‘Readable’ should have 1 argument, but has been given none
In the equations for closed type family ‘Foo’
In the type family declaration for ‘Foo’
T2157.hs:7:15:
Type synonym ‘S’ should have 2 arguments, but has been given 1
In the type instance declaration for ‘F’
T2157.hs:7:15: error:
The type synonym ‘S’ should have 2 arguments, but has been given 1
In the type instance declaration for ‘F’
T9433.hs:14:6:
Type family ‘Id’ should have 1 argument, but has been given none
T9433.hs:14:6: error:
The type family ‘Id’ should have 1 argument, but has been given none
In the type signature for ‘x’: x :: Map Id [Bool]
mod60.hs:3:4:
Constructor ‘Left’ should have 1 argument, but has been given none
In the pattern: Left
In an equation for ‘f’: f (Left) = error "foo"
mod60.hs:3:4: error:
The constructor ‘Left’ should have 1 argument, but has been given none
In the pattern: Left
In an equation for ‘f’: f (Left) = error "foo"
ParserNoBinaryLiterals2.hs:8:4:
Constructor ‘W#’ should have 1 argument, but has been given 2
In the pattern: W# 0 b0##
In an equation for ‘f’: f (W# 0 b0##) = ()
ParserNoBinaryLiterals2.hs:8:4: error:
The constructor ‘W#’ should have 1 argument, but has been given 2
In the pattern: W# 0 b0##
In an equation for ‘f’: f (W# 0 b0##) = ()
ParserNoBinaryLiterals3.hs:8:4:
Constructor ‘I#’ should have 1 argument, but has been given 2
In the pattern: I# 0 b0#
In an equation for ‘f’: f (I# 0 b0#) = ()
ParserNoBinaryLiterals3.hs:8:4: error:
The constructor ‘I#’ should have 1 argument, but has been given 2
In the pattern: I# 0 b0#
In an equation for ‘f’: f (I# 0 b0#) = ()
{-# LANGUAGE PolyKinds #-}
module T10516 where
type App f a = f a
newtype X f a = X (f a)
f :: f a -> X (App f) a
f = X
T10516.hs:8:6: error:
The type synonym ‘App’ should have 2 arguments, but has been given 1
In the type signature for ‘f’: f :: f a -> X (App f) a
T9222.hs:13:3:
Couldn't match type ‘b0’ with ‘b’
‘b0’ is untouchable
inside the constraints: a ~ '(b0, c0)
bound by the type of the constructor ‘Want’:
(a ~ '(b0, c0)) => Proxy b0
at T9222.hs:13:3
‘b’ is a rigid type variable bound by
the type of the constructor ‘Want’:
((a ~ '(b, c)) => Proxy b) -> Want a
at T9222.hs:13:3
Expected type: '(b, c)
Actual type: a
In the ambiguity check for the type of the constructor ‘Want’:
Want :: forall (k :: BOX)
(k1 :: BOX)
(a :: (,) k k1)
(b :: k)
(c :: k1).
((a ~ '(b, c)) => Proxy b) -> Want a
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the definition of data constructor ‘Want’
In the data declaration for ‘Want’
T9222.hs:13:3: error:
Couldn't match type ‘b0’ with ‘b’
‘b0’ is untouchable
inside the constraints: a ~ '(b0, c0)
bound by the type of the constructor ‘Want’:
(a ~ '(b0, c0)) => Proxy b0
at T9222.hs:13:3
‘b’ is a rigid type variable bound by
the type of the constructor ‘Want’:
((a ~ '(b, c)) => Proxy b) -> Want a
at T9222.hs:13:3
Expected type: '(b, c)
Actual type: a
In the ambiguity check for the type of the constructor ‘Want’:
Want :: forall (k :: BOX)
(k1 :: BOX)
(a :: (,) k k1)
(b :: k)
(c :: k1).
((a ~ '(b, c)) => Proxy b) -> Want a
To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
In the definition of data constructor ‘Want’
In the data type declaration for ‘Want’
......@@ -116,3 +116,4 @@ test('T9833', normal, compile, [''])
test('T7908', normal, compile, [''])
test('T10041', normal, compile, [''])
test('T10451', normal, compile_fail, [''])
test('T10516', normal, compile_fail, [''])
T7050.hs:3:14: Warning:
Ignoring unusable UNPACK pragma on the first argument of ‘Foo’
In the definition of data constructor ‘Foo’
In the data declaration for ‘Foo’
T7050.hs:3:14: warning:
Ignoring unusable UNPACK pragma on the first argument of ‘Foo’
In the definition of data constructor ‘Foo’
In the data type declaration for ‘Foo’
T7562.hs:3:14: Warning:
UNPACK pragma lacks '!' on the first argument of ‘Pair2’
In the definition of data constructor ‘Pair2’
In the data declaration for ‘Pair2’
T7562.hs:3:14: warning:
UNPACK pragma lacks '!' on the first argument of ‘Pair2’
In the definition of data constructor ‘Pair2’
In the data type declaration for ‘Pair2’
T3966.hs:5:16: Warning:
Ignoring unusable UNPACK pragma on the first argument of ‘Foo’
In the definition of data constructor ‘Foo’
In the data declaration for ‘Foo’
<no location info>:
Failing due to -Werror.
T3966.hs:5:16: warning:
Ignoring unusable UNPACK pragma on the first argument of ‘Foo’
In the definition of data constructor ‘Foo’
In the data type declaration for ‘Foo’
<no location info>: error:
Failing due to -Werror.
T7175.hs:8:4:
Data constructor ‘G1C’ returns type ‘F Int’
instead of an instance of its parent type ‘G1 a’
In the definition of data constructor ‘G1C’
In the data declaration for ‘G1’
T7175.hs:8:4: error:
Data constructor ‘G1C’ returns type ‘F Int’
instead of an instance of its parent type ‘G1 a’
In the definition of data constructor ‘G1C’
In the data type declaration for ‘G1’
tcfail100.hs:7:1:
Type synonym ‘A’ should have 1 argument, but has been given none
In the type declaration for ‘B’
tcfail100.hs:7:1: error:
The type synonym ‘A’ should have 1 argument, but has been given none
In the type synonym declaration for ‘B’
tcfail101.hs:9:6:
Type synonym ‘A’ should have 1 argument, but has been given none
In the type signature for ‘f’: f :: T A
tcfail101.hs:9:6: error:
The type synonym ‘A’ should have 1 argument, but has been given none
In the type signature for ‘f’: f :: T A
tcfail107.hs:13:9:
Type synonym ‘Const’ should have 2 arguments, but has been given 1
In the type signature for ‘test’:
test :: Thing (Const Int) -> Thing (Const Int)
tcfail107.hs:13:9: error:
The type synonym ‘Const’ should have 2 arguments, but has been given 1
In the type signature for ‘test’:
test :: Thing (Const Int) -> Thing (Const Int)
tcfail129.hs:12:21:
Type synonym ‘Foo’ should have 1 argument, but has been given none
In an expression type signature: Bar Foo
In the expression: undefined :: Bar Foo
In an equation for ‘blah’: blah = undefined :: Bar Foo
tcfail129.hs:17:22:
Type synonym ‘Foo1’ should have 1 argument, but has been given none
In an expression type signature: Bar1 Foo1
In the expression: undefined :: Bar1 Foo1
In an equation for ‘blah1’: blah1 = undefined :: Bar1 Foo1
tcfail129.hs:12:21: error:
The type synonym ‘Foo’ should have 1 argument, but has been given none
In an expression type signature: Bar Foo
In the expression: undefined :: Bar Foo
In an equation for ‘blah’: blah = undefined :: Bar Foo
tcfail129.hs:17:22: error:
The type synonym ‘Foo1’ should have 1 argument, but has been given none
In an expression type signature: Bar1 Foo1
In the expression: undefined :: Bar1 Foo1
In an equation for ‘blah1’: blah1 = undefined :: Bar1 Foo1
tcfail140.hs:10:7:
tcfail140.hs:10:7: error:
Couldn't match expected type ‘Integer -> t’ with actual type ‘Int’
Relevant bindings include bar :: t (bound at tcfail140.hs:10:1)
The function ‘f’ is applied to two arguments,
......@@ -7,7 +7,7 @@ tcfail140.hs:10:7:
In the expression: f 3 9
In an equation for ‘bar’: bar = f 3 9
tcfail140.hs:12:10:
tcfail140.hs:12:10: error:
Couldn't match expected type ‘Integer -> t1’ with actual type ‘Int’
Relevant bindings include
rot :: t -> t1 (bound at tcfail140.hs:12:1)
......@@ -16,7 +16,7 @@ tcfail140.hs:12:10:
In the expression: 3 `f` 4
In an equation for ‘rot’: rot xs = 3 `f` 4
tcfail140.hs:14:15:
tcfail140.hs:14:15: error:
Couldn't match expected type ‘a -> b’ with actual type ‘Int’
Relevant bindings include
xs :: [a] (bound at tcfail140.hs:14:5)
......@@ -26,13 +26,13 @@ tcfail140.hs:14:15:
In the first argument of ‘map’, namely ‘(3 `f`)’
In the expression: map (3 `f`) xs
tcfail140.hs:16:8:
Constructor ‘Just’ should have 1 argument, but has been given none
tcfail140.hs:16:8: error:
The constructor ‘Just’ should have 1 argument, but has been given none
In the pattern: Just
In the expression: (\ Just x -> x) :: Maybe a -> a
In the expression: ((\ Just x -> x) :: Maybe a -> a) (Just 1)
tcfail140.hs:19:1:
tcfail140.hs:19:1: error:
Couldn't match expected type ‘t0 -> Bool’ with actual type ‘Int’
The equation(s) for ‘g’ have two arguments,
but its type ‘Int -> Int’ has only one
tcfail155.hs:8:6:
Data constructor ‘P’ returns type ‘L2’
instead of an instance of its parent type ‘T a’
In the definition of data constructor ‘P’
In the data declaration for ‘T’
tcfail155.hs:8:6: error:
Data constructor ‘P’ returns type ‘L2’
instead of an instance of its parent type ‘T a’
In the definition of data constructor ‘P’
In the data type declaration for ‘T’
tcfail187.hs:7:6:
Constructor ‘:::’ should have no arguments, but has been given 2
In the pattern: x ::: y
In an equation for ‘foo’: foo (x ::: y) = ()
tcfail187.hs:7:6: error:
The constructor ‘:::’ should have no arguments, but has been given 2
In the pattern: x ::: y
In an equation for ‘foo’: foo (x ::: y) = ()
tcfail195.hs:6:3:
Illegal polymorphic or qualified type: forall a. a
In the definition of data constructor ‘Foo’
In the data declaration for ‘Foo’
tcfail195.hs:6:3: error:
Illegal polymorphic or qualified type: forall a. a
In the definition of data constructor ‘Foo’
In the data type declaration for ‘Foo’
tcfail209.hs:3:1:
Illegal constraint synonym of kind: ‘* -> Constraint’
(Use ConstraintKinds to permit this)
In the type declaration for ‘Showish’
tcfail209.hs:3:1: error:
Illegal constraint synonym of kind: ‘* -> Constraint’
(Use ConstraintKinds to permit this)
In the type synonym declaration for ‘Showish’
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