@@ -133,20 +133,20 @@ renderTypeclassImage name =
134renderDeclaration :: Int -> Maybe [P.DeclarationRef] -> P.Declaration -> Docs
134renderDeclaration :: Int -> Maybe [P.DeclarationRef] -> P.Declaration -> Docs
135renderDeclaration n _ (P.TypeDeclaration ident ty) =
135renderDeclaration n _ (P.TypeDeclaration ident ty) =
136− atIndent n $ show ident ++ " :: " ++ P.prettyPrintType ty
136+ atIndent n $ show ident ++ " :: " ++ prettyPrintType' ty
137renderDeclaration n _ (P.ExternDeclaration _ ident _ ty) =
137renderDeclaration n _ (P.ExternDeclaration _ ident _ ty) =
138− atIndent n $ show ident ++ " :: " ++ P.prettyPrintType ty
138+ atIndent n $ show ident ++ " :: " ++ prettyPrintType' ty
139renderDeclaration n exps (P.DataDeclaration name args ctors) = do
139renderDeclaration n exps (P.DataDeclaration name args ctors) = do
140 let typeName = P.runProperName name ++ " " ++ unwords args
140 let typeName = P.runProperName name ++ " " ++ unwords args
141 atIndent n $ "data " ++ typeName ++ " where"
141 atIndent n $ "data " ++ typeName ++ " where"
142 let exported = filter (isDctorExported name exps . fst) ctors
142 let exported = filter (isDctorExported name exps . fst) ctors
143 forM_ exported $ \(ctor, tys) ->
143 forM_ exported $ \(ctor, tys) ->
144− atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ concatMap (\ty -> P.prettyPrintType ty ++ " -> ") tys ++ typeName
144+ atIndent (n + 2) $ P.runProperName ctor ++ " :: " ++ concatMap (\ty -> prettyPrintType' ty ++ " -> ") tys ++ typeName
145renderDeclaration n _ (P.ExternDataDeclaration name kind) =
145renderDeclaration n _ (P.ExternDataDeclaration name kind) =
146 atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind
146 atIndent n $ "data " ++ P.runProperName name ++ " :: " ++ P.prettyPrintKind kind
147renderDeclaration n _ (P.TypeSynonymDeclaration name args ty) = do
147renderDeclaration n _ (P.TypeSynonymDeclaration name args ty) = do
148 let typeName = P.runProperName name ++ " " ++ unwords args
148 let typeName = P.runProperName name ++ " " ++ unwords args
149− atIndent n $ "type " ++ typeName ++ " = " ++ P.prettyPrintType ty
149+ atIndent n $ "type " ++ typeName ++ " = " ++ prettyPrintType' ty
150renderDeclaration n exps (P.TypeClassDeclaration name args implies ds) = do
150renderDeclaration n exps (P.TypeClassDeclaration name args implies ds) = do
151 let impliesText = case implies of
151 let impliesText = case implies of
@@ -162,6 +162,14 @@ renderDeclaration n exps (P.PositionedDeclaration _ d) =
162 renderDeclaration n exps d
162 renderDeclaration n exps d
163renderDeclaration _ _ _ = return ()
163renderDeclaration _ _ _ = return ()
165+prettyPrintType' :: P.Type -> String
166+prettyPrintType' = P.prettyPrintType . P.everywhereOnTypes dePrim
168+ dePrim ty@(P.TypeConstructor (P.Qualified _ name))
169+ | ty == P.tyBoolean || ty == P.tyNumber || ty == P.tyString =
170+ P.TypeConstructor $ P.Qualified Nothing name
171+ dePrim other = other
165getName :: P.Declaration -> String
173getName :: P.Declaration -> String
166getName (P.TypeDeclaration ident _) = show ident
174getName (P.TypeDeclaration ident _) = show ident
167getName (P.ExternDeclaration _ ident _ _) = show ident
175getName (P.ExternDeclaration _ ident _ _) = show ident