My program:
Runs a simulation over time in the IO monad, calling "putStr" and "die" as appropriate. If I were in an imperative language, I'd just change those to append to an array and throw an exception.
But monads are "programmable semicolons", right? So I should be able to have one program parameterized over a monad, a "submit value" function, and a "early terminate" function. I should be able to emulate array.push_back() and throw. The monad just handles it.





![-- True if two Lists are equal
listEq : List (Eq a) -> List (Eq a) -> Bool
listEq a b =
case (a, b) of
([], []) => True
(_::[], []) => False
([], _::[]) => False
(a1::ar, b1::br) =>
if a1==b1 then
listEq ar br
else False
It fails with: Can't find an implementation for Eq (Eq a)](https://pool.jortage.com/slimeglobal/cache/media_attachments/files/117/471/068/444/960/567/small/28d89e5965f81eb9.png)


![lots of lines like "Success 15943678 [5, 0, 7, 7, 1, 1, 1, 3] eq? True"](https://pool.jortage.com/slimeglobal/cache/media_attachments/files/117/471/163/746/064/641/small/1f61d695fdf9cd0a.png)

