git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #587
7f0a40ePhil Freeman
docgen/Main.hs+6−4
@@ -1,4 +1,4 @@
1−-----------------------------------------------------------------------------
1+----------------------------------------------------------------------------
2--
2--
3-- Module : Main
3-- Module : Main
4-- Copyright : (c) Phil Freeman 2013
4-- Copyright : (c) Phil Freeman 2013
@@ -140,11 +140,13 @@ renderDeclaration n _ (P.TypeDeclaration ident ty) =
140renderDeclaration n _ (P.ExternDeclaration _ ident _ ty) =
140renderDeclaration n _ (P.ExternDeclaration _ ident _ ty) =
141 atIndent n $ show ident ++ " :: " ++ prettyPrintType' ty
141 atIndent n $ show ident ++ " :: " ++ prettyPrintType' ty
142renderDeclaration n exps (P.DataDeclaration dtype name args ctors) = do
142renderDeclaration n exps (P.DataDeclaration dtype name args ctors) = do
143− let typeName = P.runProperName name ++ (if null args then "" else " " ++ unwords args)
143+ let
144+ typeApp = foldl P.TypeApp (P.TypeConstructor (P.Qualified Nothing name)) (map P.TypeVar args)
145+ typeName = prettyPrintType' typeApp
144− let exported = filter (isDctorExported name exps . fst) ctors
146+ exported = filter (isDctorExported name exps . fst) ctors
145 atIndent n $ show dtype ++ " " ++ typeName ++ (if null exported then "" else " where")
147 atIndent n $ show dtype ++ " " ++ typeName ++ (if null exported then "" else " where")
146 forM_ exported $ \(ctor, tys) ->
148 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
148 in atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ prettyPrintType' ctorTy
150 in atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ prettyPrintType' ctorTy
149renderDeclaration n _ (P.ExternDataDeclaration name kind) =
151renderDeclaration n _ (P.ExternDataDeclaration name kind) =
150 atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind
152 atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind
purescript.cabal+1−1
@@ -1,5 +1,5 @@
1name: purescript
1name: purescript
2−version: 0.5.6.2
2+version: 0.5.6.3
3cabal-version: >=1.8
3cabal-version: >=1.8
4build-type: Custom
4build-type: Custom
5license: MIT
5license: MIT