X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FhsSyn%2FHsTypes.lhs;h=a3bfbdd1a1bea203787c3959641d4b6a3777c7e0;hb=bba98641e10c71ec9aeb20d508b8905e4a64a143;hp=8ad5940069329caf64e0ca6880c6c53ad3fdaa90;hpb=0e0b98409b23dd84ef11aea611b104d8e20abae3;p=ghc-hetmet.git 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}