Question : haskell roatate list
Answered by : disturbed-dotterel-8wf7jw9e8kl4
rotate :: Int -> [a] -> [a]
rotate _ [] = []
rotate n xs = zipWith const (drop n (cycle xs)) xs
Source : https://stackoverflow.com/questions/16378773/rotate-a-list-in-haskell | Last Update : Fri, 17 Dec 21