module Exn1 where import LvmLang import LvmException import LvmIO main :: IO () main = bindIO (catch (case (>) (nfib 27) 100 of True -> outputChar stdout 'T' False -> outputChar stdout 'F' ) (\exn -> case exn of Signal s -> outputChar stdout 's' other -> outputChar stdout 'x' ) ) (\x -> flush stdout) -- normal nfib nfib n = case n of 0 -> 1 1 -> 1 n -> (+) 1 ((+) (nfib ((-) n 1)) (nfib ((-) n 2)))