How do product and record types work in your language?

This page summarizes the projects mentioned and recommended in the original post on /r/ProgrammingLanguages

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • documentation

    Documentation for the PureScript language, compiler, and tools. (by purescript)

  • The most common structural approach is row polymorphism. OCaml has row polymorphic objects and Purescript has proper row polymorphic records. In row polymorphism, you have fields, and then a variable that's "the rest of the record". This provides you type the ability to extend a record with more fields, e.g. some fun x -> {x with f1 = 0, f2 = 'a'} could have some type like {x..} -> {f1 : int, f2 : char | x..}, where x.. denotes the row polymorphic variable. So this is a simple system that gives you fully structural records (e.g. the type is the fields that exist) and a way to type single inheritance, with full type inference. For the dual (polymorphic variants), the same applies (and single inherence corresponds to wildcard matching in this case).

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts