📜  haskell roatate list - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:02.531000             🧑  作者: Mango

代码示例1
rotate :: Int -> [a] -> [a]
rotate _ [] = []
rotate n xs = zipWith const (drop n (cycle xs)) xs