diff options
Diffstat (limited to 'src/Eval.hs')
-rw-r--r-- | src/Eval.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Eval.hs b/src/Eval.hs index 6b165b2..445e41d 100644 --- a/src/Eval.hs +++ b/src/Eval.hs @@ -67,7 +67,10 @@ evalApp f g sub = ) evalInfix :: Expression -> String -> Expression -> Environment -> Program (Failable Expression) -evalInfix le i re = evalExp $ Application (Application (Variable i) le) re +evalInfix le i re = evalExp $ Application (Application (Variable $ "(" ++ i ++ ")") le) re + +evalPrefix :: String -> Expression -> Environment -> Program (Failable Expression) +evalPrefix p e = evalExp $ Application (Variable $ p ++ "(") e evalExp :: Expression -> Environment -> Program (Failable Expression) evalExp idx@(Bruijn _ ) = const $ pure $ Right idx @@ -75,6 +78,7 @@ 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 +evalExp (Prefix p e) = evalPrefix p e evalDefine :: String -> Expression -> Environment -> Program (Failable Expression) |