@@ -3,16 +3,10 @@ module Language.PureScript.Docs.Convert.Single
33 , collectBookmarks
44 ) where
55
6−import Prelude.Compat
6+import Protolude
77
88import Control.Category ((>>>))
9−import Control.Monad
109
11−import Data.Either
12−import Data.List (nub)
13−import Data.Maybe (mapMaybe, fromMaybe)
14−import Data.Monoid ((<>))
15−import Data.Text (Text)
1610import qualified Data.Text as T
1711
1812import Language.PureScript.Docs.Types
@@ -67,7 +61,7 @@ data DeclarationAugment
6761-- the type synonym IntermediateDeclaration for more information.
6862augmentDeclarations :: [IntermediateDeclaration] -> [Declaration]
6963augmentDeclarations (partitionEithers -> (augments, toplevels)) =
70− foldl go toplevels augments
64+ foldl' go toplevels augments
7165 where
7266 go ds (parentTitles, a) =
7367 map (\d ->
@@ -142,14 +136,14 @@ convertDeclaration (P.TypeInstanceDeclaration _ constraints className tys _) tit
142136 Just (Left (classNameString : typeNameStrings, AugmentChild childDecl))
143137 where
144138 classNameString = unQual className
145− typeNameStrings = nub (concatMap (P.everythingOnTypes (++) extractProperNames) tys)
139+ typeNameStrings = ordNub (concatMap (P.everythingOnTypes (++) extractProperNames) tys)
146140 unQual x = let (P.Qualified _ y) = x in P.runProperName y
147141
148142 extractProperNames (P.TypeConstructor n) = [unQual n]
149143 extractProperNames _ = []
150144
151145 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
153147convertDeclaration (P.ValueFixityDeclaration fixity (P.Qualified mn alias) _) title =
154148 Just $ Right $ mkDeclaration title (AliasDeclaration fixity (P.Qualified mn (Right alias)))
155149convertDeclaration (P.TypeFixityDeclaration fixity (P.Qualified mn alias) _) title =