Comments (6)
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.
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.
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.
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.
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.
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)
- The EqvWF_Build instance messes up with typeclass resolution
- Please create a tag for the upcoming release of Coq 8.13 HOT 2
- Please create a tag for the upcoming release of Coq 8.14 HOT 2
- Right Idenity in MonadLaw HOT 4
- Duplicate Monad List instances HOT 3
- `Set Typeclass Strict Resolution`
- `Monad list` instances will cause template-polymorphism problems
- Please pick the version you prefer for Coq 8.15 in Coq Platform 2022.02 HOT 3
- Please pick the version you prefer for Coq 8.16 in Coq Platform 2022.09 HOT 2
- can't install package coq-ext-lib for coq 8.12 HOT 3
- what is the most stable version for coq 8.12, 0.11.7 or dev? is dev stable? HOT 2
- Please pick the version you prefer for Coq 8.17 in Coq Platform 2023.03 HOT 2
- Please pick the version you prefer for Coq 8.18 in Coq Platform 2023.10
- Metadata problem with release 0.12.1 on opam HOT 2
- rwHyps stops on first recursive equality
- Please pick the version you prefer for Coq 8.19 in Coq Platform 2024.01 HOT 2
- build problem HOT 2
- stdlibpp
- Add the let* monadic notation HOT 3
- notation conflict HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coq-ext-lib.