Hoogle Search
Within LTS Haskell 24.36 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
chunksOf :: Int -> Text -> [Text]text Data.Text O(n) Splits a Text into components of length k. The last element may be shorter than the other chunks, depending on the length of the input. Examples:
>>> chunksOf 3 "foobarbaz" ["foo","bar","baz"]
>>> chunksOf 4 "haskell.org" ["hask","ell.","org"]
chunksOf :: Int64 -> Text -> [Text]text Data.Text.Lazy O(n) Splits a Text into components of length k. The last element may be shorter than the other chunks, depending on the length of the input. Examples:
chunksOf 3 "foobarbaz" == ["foo","bar","baz"] chunksOf 4 "haskell.org" == ["hask","ell.","org"]
chunksOf :: Int -> Seq a -> Seq (Seq a)containers Data.Sequence chunksOf c xs splits xs into chunks of size c>0. If c does not divide the length of xs evenly, then the last element of the result will be short. Side note: the given performance bound is missing some messy terms that only really affect edge cases. Performance degrades smoothly from <math> (for <math>) to <math> (for <math>). The true bound is more like <math>
chunksOf :: Int -> Seq a -> Seq (Seq a)containers Data.Sequence.Internal chunksOf c xs splits xs into chunks of size c>0. If c does not divide the length of xs evenly, then the last element of the result will be short. Side note: the given performance bound is missing some messy terms that only really affect edge cases. Performance degrades smoothly from <math> (for <math>) to <math> (for <math>). The true bound is more like <math>
chunksOf :: forall (m :: Type -> Type) a . Monad m => Int -> ConduitT a [a] m ()conduit Data.Conduit.List Group a stream into chunks of a given size. The last chunk may contain fewer than n elements. Subject to fusion Since 1.2.9
chunksOf :: Int -> [e] -> [[e]]split Data.List.Split chunksOf n splits a list into length-n pieces. The last piece will be shorter if n does not evenly divide the length of the list. If n <= 0, chunksOf n l returns an infinite list of empty lists.
>>> chunksOf 3 [1..12] [[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
>>> chunksOf 3 "Hello there" ["Hel","lo ","the","re"]
>>> chunksOf 3 ([] :: [Int]) []
Note that chunksOf n [] is [], not [[]]. This is intentional, and satisfies the property thatchunksOf n xs ++ chunksOf n ys == chunksOf n (xs ++ ys)
whenever n evenly divides the length of xs.chunksOf :: Int -> [e] -> [[e]]split Data.List.Split.Internals chunksOf n splits a list into length-n pieces. The last piece will be shorter if n does not evenly divide the length of the list. If n <= 0, chunksOf n l returns an infinite list of empty lists.
>>> chunksOf 3 [1..12] [[1,2,3],[4,5,6],[7,8,9],[10,11,12]]
>>> chunksOf 3 "Hello there" ["Hel","lo ","the","re"]
>>> chunksOf 3 ([] :: [Int]) []
Note that chunksOf n [] is [], not [[]]. This is intentional, and satisfies the property thatchunksOf n xs ++ chunksOf n ys == chunksOf n (xs ++ ys)
whenever n evenly divides the length of xs.chunksOf :: Partial => Int -> [a] -> [[a]]extra Data.List.Extra Split a list into chunks of a given size. The last chunk may contain fewer than n elements. The chunk size must be positive.
chunksOf 3 "my test" == ["my ","tes","t"] chunksOf 3 "mytest" == ["myt","est"] chunksOf 8 "" == [] chunksOf 0 "test" == undefined
chunksOf :: Partial => Int -> [a] -> [[a]]extra Extra Split a list into chunks of a given size. The last chunk may contain fewer than n elements. The chunk size must be positive.
chunksOf 3 "my test" == ["my ","tes","t"] chunksOf 3 "mytest" == ["myt","est"] chunksOf 8 "" == [] chunksOf 0 "test" == undefined
chunksOf :: Int -> Seq a -> Seq (Seq a)rio RIO.Seq chunksOf c xs splits xs into chunks of size c>0. If c does not divide the length of xs evenly, then the last element of the result will be short. Side note: the given performance bound is missing some messy terms that only really affect edge cases. Performance degrades smoothly from <math> (for <math>) to <math> (for <math>). The true bound is more like <math>
Page 1 of many | Next