home.social

#catseffect — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #catseffect, aggregated by home.social.

  1. Моки без боли

    Моки — достаточно крутой инструмент, если использовать его правильно. И все-таки лично для меня писать и поддерживать тесты на моках всегда было отдельным видом боли. Думаю, все знакомы с ситуацией: добавил в метод новый аргумент — и пошёл в 30 тест-кейсов проставлять заглушки. И это только от одного нового аргумента. И я не буду здесь спорить о терминологии — в этой статье я буду называть все тестовые дублёры «моками». Примеры будут на Scala, но моки в других языках работают похожим образом, так что боль универсальная. Как и решение — об этом в статье.

    habr.com/ru/articles/1030834/

    #scala #scalamock #zio #catseffect #тестирование #моки #стабы #моктестирование #юниттестирование

  2. Моки без боли

    Моки — достаточно крутой инструмент, если использовать его правильно. И все-таки лично для меня писать и поддерживать тесты на моках всегда было отдельным видом боли. Думаю, все знакомы с ситуацией: добавил в метод новый аргумент — и пошёл в 30 тест-кейсов проставлять заглушки. И это только от одного нового аргумента. И я не буду здесь спорить о терминологии — в этой статье я буду называть все тестовые дублёры «моками». Примеры будут на Scala, но моки в других языках работают похожим образом, так что боль универсальная. Как и решение — об этом в статье.

    habr.com/ru/articles/1030834/

    #scala #scalamock #zio #catseffect #тестирование #моки #стабы #моктестирование #юниттестирование

  3. Моки без боли

    Моки — достаточно крутой инструмент, если использовать его правильно. И все-таки лично для меня писать и поддерживать тесты на моках всегда было отдельным видом боли. Думаю, все знакомы с ситуацией: добавил в метод новый аргумент — и пошёл в 30 тест-кейсов проставлять заглушки. И это только от одного нового аргумента. И я не буду здесь спорить о терминологии — в этой статье я буду называть все тестовые дублёры «моками». Примеры будут на Scala, но моки в других языках работают похожим образом, так что боль универсальная. Как и решение — об этом в статье.

    habr.com/ru/articles/1030834/

    #scala #scalamock #zio #catseffect #тестирование #моки #стабы #моктестирование #юниттестирование

  4. Моки без боли

    Моки — достаточно крутой инструмент, если использовать его правильно. И все-таки лично для меня писать и поддерживать тесты на моках всегда было отдельным видом боли. Думаю, все знакомы с ситуацией: добавил в метод новый аргумент — и пошёл в 30 тест-кейсов проставлять заглушки. И это только от одного нового аргумента. И я не буду здесь спорить о терминологии — в этой статье я буду называть все тестовые дублёры «моками». Примеры будут на Scala, но моки в других языках работают похожим образом, так что боль универсальная. Как и решение — об этом в статье.

    habr.com/ru/articles/1030834/

    #scala #scalamock #zio #catseffect #тестирование #моки #стабы #моктестирование #юниттестирование

  5. Cats-Effect 3.6.0 is a very exciting release due to the work on its internal work scheduler, many congrats to its contributors! ❤️

    github.com/typelevel/cats-effe

    #Scala #CatsEffect #FP

  6. @alexelcu

    #Scala #CatsEffect #FP yep! And thanks @djspiewak for the release notes, they are always very well written

  7. Cats-Effect 3.6.0-RC1 comes with some very exciting changes ❤️ Congrats to the team, they keep delivering 😍

    #Scala #CatsEffect #FP

    github.com/typelevel/cats-effe

  8. @tymwol

    #Scala it's that (and there's a lot of them), and also more. I think scala pushed the state of art regarding effect system, and things like #catseffect (more "Haskell inspired") and #zio (more "a Scala own thing") are quite amazing.
    And #scala3 has really impressive things regarding types (see for ex #iron social.treehouse.systems/@fanf)

  9. Monadic effect systems (IO) are great, but they'll never be the (de jure) standard, as #Scala has Java's evaluation model and calling conventions.

    The current standard for APIs doing I/O is `Future`. I'd rather have blocking I/O; easier to integrate w/ #CatsEffect, too.

  10. Let’s reveal another surprise talk… Here’s @alexelcu presenting concurrency concepts of the JVM, sprinkled with some Cats-Effect utilities.

    #scalarconf #catseffect

  11. On #Scala's #CatsEffect library — one common myth is that it's a library built for “tagless final” (TF).

    While it's true that it gives you unparalleled ability to use TF and monad transformer stacks, it's perfectly usable without. Most libraries from #Typelevel are.

  12. I created a #chatgpt #Scala Cats Effect Tutor for fun take a look all:

    https://chat.openai.com/g/g-anUfWL8Ty-scala-cats-effect-tutor

    Feedback to make it better appreciated. I will be iterating on it, this is just an initial attempt.

    Have fun all!

    #Typelevel #catseffect

    cc @typelevel

  13. #CatsEffect or #ZIO - is there a library that beats another in this duel? Learn the differences, similarities, philosophy behind them both, and core features of those #Scala libraries and choose your favourite tool: softwaremill.com/cats-effect-v

  14. Note these are just minor pet peeves, it's just that FP folks often get too hung up on correctness.

    OTOH #Typelevel #CatsEffect is a wonderful project, being #Scala's secret weapon.

  15. Currently, I am using a Cofree like DirTree data structure in #Akka to keep track of the actors responsible for a given resource so that we can send HTTP messages directly to them.
    ```scala
    case class DirTree[R](
    ref: R,
    kids: HashMap[String, DirTree[R, A]] = HashMap()
    ):
    ```
    github.com/co-operating-system

    I am synchronizing that with a #Java AtomicReference currently. I wonder if @alexelcu setup would make it easier to use a #CatsEffect Ref. One thing I had been thinking of is of wrapping the children in a `Ref` so that one would need to update only parts of the subtree if needed.

    ```scala
    case class DirTree[R](
    data: R,
    kids: Ref[HashMap[String, DirTree[R]]]
    ):
    ```
    pluralsight.com/tech-blog/scal

    By the way it should be quite easy to see why DirTree is just the Cofree Commonad with
    ```scala
    type DirTree[A] = Cofree[Map[String,?],A]
    ```
    But I can't quite see the advantages of using the Cofree right now.
    typelevel.org/cats/api/cats/fr

  16. "Integrating #akka with #catseffect 3" is a blog post by
    @alexelcu
    alexn.org/blog/2023/04/17/inte
    This is relevant to me as my Reactive-Solid Server uses both Akka and Cats effects. My integration with Akka is very basic, though, at present.
    I was wondering where else IO might be more useful in Akka. Would it be better to read and write files, for example?

    github.com/co-operating-system
    I use cats-effect because I developed an HTTP-sig library that I need for clients and servers. It uses IO for signatures and for fetching the public key that signs the HTTP headers. github.com/bblfish/httpSig

    At some point, I would like to extract some core libraries from Reactive Solid that could be used more easily with other frameworks. But I only have so much time... #scala

  17. Having a blast coding using :scala: , and on a side project on this fine hot Saturday in the :scala:

  18. An interesting fact about #Kotlin's coroutines is that `Dispatcher.IO` is limited. This, compared to the general advice in #Scala land, to use an unlimited thread-pool for blocking I/O. E.g., #CatsEffect's thread-pool for blocking I/O is unlimited.

    github.com/Kotlin/kotlinx.coro

    The reasoning they give is that too many threads can make the app really slow. Which is true, but then again, having a limit can lead to thread starvation & deadlocks, e.g…

    gist.github.com/alexandru/e8ea

  19. My deep dive into #Kotlin's coroutines continues 😊 Here I learned that we can have a function similar to `IO.uncancelable` from #CatsEffect:

    gist.github.com/alexandru/7527

    The implementation for it is surprisingly short because, as it turns out, Kotlin uses `CoroutineContext` like some sort of mask that's compatible with the design of `IO.cancelable`:

    github.com/nomisRev/arrow-fx-c

    I'm unsure if there are any gotchas, apart from the one I learned about `withContext`.

  20. #Kotlin's coroutines are cool, but when compared with #Scala's offering, an underappreciated feature of #CatsEffect 3 is the very thoughtful and consistent treatment of cancellation and resource handling.

    Kotlin's coroutines are error-prone for the same reason they are great … you can't visually discern “suspended” function calls from blocking calls, the problem being that correctness relies on needing to make suspended calls non-cancellable for acquisition and release…

    github.com/Kotlin/kotlinx.coro

  21. Concurrency is hard... Check an introductory level tutorial of concurrency features provided by Cats Effect

    #catseffect #concurrency #fiber

    softwaremill.com/concurrency-w

  22. Integrating #Akka and #CatsEffect 3 isn't without challenges, but the awesomeness of managing resources via Cats-Effect makes it all worth it, being #Scala's secret weapon.

    I wrote a blog post describing some integration solutions we use for building payment processors. #FP #programming to the max 💪

    Please share 🙏🥺

    alexn.org/blog/2023/04/17/inte

  23. Catapult is Typelevel's newest project. It provides a Cats-Effect wrapper around the LaunchDarkly SDK for feature flag management.

    github.com/typelevel/catapult/

  24. First public release of otel4s, an OpenTelemetry implementation for Cats Effect. otel4s aims to be a full and faithful impemenation of the OpenTelemetry Specification, built for the idioms of the Typelevel ecosystem.

    github.com/typelevel/otel4s/di

    #Otel4s #Typelevel #Scala #OpenTelemetry #CatsEffect

  25. First public release of otel4s, an OpenTelemetry implementation for Cats Effect. otel4s aims to be a full and faithful impemenation of the OpenTelemetry Specification, built for the idioms of the Typelevel ecosystem.

    github.com/typelevel/otel4s/di

    #Otel4s #Typelevel #Scala #OpenTelemetry #CatsEffect

  26. First public release of otel4s, an OpenTelemetry implementation for Cats Effect. otel4s aims to be a full and faithful impemenation of the OpenTelemetry Specification, built for the idioms of the Typelevel ecosystem.

    github.com/typelevel/otel4s/di

    #Otel4s #Typelevel #Scala #OpenTelemetry #CatsEffect

  27. First public release of otel4s, an OpenTelemetry implementation for Cats Effect. otel4s aims to be a full and faithful impemenation of the OpenTelemetry Specification, built for the idioms of the Typelevel ecosystem.

    github.com/typelevel/otel4s/di

    #Otel4s #Typelevel #Scala #OpenTelemetry #CatsEffect

  28. First public release of otel4s, an OpenTelemetry implementation for Cats Effect. otel4s aims to be a full and faithful impemenation of the OpenTelemetry Specification, built for the idioms of the Typelevel ecosystem.

    github.com/typelevel/otel4s/di

    #Otel4s #Typelevel #Scala #OpenTelemetry #CatsEffect

  29. Hey folks, I'm writing an article on the topic related to best practices for using Scala functional libraries: cats, cats-effect. Does anyone want to team up? You folks are all experienced here, and we could write something beneficial for the community together that ChatGPT won't.