From bba98641e10c71ec9aeb20d508b8905e4a64a143 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 19 Dec 2005 09:48:14 +0000 Subject: [PATCH] [project @ 2005-12-19 09:48:14 by simonpj] Allow trailing parens in GADT signatures --- ghc/compiler/hsSyn/HsTypes.lhs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/hsSyn/HsTypes.lhs b/ghc/compiler/hsSyn/HsTypes.lhs index 8ad5940..a3bfbdd 100644 --- a/ghc/compiler/hsSyn/HsTypes.lhs +++ b/ghc/compiler/hsSyn/HsTypes.lhs @@ -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} -- 1.7.10.4