GH-196 pattern matching lhs (#210)
* Allow block with separate type signature and definition of a function For instance, ``` function add : (int, int) => int add(x, y) = x + y ``` cc #196 * Allow pattern matching in left-hand sides * Changelog * Fix type spec * partial case-on-constructor * Changelog for pattern-matching lets
This commit is contained in:
+3
-1
@@ -40,6 +40,8 @@
|
||||
| {type_decl, ann(), id(), [tvar()]}
|
||||
| {type_def, ann(), id(), [tvar()], typedef()}
|
||||
| {fun_decl, ann(), id(), type()}
|
||||
| {fun_clauses, ann(), id(), type(), [letbind()]}
|
||||
| {block, ann(), [decl()]}
|
||||
| letbind().
|
||||
|
||||
-type compiler_version() :: [non_neg_integer()].
|
||||
@@ -48,7 +50,7 @@
|
||||
|
||||
-type letbind()
|
||||
:: {letval, ann(), pat(), expr()}
|
||||
| {letfun, ann(), id(), [arg()], type(), expr()}.
|
||||
| {letfun, ann(), id(), [pat()], type(), expr()}.
|
||||
|
||||
-type arg() :: {arg, ann(), id(), type()}.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user