From 28ab4a097fb73a138850a3fb7f6e480765c702ee Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 18 Feb 2023 17:19:09 +1300 Subject: Add STRCAT, update fizzbuzz --- DSL/Intrinsics.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'DSL/Intrinsics.hs') 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 -- cgit v1.2.1