diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2019-11-14 17:31:23 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-11-14 17:32:14 +0100 |
commit | 551f74a3f77d5f0b7b5221fa38ef67df5790083f (patch) | |
tree | 74fb6f6b985173f6c304bfae0961892e7e4f4ddb /AST.hs | |
parent | d3a9d62b5866771489cdc9f4e0fced3e7845eb9c (diff) |
Implement 'let'
Diffstat (limited to 'AST.hs')
-rw-r--r-- | AST.hs | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -14,6 +14,7 @@ data Value | VName Name | VQuoted Value | VLambda [Name] Value + | VLet [(Name, Value)] Value | VBuiltin String | VEllipsis deriving (Eq) @@ -29,6 +30,7 @@ instance Show Value where show (VName n) = n show (VQuoted e) = '\'' : show e show (VLambda as v) = "(lambda (" ++ intercalate " " as ++ ") " ++ show v ++ ")" + show (VLet ps v) = "(let (" ++ intercalate " " ["(" ++ n ++ " " ++ show w ++ ")" | (n, w) <- ps] ++ ") " ++ show v ++ ")" show (VBuiltin str) = "[[builtin " ++ str ++ "]]" show VEllipsis = "..." |