From 2c20c2f9d79f22d3156670c21f424a68ec05e86c Mon Sep 17 00:00:00 2001 From: davve Date: Fri, 22 Sep 2006 18:10:45 +0000 Subject: Fix a bug in Main.toHsType --- src/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 86d7e297..6f8e0a3c 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -1116,14 +1116,14 @@ toHsType t = case t of AppTy a b -> HsAppTy (toLHsType a) (toLHsType b) TyConApp tc ts -> case ts of [] -> HsTyVar (tyConName tc) - _ -> HsAppTy (tycon tc) (args ts) + _ -> app (tycon tc) ts FunTy a b -> HsFunTy (toLHsType a) (toLHsType b) ForAllTy v t -> cvForAll [v] t PredTy p -> HsPredTy (toHsPred p) NoteTy _ t -> toHsType t where - tycon tc = noLoc (HsTyVar (tyConName tc)) - args ts = foldl1 (\a b -> noLoc $ HsAppTy a b) (map toLHsType ts) + tycon tc = HsTyVar (tyConName tc) + app tc ts = foldl (\a b -> HsAppTy (noLoc a) (noLoc b)) tc (map toHsType ts) cvForAll vs (ForAllTy v t) = cvForAll (v:vs) t cvForAll vs t = mkExplicitHsForAllTy (tyvarbinders vs) (noLoc []) (toLHsType t) tyvarbinders vs = map (noLoc . UserTyVar . tyVarName) vs -- cgit v1.2.3