From 804da2a23c08a4b9f8e0f9046a1a22d3b13699c2 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Sat, 25 Jan 2025 19:09:10 -0600 Subject: [PATCH] takeR and dropR --- src/Instructions/GenericInstructions.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Instructions/GenericInstructions.hs b/src/Instructions/GenericInstructions.hs index 561ff77..8f945a1 100644 --- a/src/Instructions/GenericInstructions.hs +++ b/src/Instructions/GenericInstructions.hs @@ -44,6 +44,12 @@ amtOccurences fullA subA = amtOccurences' fullA subA 0 then amtOccurences' (replace fA sA mempty (Just 1)) sA (count + 1) else count +takeR :: Int -> [a] -> [a] +takeR amt fullA = drop (length fullA - amt) fullA + +dropR :: Int -> [a] -> [a] +dropR amt fullA = take (length fullA - amt) fullA + combineTuple :: a -> ([a], [a]) -> [a] combineTuple val tup = fst tup <> [val] <> snd tup