-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Allows to split lists into sublists with some patterns by quantity. -- -- These patterns can be a list of numbers, or obtained from the monadic -- or applicative function. Leads to somewhat cycling or regularized -- structures from the length perspective (these ones can be transformed -- into other variativity types). @package sublists @version 0.2.0.1 -- | Allows to split lists into sublists with some patterns by quantity. module Data.List.CyclingSublists -- | Splits the input second argument into sublists each one containing the -- n elements where the number is taken as the sequential -- element in the first argument starting from the left to the right. If -- the number is less than 1 then the corresponding sublist is empty. If -- all the elements in the first argument are less than 1 then returns an -- infinite lazy list of [] as its elements (probably not the needed -- case). When all the elements of the first argument ends and there are -- elements in the second argument being not already processed then the -- function reinitializes itself with the prior first argument and the -- rest of the unprocessed elements in the second argument. This leads to -- the *cycling behaviour*. -- -- Similar functions are in the list-grouping and split -- packages, but they do not have cycling behaviour and have another -- realization. intoRegularSublists :: [Int] -> [a] -> [[a]] -- | A monadic variant of the intoRegularSublists where the first -- argument is taken from the monadic function. intoRegularSublistsM :: Monad m => (a -> m [Int]) -> a -> [b] -> m [[b]] -- | An Applicative variant of the intoRegularSublists where -- the first argument is taken from the applicative function. intoRegularSublistsA :: Applicative f => (a -> f [Int]) -> a -> [b] -> f [[b]]