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
Signature of Enum.combine #577
Comments
While it seems that you are correct, changing this would break compatibility with existing code. |
Do we want to change this for 3.0? |
I understand, I can indeed define zip x y = combine (x,y). This is a suggestion for some future release of the batteries library. |
I agree with changing this for 3.0. |
Me too; I've also been bothered that this function takes a tuple. E.
|
Shouldn't the signature of Enum.combine be
'a BatEnum.t -> 'b BatEnum.t -> ('a * 'b) BatEnum.t
instead of'a BatEnum.t * 'b BatEnum.t -> ('a * 'b) BatEnum.t
?This prevents currying and is in stark contrast with the other combine functions:
LazyList.combine
'a LazyList.t -> 'b LazyList.t -> ('a * 'b) LazyList.t
BatList.combine
'a list -> 'b list -> ('a * 'b) list
BatSeq.combine
'a BatSeq.t -> 'b BatSeq.t -> ('a * 'b) BatSeq.t
I think that combine is a function that is interesting to curry. For example, with a curried Enum.combine function, an indexedEnum function can be defined as follows: indexedEnum = combine (range 1) (compare with Haskell zip [1..]).
The text was updated successfully, but these errors were encountered: