Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Monad List instances #121

Closed
Blaisorblade opened this issue Jan 12, 2022 · 3 comments · Fixed by #123
Closed

Duplicate Monad List instances #121

Blaisorblade opened this issue Jan 12, 2022 · 3 comments · Fixed by #123

Comments

@Blaisorblade
Copy link

Blaisorblade commented Jan 12, 2022

One is in https://github.com/coq-community/coq-ext-lib/blob/master/theories/Data/Monads/ListMonad.v and one is in https://github.com/coq-community/coq-ext-lib/blob/master/theories/Data/List.v#L1-L123, and they're differently polymorphic.

(We noticed while wondering with @Janno whether ext-lib suffers from https://gitlab.mpi-sws.org/iris/stdpp/-/issues/80, and whether that causes MetaCoq/metacoq#580, but I'm not sure either way; at least ListMonad.v looks suspicious — and MetaCoq/metacoq#580 (comment) discusses the universe problem).

@liyishuai
Copy link
Member

My understanding was that Data/Monads/ intends to provide monad instances of datatypes, while Data/List.v contains useful functions and lemmas over lists. @gmalecha please correct my misunderstandings.

One confusion is that List.v also contains instances other than monad, which don't fit elsewhere in the current setting, so it's unclear where to put definitions and instances. We could restructure the files if it helps addressing problems like universe inconsistency.

@Lysxia
Copy link
Contributor

Lysxia commented Jan 12, 2022

I would prefer dropping ListMonad and similar modules when there is a corresponding Data/ module, that way Data/Monads/ is reserved for things whose usefulness is really derived from their monad instance.

@Blaisorblade
Copy link
Author

We could restructure the files if it helps addressing problems like universe inconsistency.

"Two instances" will add coherence problems if you mix the two abstractions.

OTOH, I'm no universe expert but "Two instances" won't add universe inconsistencies (it will add other problems), but Monad list will most likely add the same one as https://gitlab.mpi-sws.org/iris/stdpp/-/issues/80 (because template polymorphism is silly). Not sure if the other one is any better, but @Janno was skeptical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants