@@ -29,7 +29,7 @@ import Docs.Search.TypePrinter (keyword, showConstraint, showFunDeps, showKind,
2929import Effect (Effect)
3030import Effect.Aff (launchAff_)
3131import Effect.Class (liftEffect)
32−import Effect.Console (log)
32+import Effect.Console (log, clear) as Console
3333import Node.ReadLine (createConsoleInterface, question)
3434
3535
@@ -43,7 +43,7 @@ run :: Config -> Effect Unit
4343run cfg = launchAff_ $ do
4444
4545 liftEffect do
46− log "Loading search index..."
46+ Console.log "Loading search index..."
4747
4848 docsJsons <- IndexBuilder.decodeDocsJsons cfg
4949 packageMetas <- IndexBuilder.decodeBowerJsons cfg
@@ -60,7 +60,7 @@ run cfg = launchAff_ $ do
6060 countOfPackages = Array.length packageMetas
6161
6262 liftEffect do
63− log $
63+ Console.log $
6464 "Loaded " <>
6565 show countOfDefinitions <>
6666 " definitions and " <>
@@ -81,15 +81,15 @@ run cfg = launchAff_ $ do
8181
8282 let total = Array.length results
8383
84− consoleClear
84+ Console.clear
8585
86− if total > 0 then do
87− log $
86+ Console.log $
87+ if total > 0 then do
8888 Array.intercalate "\n\n\n" $
89− showResult <$> Array.reverse results
90− else do
91− log $
89+ showResult <$> Array.reverse results
90+ else
9291 "Your search for " <> bold input <> " did not yield any results."
92+
9393 call inputHandler interface
9494
9595 interface <- createConsoleInterface (mkCompleter index)
@@ -296,6 +296,3 @@ leftPad w str = Array.fold (Array.replicate w " ") <> str
296296
297297rightPad :: Int -> String -> String
298298rightPad w str = str <> Array.fold (Array.replicate (w - String.length str) " ")
299−
300−
301−foreign import consoleClear :: Effect Unit