diff options
Diffstat (limited to 'src/Eval.hs')
-rw-r--r-- | src/Eval.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Eval.hs b/src/Eval.hs index 65db990..6b165b2 100644 --- a/src/Eval.hs +++ b/src/Eval.hs @@ -66,11 +66,15 @@ evalApp f g sub = Right f' -> fmap (Application f') <$> evalExp g sub ) +evalInfix :: Expression -> String -> Expression -> Environment -> Program (Failable Expression) +evalInfix le i re = evalExp $ Application (Application (Variable i) le) re + evalExp :: Expression -> Environment -> Program (Failable Expression) evalExp idx@(Bruijn _ ) = const $ pure $ Right idx evalExp ( Variable var) = evalVar var evalExp ( Abstraction e) = evalAbs e evalExp ( Application f g) = evalApp f g +evalExp (Infix le i re) = evalInfix le i re evalDefine :: String -> Expression -> Environment -> Program (Failable Expression) |