homepage: ''
changelog-type: markdown
hash: e0aee781d8f43c551b09b5918d3527c360068840c80308a03d45484c249c187b
test-bench-deps:
  streaming: -any
  base: '>=4.7 && <5'
  hspec: -any
  streaming-nonempty: -any
maintainer: paolo.veronelli@gmail.com
synopsis: Add support for non empty streams to Streaming lib
changelog: |
  # Changelog for streaming-nonempty

  ## Unreleased changes
basic-deps:
  streaming: -any
  base: '>=4.7 && <5'
all-versions:
- 0.1.0.0
author: Paolo Veronelli
latest: 0.1.0.0
description-type: markdown
description: "# streaming-nonempty\n\nA correct _groupBy_ function is expected to
  produce only non-empty groups, which means we should be able to fold them up with
  only Semigroup constraint on the values. This is not the case for `Data.List.groupBy`
  as well for the Streaming lib counterpart.\n\nThis package export a _groupBy_ function
  that produce `f (Stream f m a)` groups which are then guaranteed to have the functorial
  layer.\n\nThe `NEStream (Of a) m r` newtype is supporting _sconcat_ which means
  we can define\n\n```haskell\n\ngroupSemigroupBy :: (Semigroup a, Monad m) => (a
  -> a -> Bool) -> Stream (Of a) m r -> Stream (Of a) m r\ngroupSemigroupBy f = S.mapped
  sconcat . groupBy f\n\n```\n\nwith expected behavior to collapse groups using semigroup
  composition\n\nIn contrast using the standard _groupBy_ we are stuck with \n\n```haskell\n\ngroupMonoidBy
  :: (Monoid a, Monad m) => (a -> a -> Bool) -> Stream (Of a) m r -> Stream (Of a)
  m r\ngroupMonoidBy f = S.mapped mconcat . groupBy f\n\n```\n\nIt would be legit
  to use an `sconcatUnsafe` that would panic on empty streams because *we know* groups
  are not empty. "
license-name: BSD-3-Clause

Update from Hackage at 2021-03-20T17:54:17Z
Update from Hackage at 2021-03-20T17:54:17Z
