Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 16 05:24
    scala-steward opened #42
  • Jan 08 09:24
    scala-steward opened #41
  • Jan 07 20:22
    scala-steward opened #40
  • Dec 26 2019 19:02

    etorreborre on master

    Update sbt to 1.3.6 Merge pull request #39 from sca… (compare)

  • Dec 26 2019 19:02
    etorreborre closed #39
  • Dec 26 2019 19:02

    etorreborre on master

    Update sbt-pgp to 2.0.1 Merge pull request #38 from sca… (compare)

  • Dec 26 2019 19:02
    etorreborre closed #38
  • Dec 26 2019 18:19
    scala-steward opened #39
  • Dec 17 2019 20:53
    scala-steward opened #38
  • Dec 14 2019 08:29

    etorreborre on master

    Update sbt to 1.3.5 Merge pull request #37 from sca… (compare)

  • Dec 14 2019 08:29
    etorreborre closed #37
  • Dec 14 2019 01:51
    scala-steward opened #37
  • Nov 29 2019 13:46
    trobert closed #35
  • Nov 29 2019 13:46
    trobert commented #35
  • Nov 29 2019 13:44
    trobert commented #36
  • Nov 29 2019 13:04
    etorreborre commented #36
  • Nov 29 2019 06:49

    etorreborre on ORIGAMI-6.0.0

    (compare)

  • Nov 29 2019 06:49

    etorreborre on ORIGAMI-6.0.1

    published 6.0.1 (compare)

  • Nov 28 2019 22:17
    etorreborre commented #36
  • Nov 28 2019 22:17

    etorreborre on master

    added preFilter and other input… Merge pull request #36 from tro… (compare)

Gabriel Volpe
@gvolpe
Hi @etorreborre I saw there's an fs2 package with some functions to integrate with origami's Fold. I came up with an alternative way to write scanEval, would you take a PR? I haven't bechmarked it but rather focused on a pure functional implementation on top of Ref which is quite optimized
def scanEval[F[_]: Sync, S, A](p: Stream[F, A])(start: F[S])(f: (S, A) => F[S]): Stream[F, S] = {

  def zipper(ref: Ref[F, S]): Stream[F, S] =
    p.zip(Stream.eval(ref.get).repeat).evalMap { case (a, s) =>
      for {
        ns <- f(s, a)
        _  <- ref.set(ns)
      } yield ns
    }

  for {
    st  <- Stream.eval(start)
    ref <- Stream.eval(Ref.of[F, S](st))
    rs  <- zipper(ref)
  } yield rs
}
Eric Torreborre
@etorreborre
yes go for it
Gabriel Volpe
@gvolpe
Great, thank you! Folds are awesome :heart:
Eric Torreborre
@etorreborre
yep I love them too :-)
Gabriel Volpe
@gvolpe
Here -> #8 , will read any comments tomorrow :smile:
Sanjeev Singh
@Sanji515
Hello I'm new here. How to start
Please guide me.
Eric Torreborre
@etorreborre
@Sanji515 my first question is “what’s your use case?”. You generally use origami when you have a “stream” of data (with fs2 stream for example) and if you want to “collect/aggregate/sink” this data. This can be done by creating “folds” which have the nice property of being composable so that 2 “folds” can be stitched together to form a larger “fold” operating on your stream. So if you have a small example of a stream you want to process we could start from there