Code Monkey home page Code Monkey logo

Comments (6)

vzaliva avatar vzaliva commented on July 1, 2024

More questions from email discussion with @gmalecha:

The first question is whether the laws should be in the same record as the operations. Doing this simplifies a lot of things, but does introduce some issues because sometimes the laws require functional extensionality which breaks reduction if used poorly.

The other thing is that, because monads are higher-order, there are questions about the equivalence relation. the general structure is a function : (a -> a -> Prop) -> m a -> m a -> Prop that has the appropriate properties.

The easier option is to require the relation on a to be equality. That simplifies things, but often requires functional extensionality for monad transformers. This is solved by higher inductive types, but those (sadly) still do not exist in Coq.

So maybe that summarizes the questions that need to be answered.

from coq-ext-lib.

gmalecha avatar gmalecha commented on July 1, 2024

Thanks! As I mentioned in the email, it seems like two concrete steps are:

  • catalog the existing implementations of Monad, Functor, Applicative
  • determine the "right" definitions. This involves universes, where the laws are, the "correct" levels.

We might want to talk to people who have done other implementations before doing the second one, as an existing definition might work.

from coq-ext-lib.

gmalecha avatar gmalecha commented on July 1, 2024

Regarding the relations, this seems to require a basic notion of equivalence for every type, and this is where things get opinionated because Coq doesn't provide a canonical solution. Type classes (something like type in ext-lib) or canonical structures.

Any way you slice it, to phrase the laws conveniently, you will probably need one of these.

from coq-ext-lib.

vzaliva avatar vzaliva commented on July 1, 2024

I've noticed that ExtLib.Core.Type is gone along with things like type_libniz. I guess this will help with the equality problem?

from coq-ext-lib.

gmalecha avatar gmalecha commented on July 1, 2024

I think this depends on how you define "help". To properly do the monad laws, we need a way to define setoids and we lost that when we dropped ExtLib.Core.Type. But there wasn't any good example on actually using ExtLib.Core.Type so it is debatable how useful it is.

from coq-ext-lib.

mattam82 avatar mattam82 commented on July 1, 2024

I think the interface is fine as it is, with the Laws separate and no setoids. One has the option not to use extlib if they want something else, and the existing copies are enough to justify a separate coq-monads library (IMHO)

from coq-ext-lib.

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.