Skip to content

Instantly share code, notes, and snippets.

@o1lo01ol1o
Last active December 6, 2017 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save o1lo01ol1o/d582e8d34c15facf40a9fda59714d924 to your computer and use it in GitHub Desktop.
Save o1lo01ol1o/d582e8d34c15facf40a9fda59714d924 to your computer and use it in GitHub Desktop.
Cheat sheet for haskell type level extenions.

To your other, more general question, "the uses of data families as distinct from type families and GADTs". Here's the space of possibilities: ​

  1. Is the type constructor generative and injective, and can it be partially applied?
  2. Is there a runtime tag passed along with the value to pattern match on?
  3. Can it be closed, can it be open? ​ And here's where GADTs and type/data families lie in this space: ​

​ GADTS: (1) yes, (2) yes, (3) closed ​ Data families: (1) yes, (2) no, (3) open ​ Type families: (1) no, (2) no, (3) open or closed

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