From: simonpj Date: Mon, 19 Dec 2005 09:48:14 +0000 (+0000) Subject: [project @ 2005-12-19 09:48:14 by simonpj] X-Git-Tag: final_switch_to_darcs,_this_repo_is_now_live~82 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=bba98641e10c71ec9aeb20d508b8905e4a64a143;hp=0e0b98409b23dd84ef11aea611b104d8e20abae3;p=ghc-hetmet.git [project @ 2005-12-19 09:48:14 by simonpj] Allow trailing parens in GADT signatures --- 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}