A little shifting exercise today:
```haskell shiftR :: [a] -> [a] shiftR xs = last xs : init xs shiftR [] = []
shiftL :: [a] -> [a] shiftL (x:xs) = xs ++ [x] shiftL [] = []
shiftBy :: ([a] -> [a]) -> [a] -> Int -> [a] shiftBy f xs n = head $ drop n $ iterate f xs
shiftByL :: [a] -> Int -> [a] shiftByL = shiftBy shiftL
shiftByR :: [a] -> Int -> [a] shiftByR = shiftBy shiftR ```
What's the development process?
With a few terminals open:
I do this:
:l shift
:r
after each editOnce things were working, I moved to clean up the style using hlint.
Good future additions: