Code Monkey home page Code Monkey logo

Comments (5)

djspiewak avatar djspiewak commented on August 28, 2024

https://github.com/typelevel/cats/blob/master/core/src/main/scala/cats/syntax/applicativeError.scala#L35-L36

:-) It already exists. It just comes via ApplicativeError.

from cats-effect.

Daenyth avatar Daenyth commented on August 28, 2024

Documentation to that effect would be good. The typelevel blog post didn't cover it at all.

from cats-effect.

Daenyth avatar Daenyth commented on August 28, 2024

For discoverability it would be really good for that to be a method on the IO class too, so that IDE autocomplete picks it up.

from cats-effect.

djspiewak avatar djspiewak commented on August 28, 2024

There's no question that having this function on IO would help discoverability, and not just for people who use IDEs. I knew the function existed and I still had to go spelunking through a few files to find it.

There's a fine line here. Clearly it's impossible for us to document all of the dozens and dozens of functions which are materialized implicitly on IO, nor is it reasonable to put all of them directly on the type. So it's not clear to me where the line is and how we can decide one versus the other.

An easy distinction is of course performance. If we can get a higher performing implementation than the generic one, then an implementation on the type makes sense. But I don't know if just discoverability alone is strong enough, seeing as that would apply to a truly impractical number of functions which would then be very difficult to maintain.

from cats-effect.

Daenyth avatar Daenyth commented on August 28, 2024

A reasonable middle ground would be if the doc page could auto generate docs as if they were instance methods, and just a note of what to import to get it

from cats-effect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.