This commit is contained in:
Rowan Torbitzky-Lane 2025-01-19 20:56:34 -06:00
parent d67ed6a821
commit 6dbf4e7905

View File

@ -81,7 +81,6 @@ deleteAt idx xs = take idx xs <> drop 1 (drop idx xs)
-- Is this optimal? Running instrucitonYankDup twice?????
-- int non generic too
instructionYank :: forall a. State -> Lens' State [a] -> State
-- instructionYank state accessor = instructionYankDup state accessor & accessor .~ init (view accessor (instructionYankDup state accessor))
instructionYank state@(State {_int = rawIndex : _}) accessor =
let
myIndex :: Int
@ -98,6 +97,7 @@ combineTuple :: a -> ([a], [a]) -> [a]
combineTuple val tup = fst tup <> [val] <> snd tup
-- int non generic :(
-- Rewrite this eventually?
instructionShoveDup :: State -> Lens' State [a] -> State
instructionShoveDup state@(State {_int = i : is}) accessor =
if notEmptyStack state accessor