summaryrefslogtreecommitdiff
path: root/DSL.hs
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-02-23 23:05:54 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-02-23 23:05:54 +1300
commit1c2e8f59960c18b5e5794fba214a3f0906fb074d (patch)
tree0c1d1a421ad50b5d704d512a328e13aa693deefa /DSL.hs
parent06692c8e1754ac8d5d671160b839723e3610fcf1 (diff)
Parsing overhaul (slightly better errors)
Diffstat (limited to 'DSL.hs')
-rw-r--r--DSL.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/DSL.hs b/DSL.hs
index 54efb28..5d83035 100644
--- a/DSL.hs
+++ b/DSL.hs
@@ -5,9 +5,7 @@ import DSL.Parsing
import DSL.Interpretation
interpretFromString :: String -> IO ()
-interpretFromString = maybe err interpret . stringToProgram
- where
- err = putStrLn "Unable to parse program"
+interpretFromString = either putStrLn interpret . stringToProgram
interpretFromFile :: FilePath -> IO ()
interpretFromFile path = readFile path >>= interpretFromString