1. 6
  1. 4

    Polyvariadic functions are pretty ugly without language support. The next “big” functional programming should have a better story for named arguments because while curried positional arguments are suitable for a large class of lawful functions, they’re really painful for dealing with anything unix functions or filesystem functions that are mostly large collections of variadic optional named arguments. Having first class records in the language would pretty much solve most of this.

    1. 1

      Do you have an example of what you mean by first class records?

      1. 2

        I stumbled upon this: https://nikita-volkov.github.io/record/

        I assume by first class you mean records as a type level construct.

        1. 1

          Do you mean stuff like OCaml’s polymorphic variants? Polymorphic records would be nice.

          EDIT: Actually, I suppose OCaml’s objects and row polymorphism are a kind of heavyweight first class records.

          1. 1

            I don’t think he means first class records. Or maybe he does. A record is something that supports named fields with no namespace clashing.

            What I think he is specifically talking about, though, is SML style, where you pass a record into a function to get names associated to arguments.

            makePerson { name=“Bill”; age=21 }

            Would be an example usage. By passing a data structure with named fields you get names attached to arguments, gratis.