summaryrefslogtreecommitdiff
path: root/DSL/Intrinsics.hs
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-02-18 17:19:09 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-02-18 17:19:09 +1300
commit28ab4a097fb73a138850a3fb7f6e480765c702ee (patch)
tree2521dcbff013b670caec4b5b8de0eac8a0f150cc /DSL/Intrinsics.hs
parent8c33b3d2c69b6800ca34155d62c000250980e47e (diff)
Add STRCAT, update fizzbuzz
Diffstat (limited to 'DSL/Intrinsics.hs')
-rw-r--r--DSL/Intrinsics.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/DSL/Intrinsics.hs b/DSL/Intrinsics.hs
index 72bee4f..ecb0fad 100644
--- a/DSL/Intrinsics.hs
+++ b/DSL/Intrinsics.hs
@@ -91,6 +91,13 @@ or' = binBoolean "OR" $ \ x y -> [x || y]
xor :: StackModifier
xor = binBoolean "XOR" $ \ x y -> [x /= y]
+strcat :: StackModifier
+strcat = StackModifier { smName="STRCAT", smTypes=ts, smFunc=f }
+ where
+ ts = [tString, tString]
+ f (StackString x:StackString y:xs) = return $ StackString (x ++ y):xs
+ f _ = unreachable
+
equal :: StackModifier
equal = StackModifier { smName="EQUAL", smTypes=ts, smFunc=f }
where