New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type system extensions #1039

Open
evancz opened this Issue Aug 29, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@evancz
Member

evancz commented Aug 29, 2015

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:

  • Type classes (see #38, one of the first issues for Elm!)
  • Higher-kinded polymorphism (HKP)
  • Rank N polymorphism (see #238)

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.

@evancz evancz added the meta label Sep 28, 2015

@evancz evancz changed the title from Meta issue: type system extensions to type system extensions Oct 5, 2015

@evancz evancz added the types label May 13, 2016

@elm elm locked and limited conversation to collaborators May 15, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.