Replace individual list elements in Haskell?
Typically, you modify elements of a list by splitting the list, replacing an element, and joining it back together. To split a list at an index, we have: splitAt :: Int -> [a] -> ([a], [a]) which you can use to break up a list, like so: > splitAt 2 [“Off”,”Off”,”Off”,”Off”] ([“Off”,”Off”],[“Off”,”Off”]) now you just … Read more