summaryrefslogtreecommitdiff
path: root/ast.hs
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-03-26 21:34:51 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-03-26 21:34:51 +0200
commit0e1f435314b382cb78056f04d0997df43e4f8fcf (patch)
tree8195b40c448cbbafc868a9727b6e1c218f26ca00 /ast.hs
parentc25979b76c1dd22b6dc33acb994e9044c56a68f9 (diff)
Rename files for case-sensitive file system
Diffstat (limited to 'ast.hs')
-rw-r--r--ast.hs46
1 files changed, 0 insertions, 46 deletions
diff --git a/ast.hs b/ast.hs
deleted file mode 100644
index eae5af8..0000000
--- a/ast.hs
+++ /dev/null
@@ -1,46 +0,0 @@
-module AST where
-
-import Data.List
-
-
-data Program = Program [Value]
-
-type Name = String
-
-data Value
- = VList [Value]
- | VNum Int
- | VString String
- | VName Name
- | VQuoted Value
- | VLambda [Name] Value
- | VBuiltin String
- | VEllipsis
- deriving (Eq)
-
-
-instance Show Program where
- show (Program l) = intercalate "\n" $ map show l
-
-instance Show Value where
- show (VList es) = '(' : intercalate " " (map show es) ++ ")"
- show (VNum i) = show i
- show (VString s) = show s
- show (VName n) = n
- show (VQuoted e) = '\'' : show e
- show (VLambda as v) = "(lambda (" ++ intercalate " " as ++ ") " ++ show v ++ ")"
- show (VBuiltin str) = "[[builtin " ++ str ++ "]]"
- show VEllipsis = "..."
-
-
-fromVName :: Value -> Maybe Name
-fromVName (VName s) = Just s
-fromVName _ = Nothing
-
-fromVNum :: Value -> Maybe Int
-fromVNum (VNum i) = Just i
-fromVNum _ = Nothing
-
-fromVString :: Value -> Maybe String
-fromVString (VString s) = Just s
-fromVString _ = Nothing