@@ -1,5 +1,4 @@
11{-# LANGUAGE FlexibleContexts #-}
2−{-# LANGUAGE LambdaCase #-}
32{-# LANGUAGE MultiParamTypeClasses #-}
43{-# LANGUAGE OverloadedStrings #-}
54-- | Provides a simple CLI spinner that interoperates cleanly with the rest of the logging output.
@@ -8,17 +7,17 @@ module Obelisk.CLI.Spinner (withSpinner') where
87import Control.Concurrent (killThread, threadDelay)
98import Control.Monad (forM_, (>=>))
109import Control.Monad.Catch (MonadMask, mask, onException)
10+import Control.Monad.IO.Class
1111import Control.Monad.Log (MonadLog, logMessage)
1212import Control.Monad.Reader (MonadIO)
13−import Control.Monad.IO.Class
1413import Data.IORef
1514import Data.List (delete)
1615import Data.Text (Text)
1716import qualified Data.Text as T
18−import System.Console.ANSI (Color (Cyan, Green, Red), ColorIntensity (Vivid), ConsoleLayer (Foreground),
17+import System.Console.ANSI (Color (Blue, Cyan, Green, Red), ColorIntensity (Vivid), ConsoleLayer (Foreground),
1918 SGR (Reset, SetColor), setSGRCode)
2019
21−import Obelisk.CLI.Logging (LoggingConfig(..), Output (..), allowUserToMakeLoggingVerbose, forkML)
20+import Obelisk.CLI.Logging (LoggingConfig (..), Output (..), allowUserToMakeLoggingVerbose, forkML)
2221
2322-- | Run an action with a CLI spinner.
2423withSpinner'
@@ -56,7 +55,7 @@ withSpinner' conf s = bracket' start cleanup . const
5655concatStack :: String -> [Text] -> String
5756concatStack mark = drop 1 . foldr flatten "" . zip (mark : repeat arrow) . fmap T.unpack
5857 where flatten (m, s) acc = unwords [acc, m, s]
59− arrow = withColor Cyan "▶"
58+ arrow = withColor Blue "⇾"
6059
6160-- | A spinner is simply an infinite list of strings that supplant each other in a delayed loop, creating the
6261-- animation of a "spinner".