-
Notifications
You must be signed in to change notification settings - Fork 247
On filter and boolFilter #920
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
Comments
They were changed to use decidable predicates a while back, as the boolean versions were very difficult to state and prove properties about. Furthermore as most of the library is set up to use decidability rather than boolean functions they didn't interface well with other code. The problem with your proposed definition in 2. is that it makes much harder to chain Having said that @laMudri is proposing to reimplement these functions using the new definition of |
Not sure I agree. From a high-level perspective, one should be able to inherit the results for definition 1 (Bool) from definition 2 (Dec). Given a boolean function However, I agree that a redesign could happen in connection with #932. |
Okay revisiting several years later. Apologies for the delay @andreasabel. I've been brought back here by the module dependency graph issue. In particular by the fact that requiring decidable predicates requires you to import
As for the naming I'd guess I'd prefer not to make a breaking change if possible, so how about appending a |
I should add that it is going to require lifting |
I was thinking of suggesting that we put the definition of relations and predicates in |
Can you give some concrete examples of what would go in |
That sounds fine. I am a bit removed from this issue now, so I do not have a strong opinion atm. |
(I think I've answered a similar query on a different issue, but it's better to be thorough) What would go in The same way we separate data-structures and basic functions on them from their properties (and bundles). Generalized to encompass relations. |
Hmm so what about basic operations over those data types? For example nearly every data type has a What about relations that pretty much require module parameters for their syntax to work sensibly, e.g. pointwise equality over lists? |
I could think of |
Revisiting this in the light of #2172 (I confess I didn't follow this discussion back in 2022): no need to move It has always (at least, since I started thinking about it ;-)) felt to me that these properties (and their ancillary consequences) belong with |
(Unsurprisingly?) I am in favour of moving |
I think that I am not/no longer clear whether my proposal would be a |
In
Data.List.Base
, I findthe latter being deprecated.
I am a bit puzzled by this choice. The current version of
filter
is simplyfilter p = boolFilter (isYes \o p)
I don't question that this specialization gets its own name (as I am generally in favor of fat libraries). However:
filter
be theBool
version?decFilter
orfilterDec
) requires a decidable predicate rather than a simple boolean test, but then throws away the evidence. Shouldn't it rather retain the evidence?Analogous cases:
partition
,span
,break
,takeWhile
,dropWhile
.Design baseline: Don't ask for data that you don't use to produce the result.
See also #263.
The text was updated successfully, but these errors were encountered: