From b388d53e751db6d925a39c06dc871c125799b8e5 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 13 Jan 2018 23:40:49 +0000 Subject: [PATCH] Add LispVal data type which can hold any Lisp value LispVal is an algebraic type which is able to hold any of the types given. Not sure what the type of `DottedList` is meant to be. --- app/Main.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Main.hs b/app/Main.hs index 8520891..c64fd18 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -2,6 +2,13 @@ module Main where import Text.ParserCombinators.Parsec hiding (spaces) import System.Environment +data LispVal = Atom String + | List [LispVal] + | DottedList [LispVal] LispVal + | Number Integer + | String String + | Bool Bool + symbol :: Parser Char symbol = oneOf "!#$%&|*+-/:<=>?@^_~" -- 2.48.1