From b087d7255c7f368d7a7a9e772900ebb59a74fe7b Mon Sep 17 00:00:00 2001 From: joshvera Date: Mon, 23 Apr 2018 19:33:07 -0400 Subject: [PATCH] Revert "Try catching ArithExceptions" This reverts commit 93fb061a3b99b6f8ea7ea3bb50104233bf900e14. --- src/Data/Syntax/Expression.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Data/Syntax/Expression.hs b/src/Data/Syntax/Expression.hs index 8abec2180..0ad4d5ad7 100644 --- a/src/Data/Syntax/Expression.hs +++ b/src/Data/Syntax/Expression.hs @@ -6,7 +6,6 @@ import Data.Abstract.Number (liftIntegralFrac, liftReal, liftedExponent, liftedF import Data.Fixed import Diffing.Algorithm import Prologue -import System.IO.Unsafe (unsafePerformIO) -- | Typical prefix function application, like `f(x)` in many languages, or `f x` in Haskell. data Call a = Call { callContext :: ![a], callFunction :: !a, callParams :: ![a], callBlock :: !a } @@ -61,7 +60,7 @@ instance Ord1 Arithmetic where liftCompare = genericLiftCompare instance Show1 Arithmetic where liftShowsPrec = genericLiftShowsPrec instance Evaluatable Arithmetic where - eval = traverse subtermValue >=> (\term -> unsafePerformIO (catch (pure $ go term) (\(_ :: ArithException) -> pure hole))) where + eval = traverse subtermValue >=> go where go (Plus a b) = liftNumeric2 add a b where add = liftReal (+) go (Minus a b) = liftNumeric2 sub a b where sub = liftReal (-) go (Times a b) = liftNumeric2 mul a b where mul = liftReal (*)