From 75dd3bb463b427d733eb368a8c176c1e04e9c26e Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 6 Dec 2022 11:44:31 +0200 Subject: Implement set functions on records --- src/Builtins.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Builtins.hs') 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 -- cgit v1.3