From 594ecf396cad8a38aac168062249ab3361c5b558 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Sun, 17 Dec 2017 22:30:06 +0100 Subject: Move old things out of the way --- old/stdlib.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 old/stdlib.hs (limited to 'old/stdlib.hs') 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 -- cgit v1.2.3-54-g00ecf