Allow for hard quitting
This commit is contained in:
@@ -12,6 +12,7 @@ conEffects :: Universe -> ConcurrentEffect Universe
|
||||
conEffects u = case u ^? uvSideEffects . _head of
|
||||
Just NewSideEffect{_ceSideEffect = eff} -> ConcurrentEffect (u & uvSideEffects . _head %~ g)
|
||||
(dopop eff)
|
||||
Just HardQuit -> ImmediateEffect (return Nothing)
|
||||
_ -> NoConcurrentEffect
|
||||
where
|
||||
g seff = RunningSideEffect (_ceString seff)
|
||||
@@ -26,7 +27,8 @@ addSideEffect :: IO (Universe -> Maybe Universe) -> String -> Universe -> Univer
|
||||
addSideEffect f s = uvSideEffects %~ (|> NewSideEffect f s)
|
||||
|
||||
hardQuit :: Universe -> Universe
|
||||
hardQuit = addSideEffect (return $ const Nothing) "QUITTING"
|
||||
hardQuit = uvSideEffects %~ (HardQuit <|)
|
||||
--hardQuit = addSideEffect (return $ const Nothing) "QUITTING"
|
||||
|
||||
--tryConcEffect :: Bool -> String -> IO (Universe -> Maybe Universe) -> Universe -> Universe
|
||||
--tryConcEffect bl str eff u = case u ^. uvConcEffects of
|
||||
|
||||
Reference in New Issue
Block a user