@@ -3,16 +3,10 @@ module Language.PureScript.Docs.Convert.Single
3 , collectBookmarks
3 , collectBookmarks
6−import Prelude.Compat
6+import Protolude
8import Control.Category ((>>>))
8import Control.Category ((>>>))
12−import Data.List (nub)
13−import Data.Maybe (mapMaybe, fromMaybe)
14−import Data.Monoid ((<>))
15−import Data.Text (Text)
16import qualified Data.Text as T
10import qualified Data.Text as T
18import Language.PureScript.Docs.Types
12import Language.PureScript.Docs.Types
@@ -67,7 +61,7 @@ data DeclarationAugment
67-- the type synonym IntermediateDeclaration for more information.
61-- the type synonym IntermediateDeclaration for more information.
68augmentDeclarations :: [IntermediateDeclaration] -> [Declaration]
62augmentDeclarations :: [IntermediateDeclaration] -> [Declaration]
69augmentDeclarations (partitionEithers -> (augments, toplevels)) =
63augmentDeclarations (partitionEithers -> (augments, toplevels)) =
70− foldl go toplevels augments
64+ foldl' go toplevels augments
72 go ds (parentTitles, a) =
66 go ds (parentTitles, a) =
73 map (\d ->
67 map (\d ->
@@ -142,14 +136,14 @@ convertDeclaration (P.TypeInstanceDeclaration _ constraints className tys _) tit
142 Just (Left (classNameString : typeNameStrings, AugmentChild childDecl))
136 Just (Left (classNameString : typeNameStrings, AugmentChild childDecl))
144 classNameString = unQual className
138 classNameString = unQual className
145− typeNameStrings = nub (concatMap (P.everythingOnTypes (++) extractProperNames) tys)
139+ typeNameStrings = ordNub (concatMap (P.everythingOnTypes (++) extractProperNames) tys)
146 unQual x = let (P.Qualified _ y) = x in P.runProperName y
140 unQual x = let (P.Qualified _ y) = x in P.runProperName y
148 extractProperNames (P.TypeConstructor n) = [unQual n]
142 extractProperNames (P.TypeConstructor n) = [unQual n]
149 extractProperNames _ = []
143 extractProperNames _ = []
151 childDecl = ChildDeclaration title Nothing Nothing (ChildInstance constraints classApp)
145 childDecl = ChildDeclaration title Nothing Nothing (ChildInstance constraints classApp)
152− classApp = foldl P.TypeApp (P.TypeConstructor (fmap P.coerceProperName className)) tys
146+ classApp = foldl' P.TypeApp (P.TypeConstructor (fmap P.coerceProperName className)) tys
153convertDeclaration (P.ValueFixityDeclaration fixity (P.Qualified mn alias) _) title =
147convertDeclaration (P.ValueFixityDeclaration fixity (P.Qualified mn alias) _) title =
154 Just $ Right $ mkDeclaration title (AliasDeclaration fixity (P.Qualified mn (Right alias)))
148 Just $ Right $ mkDeclaration title (AliasDeclaration fixity (P.Qualified mn (Right alias)))
155convertDeclaration (P.TypeFixityDeclaration fixity (P.Qualified mn alias) _) title =
149convertDeclaration (P.TypeFixityDeclaration fixity (P.Qualified mn alias) _) title =