module QuitF(quitIdF, quitF) where
import FudgetIO
import HaskellIO
import NullF
import DialogueIO hiding (IOError)
quitF :: F ans ho
quitF =
(ans -> F ans ho) -> F ans ho
forall (f :: * -> * -> *) ans ho.
FudgetIO f =>
(ans -> f ans ho) -> f ans ho
getHigh ((ans -> F ans ho) -> F ans ho) -> (ans -> F ans ho) -> F ans ho
forall a b. (a -> b) -> a -> b
$ \ ans
_ ->
Request -> F ans ho -> F ans ho
forall a b. Request -> F a b -> F a b
hIOSuccF (Int -> Request
Exit Int
0) (F ans ho -> F ans ho) -> F ans ho -> F ans ho
forall a b. (a -> b) -> a -> b
$
F ans ho
forall hi ho. F hi ho
nullF
quitIdF :: (ho -> Bool) -> F ho ho
quitIdF ho -> Bool
p =
(ho -> F ho ho) -> F ho ho
forall (f :: * -> * -> *) ans ho.
FudgetIO f =>
(ans -> f ans ho) -> f ans ho
getHigh ((ho -> F ho ho) -> F ho ho) -> (ho -> F ho ho) -> F ho ho
forall a b. (a -> b) -> a -> b
$ \ ho
msg ->
(if ho -> Bool
p ho
msg
then Request -> F ho ho -> F ho ho
forall a b. Request -> F a b -> F a b
hIOSuccF (Int -> Request
Exit Int
0)
else ho -> F ho ho -> F ho ho
forall (f :: * -> * -> *) ho hi.
FudgetIO f =>
ho -> f hi ho -> f hi ho
putHigh ho
msg) (F ho ho -> F ho ho) -> F ho ho -> F ho ho
forall a b. (a -> b) -> a -> b
$
(ho -> Bool) -> F ho ho
quitIdF ho -> Bool
p