+-- 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.
+--
+checkSynHdr :: LHsType RdrName
+ -> Bool -- non-variables admitted?
+ -> P (Located RdrName, -- head symbol
+ [LHsTyVarBndr RdrName], -- parameters
+ Maybe [LHsType RdrName]) -- type patterns
+checkSynHdr ty nonVarsOk =
+ do { (_, tc, tvs, Just tparms) <- checkTyClHdr (noLoc []) ty
+ ; typats <- checkTyVars tparms nonVarsOk
+ ; return (tc, tvs, typats) }
+
+
+-- Well-formedness check and decomposition of type and class heads.
+--