All pastes #754984 Raw Edit

ddvlad

public text v1 · immutable
#754984 ·published 2007-10-30 11:09 UTC
rendered paste body
parseString :: String -> Int -> Int -> [String]
parseString [] _ _ = []
parseString s nr k = (rotL (take nr s) k) : (parseString (drop nr s) nr k)

rotL :: String -> Int -> String
rotL s 0 = s
rotL s k = rotL aux (k-1)
        where aux = rotL' s

rotL' :: String -> String
rotL' [] = []
rotL' (s:ss) = ss ++ [s]