Commit bbeb08a1 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Allow instance heads to use infix syntax

  class C a b
  instance Int `C` Bool

This was accidentally disallowed before.
parent a5b8f5c5
......@@ -549,12 +549,14 @@ checkInstType (L l t)
checkDictTy :: LHsType RdrName -> P (LHsType RdrName)
checkDictTy (L spn ty) = check ty []
where
check (HsTyVar t) args | not (isRdrTyVar t)
= return (L spn (HsPredTy (HsClassP t args)))
check (HsTyVar tc) args | isRdrTc tc = done tc args
check (HsOpTy t1 (L _ tc) t2) args | isRdrTc tc = done tc (t1:t2:args)
check (HsAppTy l r) args = check (unLoc l) (r:args)
check (HsParTy t) args = check (unLoc t) args
check _ _ = parseError spn "Malformed instance header"
done tc args = return (L spn (HsPredTy (HsClassP tc args)))
checkTParams :: Bool -- Type/data family
-> [LHsType RdrName]
-> P ([LHsTyVarBndr RdrName], Maybe [LHsType RdrName])
......
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