Questions tagged [streamly]

4 questions
1
vote
1 answer

Writing into a file in a streaming way and stop when we reach a given memory file size

Let's say I want to save a stream of MyItem into a file (in JSON for example). I would like to stop when the file reach a certain size limit in bytes. I would like to do it in Haskell... streaming is not the issue for me it's more how to get the…
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
1
vote
1 answer

Consuming infinite monadic streams with Streamly

I've got a function which produces an infinite list of monadic actions (HTTP calls in my case), something like this: getStream = foldMap makeHttpCall [1..] where makeHttpCall bookId = ... I'd like to be able to use this function like…
zoran119
  • 10,657
  • 12
  • 46
  • 88
0
votes
1 answer

GroupBy of stream by agreggateId (Haskell / concurrency streaming)

Context : I'm implementing an App in CQRS and I'm trying to optimize the processing of commands (1 stream by aggregate Id basically)... Problem : I would like to have a first stream that receives all the commands and dispatches these ones by their…
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
0
votes
1 answer

Composing streamly streams of different types

As per the streamly tutorial, it is possible to combine different streams using <> operator (re-exported from Semigroup by streamly) like this: runStream $ ((readLn :: IO Int) |: nil) <> ((readLn :: IO Int) |: nil) & S.mapM print However, I'd like…
zoran119
  • 10,657
  • 12
  • 46
  • 88