News for hackers. Stuff that matters.
Re:Reason: A new interface to OCaml by cwyers on Tuesday May 17, 2016 @06:09PM (#11717933)
I really wish they'd taken the pipeline (|>) operator from F#, if they were going to rework OCaml.
Re:Reason: A new interface to OCaml by thedufer on Wednesday May 18, 2016 @12:24AM (#11719719)
As others have noted, the pipeline operator already exists in OCaml. And even if it didn't, you can define it pretty easily:

    let (|>) x f = f x
Re:Reason: A new interface to OCaml by LeonidasXIV on Wednesday May 18, 2016 @04:35AM (#11720553)
Can be shortened to

    let (|>) x f = "%apply"
which utilises some language magic and is probably faster.
Re:Reason: A new interface to OCaml by thedufer on Wednesday May 18, 2016 @11:27PM (#11727747)
At risk of being pedantic, that's actually shorter. It also doesn't work, at least on the version of OCaml I'm familiar with. In order to invoke that particular bit of "language magic", you'd have to declare it external and explicitly give its type:

    external (|>) : 'a -> ('a -> 'b) -> 'b = "%revapply"
Also, `%apply` is usually the `@@` operator. For `|>`, one would expect `%revapply`.
Re:Reason: A new interface to OCaml by chenglou on Tuesday May 17, 2016 @06:13PM (#11717979)
The pipe operator's still there.
Re:Reason: A new interface to OCaml by cwyers on Tuesday May 17, 2016 @09:51PM (#11719169)
I've never written OCaml, just SML and F#, but I thought that OCaml didn't have the |> operator.
Re:Reason: A new interface to OCaml by cvik on Tuesday May 17, 2016 @10:34PM (#11719328)
OCaml, like SML, have the syntax for defining their own operators. |> is defined, to my knowledge, both in the standard prelude and in core.
Re:Reason: A new interface to OCaml by gaius on Wednesday May 18, 2016 @12:13AM (#11719682)
Since Ocaml 4 if I remember correctly
Re:Reason: A new interface to OCaml by LeonidasXIV on Wednesday May 18, 2016 @04:31AM (#11720536)
4.01 to be exact. Along with @@, which is kinda comparable to $ in Haskell.