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.

  1. chunksOf :: Int -> Text -> [Text]

    rio RIO.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"]
    

  2. chunksOf :: Int64 -> Text -> [Text]

    rio RIO.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"]
    

  3. chunksOf :: forall (m :: Type -> Type) (f :: Type -> Type) r . (Monad m, Functor f) => Int -> Stream f m r -> Stream (Stream f m) m r

    streaming Streaming

    Break a stream into substreams each with n functorial layers.

    >>> S.print $ mapped S.sum $ chunksOf 2 $ each [1,1,1,1,1]
    2
    2
    1
    

  4. chunksOf :: forall (m :: Type -> Type) (f :: Type -> Type) r . (Monad m, Functor f) => Int -> Stream f m r -> Stream (Stream f m) m r

    streaming Streaming.Internal

    Break a stream into substreams each with n functorial layers.

    >>> S.print $ mapped S.sum $ chunksOf 2 $ each [1,1,1,1,1]
    2
    2
    1
    

  5. chunksOf :: forall (m :: Type -> Type) n x . (Monad m, Integral n) => n -> Lens' (Producer ByteString m x) (FreeT (Producer ByteString m) m x)

    pipes-bytestring Pipes.ByteString

    Split a byte stream into FreeT-delimited byte streams of fixed size

  6. chunksOf :: Int -> JSString -> [JSString]

    jsaddle Data.JSString

    O(n) Splits a JSString 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"]
    

  7. chunksOf :: Int -> NESeq a -> NESeq (NESeq a)

    nonempty-containers Data.Sequence.NonEmpty

    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. Is only defined if c is a positive number. 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>

  8. chunksOf :: forall (m :: Type -> Type) a' x a . Monad m => Int -> Lens (Producer a' m x) (Producer a m x) (FreeT (Producer a' m) m x) (FreeT (Producer a m) m x)

    pipes-group Pipes.Group

    chunksOf is an splits a Producer into a FreeT of Producers of fixed length

    chunksOf n  :: Monad m => Lens' (Producer a m x) (Groups a m x)
    view (chunksOf n) :: Monad m => Splitter a m x
    set  (chunksOf n) :: Monad m => Groups a m x -> Producer a m x -> Producer a m x
    over (chunksOf n) :: Monad m => Transformation a m x -> Producer a m x -> Producer a m x
    
    >>> import Lens.Family (view)
    
    >>> import Pipes (yield, each)
    
    >>> import Pipes.Prelude (toList)
    
    >>> (toList . intercalates (yield '|') . view (chunksOf 3)) (each "12233345")
    "122|333|45"
    

  9. chunksOf :: forall (m :: Type -> Type) a b c . Monad m => Int -> Fold m a b -> Fold m b c -> Fold m a c

    streamly-core Streamly.Data.Fold

    Deprecated: Please use groupsOf instead

  10. chunksOf :: forall (m :: Type -> Type) a . (MonadIO m, Unbox a) => Int -> Stream m a -> Stream m (Array a)

    streamly-core Streamly.Data.Stream

    chunksOf n stream groups the elements in the input stream into arrays of n elements each. Same as the following but may be more efficient:

    >>> chunksOf n = Stream.foldMany (Array.writeN n)
    
    Pre-release

Page 2 of many | Previous | Next