Add a Stdlib module for OCaml < 4.07#5
Conversation
dbuenzli
left a comment
There was a problem hiding this comment.
I wouldn't have used Stdlabels I think we should rather deprecate it in the future but I won't fight against this.
Except for the variable name this is good to go.
src/dune
Outdated
| List.filter modules_post_4_02 ~f:(fun (_, v) -> version < v) | ||
| |> List.map ~f:fst | ||
|
|
||
| let all_modules_expect_stdlib = |
There was a problem hiding this comment.
This should be except not expect.
Out of curiosity, do you think it's the separate Stdlabels module that's bad or the use of labels in general? I don't like having to use a separate module either, but in general I think labels improve readability of the code. |
Both. The dichotomy present in the |
|
The main advantage I see of having the |
|
I highly dislike the inline function style. Unless the mapped function fits on the line the function should be properly named to indicate to the reader its denotation so that the intent of the |
|
I see. I understand your position but I personally don't find it unpleasant to read code written in this style, i.e. with inline functions or using For the case of the stdlib, given that the compiler doesn't force you to use labels and that their use is often down to personal taste, it seems to me that providing them by default would be better choice than not having them at all. |
I disagree, the problem with labels is that they leak when you partially apply functions so they somehow go against the idea to use functions as a strong compositional glue. This makes all sorts of functional programming techniques more harder to use (e.g. lifting functions in your applicative functors). |
I understand the part about partially applying functions, and I agree that this is indeed sometimes annoying, however I don't follow the rest, I'd need to see examples to understand the problem better. Note that we use this style extensively at Jane Street and it works just fine for a whole lot of code. |
No description provided.