summaryrefslogtreecommitdiff
path: root/DSL/Interpretation.hs
diff options
context:
space:
mode:
Diffstat (limited to 'DSL/Interpretation.hs')
-rw-r--r--DSL/Interpretation.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/DSL/Interpretation.hs b/DSL/Interpretation.hs
index 82a8ef2..34137a9 100644
--- a/DSL/Interpretation.hs
+++ b/DSL/Interpretation.hs
@@ -1,7 +1,9 @@
module DSL.Interpretation where
import qualified Data.Map.Strict as M
+import Data.Bifunctor (first)
import Data.Foldable (foldlM)
+import Data.Void
import DSL.Types
import DSL.Util
@@ -20,7 +22,7 @@ pushData m@Machine{ stack=xs } x = m{ stack=x:xs }
runModifier :: StackModifier -> Stack -> IO (Either String Stack)
runModifier sm s = case runChecks (smTypes sm) s of
Just err -> return $ Left $ smName sm ++ ": " ++ err
- Nothing -> Right <$> smFunc sm s
+ Nothing -> first absurd <$> smFunc sm s
applyIntrinsic :: Intrinsic -> Machine -> IO Machine
applyIntrinsic i m = do