isRdrDataCon, isUnqual, getRdrName, isQual,
setRdrNameSpace )
import BasicTypes ( maxPrecedence, Activation, InlineSpec(..), alwaysInlineSpec, neverInlineSpec )
-import Lexer ( P, failSpanMsgP, extension, glaExtsEnabled, bangPatEnabled )
+import Lexer ( P, failSpanMsgP, extension, standaloneDerivingEnabled, bangPatEnabled )
import TysWiredIn ( unitTyCon )
import ForeignCall ( CCallConv, Safety, CCallTarget(..), CExportSpec(..),
DNCallSpec(..), DNKind(..), CLabelString )
parseError l "Type found where type variable expected"
-- Check whether the type arguments in a type synonym head are simply
--- variables. If not, we have a type equation of a type function and return
--- all patterns. If yes, we return 'Nothing' as the third component to
--- indicate a vanilla type synonym.
+-- variables. If not, we have a type family instance and return all patterns.
+-- If yes, we return 'Nothing' as the third component to indicate a vanilla
+-- type synonym.
--
checkSynHdr :: LHsType RdrName
-> Bool -- is type instance?
-- etc
-- With associated types, we can also have non-variable parameters; ie,
-- T Int [a]
+-- or Int :++: [a]
-- The unaltered parameter list is returned in the fourth component of the
-- result. Eg, for
-- T Int [a]
return (L l tc, tvs, acc)
go l (HsOpTy t1 ltc@(L _ tc) t2) acc
| isRdrTc tc = do tvs <- extractTyVars (t1:t2:acc)
- return (ltc, tvs, acc)
+ return (ltc, tvs, t1:t2:acc)
go l (HsParTy ty) acc = gol ty acc
go l (HsAppTy t1 t2) acc = gol t1 (t2:acc)
go l other acc =
checkDerivDecl :: LDerivDecl RdrName -> P (LDerivDecl RdrName)
checkDerivDecl d@(L loc _) =
- do glaExtOn <- extension glaExtsEnabled
- if glaExtOn then return d
- else parseError loc "Illegal stand-alone deriving declaration (use -fglasgow-exts)"
+ do stDerivOn <- extension standaloneDerivingEnabled
+ if stDerivOn then return d
+ else parseError loc "Illegal stand-alone deriving declaration (use -XStandaloneDeriving)"
---------------------------------------------------------------------------
-- Checking statements in a do-expression