Skip to content
Snippets Groups Projects
Commit 7b4235e8 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 1999-06-14 11:17:12 by simonmar]

Don't rely on bad implementation of 'sum', now that we don't have one
:)
parent 14e7206d
No related merge requests found
......@@ -2,13 +2,18 @@ module Main where
import Concurrent
import Exception
import GlaExts
data Result = Died Exception | Finished
-- Test stack overflow catching. Should print "Died: stack overflow".
stackoverflow :: Int -> Int
stackoverflow 0 = 1
stackoverflow n = n + stackoverflow n
main = do
let x = sum [1..100000] -- relies on sum being implemented badly :-)
let x = stackoverflow 1
result <- newEmptyMVar
forkIO (catchAllIO (x `seq` putMVar result Finished)
(\e -> putMVar result (Died e)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment