Why OCaml doesn't promote constructors and field labels to functions?

In Haskell, data constructors and field labels are treated as first-class values, and I found it quite convenient. However, in OCaml, this can only be achieved with syntax extension or preprocessing as mentioned in here. So I wanted to know whether there is a particular reason that OCaml doesn’t have that feature and what would come as a cost to implement such a feature.

My favorite proposal in this direction is @Juloo’s Promote constructors to functions by Julow · Pull Request #9005 · ocaml/ocaml · GitHub , and it got stalled (no progress for years) because we could not collectively agree on whether the function for a multi-argument constructor should be curried, tupled, or labelled.

2 Likes

@gasche Thanks for the quick response. I will take a look at the discussion you pointed to.