-
Notifications
You must be signed in to change notification settings - Fork 106
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
equal functions in Enum and Seq #809
Comments
If you grep for |
OK. Should I "fix" |
You shouldn't change the interface of an existing function unless we do a major release. You could send this change, separately, to the |
If
I'm just a little befuddled, confused at the moment about what functions are needed. An In the abstract I feel that |
Yes, I personally think that it is fine having two functions doing the same thing with different names that carry different connotations. (Furthermore, in this case, they are not exactly doing the same thing. Note that I wouldn't encourage people to use Two points on the optional arguments:
|
OK. That sounds fine. Maybe I'll note the similairity in the doc comments. I.e. you're saying that having |
I updated the issue title, because the LazyList part was done. |
LazyList
lacks anequal
predicate. BothEnum
andSeq
includeequal
, but the syntax is different:Enum
has a required equality-predicate parameter for comparison of individual elements, whileSeq
instead has an optional argument that defaults to=
.I want to submit a PR for
equal
for LazyList, but I'm not sure which model to follow. I think the optional argument version ofSeq
makes more sense, since any of the usual standard OCaml types, except functions, will automatically work with=
. In fact I was considering submitting code more or less identical to what's inSeq
, following kantian's suggestions in this thread in discuss.ocaml.org.It would be nice if all three
equal
functions had the same syntax, but I gather thatEnum
is used a lot in Batteries, so changingEnum
'sequal
might break a lot of things. I don't know how heavilySeq
is used, and whether changing its syntax might break things.Given the difference between
Enum
's andSeq
'sequal
functions, I'm not sure how best to proceed.The text was updated successfully, but these errors were encountered: