X-Git-Url: https://git.rmz.io/my-scheme.git/blobdiff_plain/200ca1efa940b94af2099828c36d6580addb6de9..HEAD:/app/Main.hs?ds=inline diff --git a/app/Main.hs b/app/Main.hs index 996f921..78f37ea 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -11,7 +11,6 @@ data LispVal = Atom String | String String | Character Char | Bool Bool - deriving Show symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" @@ -96,6 +95,7 @@ readExpr input = case parse parseExpr "lisp" input of Left err -> "No match: " ++ show err Right val -> "Found value: " ++ showVal val +instance Show LispVal where show = showVal showVal :: LispVal -> String showVal (Atom atom) = atom showVal (List list) = "(" ++ unwordsList list ++ ")"