@@ -29,7 +29,7 @@ import Docs.Search.TypePrinter (keyword, showConstraint, showFunDeps, showKind,
29import Effect (Effect)
29import Effect (Effect)
30import Effect.Aff (launchAff_)
30import Effect.Aff (launchAff_)
31import Effect.Class (liftEffect)
31import Effect.Class (liftEffect)
32−import Effect.Console (log)
32+import Effect.Console (log, clear) as Console
33import Node.ReadLine (createConsoleInterface, question)
33import Node.ReadLine (createConsoleInterface, question)
@@ -43,7 +43,7 @@ run :: Config -> Effect Unit
43run cfg = launchAff_ $ do
43run cfg = launchAff_ $ do
45 liftEffect do
45 liftEffect do
46− log "Loading search index..."
46+ Console.log "Loading search index..."
48 docsJsons <- IndexBuilder.decodeDocsJsons cfg
48 docsJsons <- IndexBuilder.decodeDocsJsons cfg
49 packageMetas <- IndexBuilder.decodeBowerJsons cfg
49 packageMetas <- IndexBuilder.decodeBowerJsons cfg
@@ -60,7 +60,7 @@ run cfg = launchAff_ $ do
60 countOfPackages = Array.length packageMetas
60 countOfPackages = Array.length packageMetas
62 liftEffect do
62 liftEffect do
63− log $
63+ Console.log $
64 "Loaded " <>
64 "Loaded " <>
65 show countOfDefinitions <>
65 show countOfDefinitions <>
66 " definitions and " <>
66 " definitions and " <>
@@ -81,15 +81,15 @@ run cfg = launchAff_ $ do
82 let total = Array.length results
82 let total = Array.length results
84− consoleClear
84+ Console.clear
86− if total > 0 then do
87+ if total > 0 then do
88 Array.intercalate "\n\n\n" $
88 Array.intercalate "\n\n\n" $
89− showResult <$> Array.reverse results
89+ showResult <$> Array.reverse results
92 "Your search for " <> bold input <> " did not yield any results."
91 "Your search for " <> bold input <> " did not yield any results."
93 call inputHandler interface
93 call inputHandler interface
95 interface <- createConsoleInterface (mkCompleter index)
95 interface <- createConsoleInterface (mkCompleter index)
@@ -296,6 +296,3 @@ leftPad w str = Array.fold (Array.replicate w " ") <> str
297rightPad :: Int -> String -> String
297rightPad :: Int -> String -> String
298rightPad w str = str <> Array.fold (Array.replicate (w - String.length str) " ")
298rightPad w str = str <> Array.fold (Array.replicate (w - String.length str) " ")
301−foreign import consoleClear :: Effect Unit