mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
34585e0007
commit
48c9abc2fe
|
@ -141,12 +141,17 @@ runTop :: (ParseSExp what, MonadUnliftIO m) => Dict C m -> what -> m ()
|
|||
runTop dict s = parseTop s & either (const none) (void . run dict)
|
||||
|
||||
|
||||
{- HLINT ignore "Functor law" -}
|
||||
main :: IO ()
|
||||
main = flip runContT pure do
|
||||
hSetBuffering stdin LineBuffering
|
||||
hSetBuffering stdout LineBuffering
|
||||
-- setupTrace :: ContT r IO ()
|
||||
setupTrace :: Foldable t => TVar (Maybe (Text, Integer)) -> TVar (t a) -> ContT r IO ()
|
||||
setupTrace cp_ refz = do
|
||||
traceMode <- isJust <$> liftIO (lookupEnv "HBS2TRACE")
|
||||
setupTrace_ traceMode
|
||||
|
||||
where
|
||||
setupTrace_ False = none
|
||||
setupTrace_ _ = do
|
||||
--
|
||||
none
|
||||
|
||||
origStderr <- liftIO $ dup stdError
|
||||
(readEnd, writeEnd) <- liftIO createPipe
|
||||
|
@ -162,8 +167,6 @@ main = flip runContT pure do
|
|||
lift $ void $ installHandler sigPIPE Ignore Nothing
|
||||
|
||||
ready_ <- newEmptyTMVarIO
|
||||
cp_ <- newTVarIO Nothing
|
||||
refz <- newTVarIO mempty
|
||||
|
||||
-- doesPathExist
|
||||
|
||||
|
@ -226,7 +229,18 @@ main = flip runContT pure do
|
|||
|
||||
hFlush origHandle
|
||||
|
||||
atomically $ takeTMVar ready_
|
||||
void $ atomically $ takeTMVar ready_
|
||||
|
||||
{- HLINT ignore "Functor law" -}
|
||||
main :: IO ()
|
||||
main = flip runContT pure do
|
||||
hSetBuffering stdin LineBuffering
|
||||
hSetBuffering stdout LineBuffering
|
||||
|
||||
cp <- newTVarIO Nothing
|
||||
refz <- newTVarIO mempty
|
||||
|
||||
setupTrace cp refz
|
||||
|
||||
setupLogger
|
||||
|
||||
|
|
Loading…
Reference in New Issue