stylewarning / deprecated-coalton-prototype

Coalton is (supposed to be) a dialect of ML embedded in Common Lisp.
MIT License
208 stars 7 forks source link

Implement more general pattern matching facility #8

Open stylewarning opened 5 years ago

stylewarning commented 5 years ago

Pattern matching is a core and essential part of ML. Implement it. Syntax will be

<match> ::=
  (coalton:match <var>
    <clause>*)

<clause> ::= (<pattern> <result>)

<pattern>
  ::= <blank pattern>
    | <variable>
    | (@ <variable> <pattern>)
    |  <NullaryConstructor>
    | (<NaryConstructor> <pattern>*)

<variable> ::= a symbol excluding '_'
<blank pattern> ::= the symbol '_'

Types should be inferred, exhaustiveness checking should happen, etc.

stylewarning commented 5 years ago

A subset of the above is now implemented, allowing for

<NullaryConstructor>
(<NaryConstructor> <variable>+)