Skip to content

type system extensions #1039

@evancz

Description

@evancz

This issue is to aggregate features that have been requested. You can discuss it more on community forums. This is just for centralizing things.

The ML-family has a rich history, with many different languages and many different type system features. The most commonly requested type system features are:

These requests usually come from folks coming from Haskell who want Elm to be Haskell.

There are a variety of ways to get roughly the same sort of "genericness" in your code.

  • type classes - the most widely known approach, used in Haskell
  • HKP + RankN - read Scrap your Type Classes to get the basic idea and pretend the syntax is nicer.
  • HKP + RankN + Implicit Arguments - On the Bright Side of Type Classes describes how this works in Agda
  • module functors - this is the approach used in SML and OCaml, which both have very sophisticated module systems. It lets you do tons of stuff above and beyond these other approaches. It looks like OCaml may add some implicit resolution feature as well.

I think all of these approaches are compelling, and since the very beginning of Elm, it has not become clear which is "the right choice" for Elm. It is also true that if you go too crazy adding this stuff, you probably can never un-add it.

I think this talk is probably one of the best explanations I have given of the design philosophy that led to the "wait and see" approach we are taking on these topics. You can also search the archives of the elm-discuss to find the numerous and often tumultuous threads about these features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions