diff options
-rw-r--r-- | Unlambda/Interpreter.hs | 2 | ||||
-rw-r--r-- | Unlambda/Parser.hs | 23 |
2 files changed, 21 insertions, 4 deletions
diff --git a/Unlambda/Interpreter.hs b/Unlambda/Interpreter.hs index e5a442b..c9820f0 100644 --- a/Unlambda/Interpreter.hs +++ b/Unlambda/Interpreter.hs @@ -77,5 +77,3 @@ apply firstTerm secondTerm = Compare c -> return I --placeholder - Continuation cont -> return I --placeholder - diff --git a/Unlambda/Parser.hs b/Unlambda/Parser.hs index 7e578ad..948211d 100644 --- a/Unlambda/Parser.hs +++ b/Unlambda/Parser.hs @@ -19,9 +19,28 @@ data UnlambdaTerm = S | K | I | V | R | D | C | E | Bar | Reed | Kpartial UnlambdaTerm | Spartial UnlambdaTerm | Sapp UnlambdaTerm UnlambdaTerm - | Continuation UnlambdaTerm | Promise UnlambdaTerm - deriving (Eq, Show) + deriving (Eq) + + +instance Show UnlambdaTerm where + show S = "s" + show K = "k" + show I = "i" + show V = "v" + show R = "r" + show D = "d" + show C = "c" + show E = "e" + show Bar = "|" + show Reed = "@" + show (Dot x) = ['.', x] + show (Compare x) = ['?', x] + show (App x y) = "`" ++ (show x) ++ (show y) + show (Kpartial x) = "`k" ++ (show x) + show (Spartial x) = "`s" ++ (show x) + show (Sapp x y) = "``s" ++ (show x) ++ (show y) + show (Promise x) = "`d" ++ (show x) |