
module Value where

import Data.List

data LispVal
    = Number Integer
    | String String
    | Bool Bool
    | Atom String
    | List [LispVal]
    | DottedList [LispVal] LispVal
    -- | Function [String] ([LispVal] -> LispVal)
    | Function [String] LispVal
    deriving (Eq, Show)
    -- deriving Eq

showVal (Number n) = show n
showVal (String s) = show s
showVal (Bool True) = "#t"
showVal (Bool False) = "#f"
showVal (Atom s) = s
showVal (List xs) = "(" ++ (concat $ intersperse " " $ map showVal xs) ++ ")"

