aboutsummaryrefslogtreecommitdiffstats
path: root/src/Builtins.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-06 11:44:31 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-06 11:52:57 +0200
commit75dd3bb463b427d733eb368a8c176c1e04e9c26e (patch)
treef6371ce0dafaf44d764da6a55bcc7e03ba3589cd /src/Builtins.hs
parent36d664319b20ad18bcee6a46fe9943c4434848e1 (diff)
Implement set functions on records
Diffstat (limited to 'src/Builtins.hs')
-rw-r--r--src/Builtins.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Builtins.hs b/src/Builtins.hs
index dc80db4..843faa7 100644
--- a/src/Builtins.hs
+++ b/src/Builtins.hs
@@ -34,6 +34,7 @@ builtinEnv = M.fromList [
("_", makeNonsenseAST ASTHole),
("otherwise", makeNonsenseAST ASTHole),
builtinFatal,
+ builtinKind,
-- reserved keywords
reservedKeyword "\\",
reservedKeyword "let!",
@@ -230,3 +231,10 @@ builtinFatal = (name, makeNonsenseAST $ ASTFunction False fn1) where
throwL (astPos ast1) $ str
fn1 ast1 =
throwL (astPos ast1) $ argError1 name ast1
+
+builtinKind :: (String, AST)
+builtinKind = (name, makeNonsenseAST $ ASTFunction True fn1) where
+ name = "kind"
+ fn1 AST { astNode = ASTRecord identifier _} =
+ return $ makeNonsenseAST $ ASTString identifier
+ fn1 ast1 = throwL (astPos ast1) $ argError1 name ast1