@@ -1,4 +1,4 @@
1−-----------------------------------------------------------------------------
1+----------------------------------------------------------------------------
22--
33-- Module : Main
44-- Copyright : (c) Phil Freeman 2013
@@ -140,11 +140,13 @@ renderDeclaration n _ (P.TypeDeclaration ident ty) =
140140renderDeclaration n _ (P.ExternDeclaration _ ident _ ty) =
141141 atIndent n $ show ident ++ " :: " ++ prettyPrintType' ty
142142renderDeclaration n exps (P.DataDeclaration dtype name args ctors) = do
143− let typeName = P.runProperName name ++ (if null args then "" else " " ++ unwords args)
144− let exported = filter (isDctorExported name exps . fst) ctors
143+ let
144+ typeApp = foldl P.TypeApp (P.TypeConstructor (P.Qualified Nothing name)) (map P.TypeVar args)
145+ typeName = prettyPrintType' typeApp
146+ exported = filter (isDctorExported name exps . fst) ctors
145147 atIndent n $ show dtype ++ " " ++ typeName ++ (if null exported then "" else " where")
146148 forM_ exported $ \(ctor, tys) ->
147− let ctorTy = foldr P.function (P.TypeConstructor (P.Qualified Nothing name)) tys
149+ let ctorTy = foldr P.function typeApp tys
148150 in atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ prettyPrintType' ctorTy
149151renderDeclaration n _ (P.ExternDataDeclaration name kind) =
150152 atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind