Skip to content

Commit 79fcdf4

Browse files
committed
1 parent 5027992 commit 79fcdf4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docgen/Main.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ renderDeclaration n exps (P.DataDeclaration dtype name args ctors) = do
144144
let exported = filter (isDctorExported name exps . fst) ctors
145145
atIndent n $ show dtype ++ " " ++ typeName ++ (if null exported then "" else " where")
146146
forM_ exported $ \(ctor, tys) ->
147-
atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ concatMap (\ty -> prettyPrintType' ty ++ " -> ") tys ++ typeName
147+
let ctorTy = foldr P.function (P.TypeConstructor (P.Qualified Nothing name)) tys
148+
in atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ prettyPrintType' ctorTy
148149
renderDeclaration n _ (P.ExternDataDeclaration name kind) =
149150
atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind
150151
renderDeclaration n _ (P.TypeSynonymDeclaration name args ty) = do

0 commit comments

Comments
 (0)