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

Why is Data.List.Relation.Binary.Subset.Setoid.Properties not parametrized on the Setoid as a whole #2397

Open
andreasabel opened this issue May 28, 2024 · 5 comments

Comments

@andreasabel
Copy link
Member

andreasabel commented May 28, 2024

Module Data.List.Relation.Binary.Subset.Setoid is parametrized on a Setoid, but its Properties module not:

module Data.List.Relation.Binary.Subset.Setoid.Properties where

Instead, each function is parametrized there individually, via anonymous modules.
Is there a reason why it is organized like this?

I would have expected to open the Properties module in the same way as its parent module.

@JacquesCarette
Copy link
Contributor

This tends to be for historical reasons rather than any 'good' reason. Evolution of the library happens haphazardly sometimes (no matter how hard we try to review PRs).

In other words, I'd call this a plain bug awaiting a PR to fix it.

@MatthewDaggitt
Copy link
Contributor

MatthewDaggitt commented May 29, 2024

No, there's a good reason for all such Properties modules being designed this way. If you parameterise it by a single setoid, then you can't prove properties of functions that move between different types, e.g. map.

@jamesmckinna
Copy link
Contributor

jamesmckinna commented May 29, 2024

But as @omelkonian writes on #2389 , this is not the case for eg Data.List.Relation.Binary.Permutation.Setoid.Properties, leading to undesirable consequences... wrt map :-( so @JacquesCarette 's point about historical/legacy inconsistency stands.

Ditto. The proposed addition in #2393 ...?

@jamesmckinna
Copy link
Contributor

No, there's a good reason for all such Properties modules being designed this way. If you parameterise it by a single setoid, then you can't prove properties of functions that move between different types, e.g. map.

Is this design principle documented anywhere?

@MatthewDaggitt
Copy link
Contributor

But as @omelkonian #2389 (comment), this is not the case for eg Data.List.Relation.Binary.Permutation.Setoid.Properties, leading to undesirable consequences... wrt map :-(

Yes that should really be fixed.

Is this design principle documented anywhere?

No, sadly not 😓

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

No branches or pull requests

4 participants