Commit bba98641 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-12-19 09:48:14 by simonpj]

Allow trailing parens in GADT signatures
parent 0e0b9840
......@@ -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}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment