[project @ 2005-12-19 09:48:14 by simonpj]
authorsimonpj <unknown>
Mon, 19 Dec 2005 09:48:14 +0000 (09:48 +0000)
committersimonpj <unknown>
Mon, 19 Dec 2005 09:48:14 +0000 (09:48 +0000)
Allow trailing parens in GADT signatures

ghc/compiler/hsSyn/HsTypes.lhs

index 8ad5940..a3bfbdd 100644 (file)
@@ -237,11 +237,14 @@ splitHsInstDeclTy inst_ty
     split_tau tvs cxt (HsParTy (L _ ty))           = split_tau tvs cxt ty
 
 -- Splits HsType into the (init, last) parts
+-- Breaks up any parens in the result type: 
+--     splitHsFunType (a -> (b -> c)) = ([a,b], c)
 splitHsFunType :: LHsType name -> ([LHsType name], LHsType name)
 splitHsFunType (L l (HsFunTy x y)) = (x:args, res)
   where
   (args, res) = splitHsFunType y
-splitHsFunType other = ([], other)
+splitHsFunType (L _ (HsParTy ty))  = splitHsFunType ty
+splitHsFunType other              = ([], other)
 \end{code}