aboutsummaryrefslogtreecommitdiff
path: root/haskell/Reader.hs
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-12-24 23:17:38 -0700
committerJoel Martin <github@martintribe.org>2015-01-09 16:16:54 -0600
commit5400d4bf5e7fe7f968a4553f55101de962a39ef7 (patch)
tree99db6dc9e3adc27678ce2bb36bef8a7b83ada171 /haskell/Reader.hs
parentc150ec41f4f0b8f384f4b1b493a5ca61db42573c (diff)
downloadmal-5400d4bf5e7fe7f968a4553f55101de962a39ef7.tar.gz
mal-5400d4bf5e7fe7f968a4553f55101de962a39ef7.zip
Haskell: add error handling and try*/catch*.
Achieve self-hosting!
Diffstat (limited to 'haskell/Reader.hs')
-rw-r--r--haskell/Reader.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/haskell/Reader.hs b/haskell/Reader.hs
index 377c2f4..91ce63d 100644
--- a/haskell/Reader.hs
+++ b/haskell/Reader.hs
@@ -149,7 +149,7 @@ read_form = do
<|> read_atom
return $ x
-read_str :: String -> IO MalVal
+read_str :: String -> IOThrows MalVal
read_str str = case parse read_form "Mal" str of
- Left err -> error $ show err
+ Left err -> throwStr $ show err
Right val -> return val