-
Notifications
You must be signed in to change notification settings - Fork 15
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
Turn joinLeq
and meetLeq
into class methods
#81
Comments
What about #54 is related issue, IIRC. |
So, iiuc - the problem is that Would you consider
Also are there rules regarding to which |
As an example, if you write a code using So I'd rather do nothing, and not require any compatibility conditions (maybe I should advice that it's s good idea anyway) between (Similarly, I'll really advice to make As for your use-case, you can make type ComparableJoinSemiLattice l = (JoinSemiLattice l, PartialOrd l ) and require your users to make instances compatible for your library to work correctly as preconditions to your library functions. (IMHO it's not muh different then requiring some things when calling Another example of this design problem is to require This issue seems be worth a blog post. I'll make a note to myself. |
Since there's two |
Err.. yes. Note that I'll write the blogpost in 2019 :) |
I probably misunderstood something, I assumed that for sane lattices (that follow the rules and all) |
they should give the same result, yes. |
If i recall right
|
Alright, so I'll close the issue I guess :) |
Thanks for the explanations! |
In implementing a library for type inference, I stumbled upon a situation regarding type constraints.
I want to be able to:
\/
) constraints togetherleq
)With the existing hierarchy, this requires to use both
JoinSemilattice
andPartialOrd
, and to require thatleq = joinLeq
for all types used as type constraints..If
joinLeq
was a class method ofJoinSemiLattice
(with its current implementation becoming the default/fallback implementation) I could had just requiredJoinSemilattice
and not need additional requirements.The text was updated successfully, but these errors were encountered: