diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-12-17 22:30:06 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-12-17 22:30:06 +0100 |
commit | 594ecf396cad8a38aac168062249ab3361c5b558 (patch) | |
tree | 8852897cfbfd8cf7bcda97760c7cfa4f000cc762 /old/stdlib.hs | |
parent | ef9684b0bf2780800ae3349819239e4f0a0c9c25 (diff) |
Move old things out of the way
Diffstat (limited to 'old/stdlib.hs')
-rw-r--r-- | old/stdlib.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/old/stdlib.hs b/old/stdlib.hs new file mode 100644 index 0000000..6f7334f --- /dev/null +++ b/old/stdlib.hs @@ -0,0 +1,16 @@ +module Stdlib(stdlib) where + +import AST +import Parser + + +stdlib :: Program +stdlib = fromRight $ parseProgram + "(define not (x) (= x 0))\n\ + \(define id (x) x)\n\ + \(define nil (x) (= x '()))\n\ + \(define . (f g) (lambda (x) (f (g x))))\n" + +fromRight :: Show a => Either a b -> b +fromRight (Right b) = b +fromRight (Left a) = error $ "fromRight on Left: " ++ show a |