Giter VIP home page Giter VIP logo

Comments (3)

pakoito avatar pakoito commented on August 27, 2024

Option's MonadError only works with Unit error types, as we saw early on that it cannot be implemented by a lossy constructors that'd throw that String or any other error type away. It won't pass the MonadError tests.

from arrow-core.

 avatar commented on August 27, 2024

Thanks for answering that quick.

When you mean

as we saw early on that it cannot be implemented by a lossy constructors

where that has been describe?

Also I am sorry as new to arrow I am not understanding the

Option's MonadError only works with Unit error types

Could you please provide an example based on the code I put above for being clearer.

Thanks in advance

from arrow-core.

pakoito avatar pakoito commented on August 27, 2024

Could you please provide an example based on the code I put above for being clearer.

This is what Option would work with:

private val objectGateway: objectGateway = object : ObjectGateway {

  override fun <F> getObject1(number: String, ME: MonadError<F, Unit>): Kind<F, String> {
    return ME.just("NUMBER")
  }

  override fun <F> getObject2(number: String, anotherNumber: String, ME: MonadError<F, Unit>): Kind<F, Int> {
    return ME.raiseError(Unit)
  }
}

Option has a MonadError<ForOption, Unit>, meaning that you can only build None with Unit. You cannot build None with an associated String or DummyException.

where that has been describe?

In the arrow-contributors channel, early on meaning around 2017 :D

from arrow-core.

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.