diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-02-23 23:05:54 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-02-23 23:05:54 +1300 |
| commit | 1c2e8f59960c18b5e5794fba214a3f0906fb074d (patch) | |
| tree | 0c1d1a421ad50b5d704d512a328e13aa693deefa /DSL.hs | |
| parent | 06692c8e1754ac8d5d671160b839723e3610fcf1 (diff) | |
Parsing overhaul (slightly better errors)
Diffstat (limited to 'DSL.hs')
| -rw-r--r-- | DSL.hs | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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 |
