<malc_>
ScriptDevil: i don't but Jacques Garrigue usually quite accommodating, you can ask him directly
<malc_>
+is
<octachron>
ScriptDevil, because labels are mandatory in general, and they can only be omitted with a full syntaxic application. In `x |> f`, `f` is not applied to anything.
copy has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
malc_ has quit [Ping timeout: 272 seconds]
porchetta has quit [Ping timeout: 240 seconds]
porchetta has joined #ocaml
olle has joined #ocaml
<ScriptDevil>
octachron: I was confused because I thought |> was defined as `let (|>) x f = f x`. So I thought `let named_tuple_appl = partialnamedf 42;;` and `let named_tuple_pipe = 42 |> partialnamedf;;` should be identical in behavior
<octachron>
`|>` is defined as you say. But labelled application and non labelled application are not the same.
<octachron>
In let (|>) x f = f x, `f` is not labelled.
<ScriptDevil>
Is there any way I can make that work with a pipeline? Would for instance `42 |> (fun x -> partialnamedf ~name2:x)` be the right way to go about this?
<ScriptDevil>
As an OCaml beginner, I proliferated named args in a lot of my functions. This particular function is somewhree in the middle of a long series of `|>` connected expressions
<ScriptDevil>
I didn't realize named to unnamed casting was a little limited.
<octachron>
Using a lambda should work
<ScriptDevil>
Thanks. Also, is this by design or a current compiler limitation? Is there utility to getting in touch with Jacques Garrigue as malc_ suggested??
<octachron>
It is by design.
<octachron>
Label elision is just a small convenience shortcut that works in a limited niche
<ScriptDevil>
Ok, I found a line that does backup what you say in the manul https://caml.inria.fr/pub/docs/manual-ocaml/lablexamples.html When a function is passed as an argument to a higher-order function, labels must match in both types. Neither adding nor removing labels are allowed.
<ScriptDevil>
Thank you for your time.
<def>
ScriptDevil: JaneStreet had a ppx rewriter that turned "x |> f" into "f x" syntactically (or (fun v -> f v) x, I don't recall exactly) such that you have label elision also when using