mirror of https://github.com/voidlizard/hbs2
Remove unused import in sync prelude
This commit is contained in:
parent
2564a05bce
commit
f8344d4a0c
|
@ -65,7 +65,6 @@ import System.Directory
|
||||||
import System.Exit qualified as Exit
|
import System.Exit qualified as Exit
|
||||||
import System.IO qualified as IO
|
import System.IO qualified as IO
|
||||||
import UnliftIO as Exported
|
import UnliftIO as Exported
|
||||||
import HBS2.CLI.Prelude (IsTimeout)
|
|
||||||
|
|
||||||
{- HLINT ignore "Functor law" -}
|
{- HLINT ignore "Functor law" -}
|
||||||
{- HLINT ignore "Eta reduce" -}
|
{- HLINT ignore "Eta reduce" -}
|
||||||
|
@ -453,6 +452,8 @@ die what = liftIO do
|
||||||
hPutDoc stderr (pretty what)
|
hPutDoc stderr (pretty what)
|
||||||
Exit.exitFailure
|
Exit.exitFailure
|
||||||
|
|
||||||
|
|
||||||
|
animateSpinner :: IO (Async ())
|
||||||
animateSpinner =
|
animateSpinner =
|
||||||
async $ forM_ (cycle "|/-\\") $ \c -> do
|
async $ forM_ (cycle "|/-\\") $ \c -> do
|
||||||
IO.putChar c
|
IO.putChar c
|
||||||
|
@ -460,6 +461,7 @@ animateSpinner =
|
||||||
IO.cursorBackward 1
|
IO.cursorBackward 1
|
||||||
pause (TimeoutSec 0.25)
|
pause (TimeoutSec 0.25)
|
||||||
|
|
||||||
|
|
||||||
waitForRefchan ::
|
waitForRefchan ::
|
||||||
( HasClientAPI PeerAPI UNIX m
|
( HasClientAPI PeerAPI UNIX m
|
||||||
, HasClientAPI RefChanAPI UNIX m
|
, HasClientAPI RefChanAPI UNIX m
|
||||||
|
@ -477,16 +479,13 @@ waitForRefchan refchan timeout = do
|
||||||
|
|
||||||
liftIO $ putStr "waiting for refchan "
|
liftIO $ putStr "waiting for refchan "
|
||||||
spinner <- liftIO animateSpinner
|
spinner <- liftIO animateSpinner
|
||||||
res <- race (pause timeout) (wait 1)
|
result <- race (pause timeout) (wait 1)
|
||||||
cancel spinner
|
cancel spinner
|
||||||
liftIO $ do
|
liftIO $ do
|
||||||
IO.setCursorColumn 0
|
IO.setCursorColumn 0
|
||||||
IO.clearLine
|
IO.clearLine
|
||||||
|
|
||||||
case res of
|
pure $ eitherToMaybe result
|
||||||
Right x -> pure (Just x)
|
|
||||||
_ -> pure Nothing
|
|
||||||
|
|
||||||
where
|
where
|
||||||
wait seconds = do
|
wait seconds = do
|
||||||
fetchRefChanHead @UNIX refchan
|
fetchRefChanHead @UNIX refchan
|
||||||
|
|
Loading…
Reference in New Issue