Replace function_type with generic type rule
@@ -313,19 +313,16 @@ module.exports = grammar({
$._type
),
- _type: $ => choice(
- $.simple_type,
- $.function_type
- ),
-
- function_type: $ => prec.right(seq(
+ type: $ => seq(
choice(
- repeat1(alias($.variable_identifier, $.type_variable)),
- $.simple_type
+ $._generic_type_constructor,
+ alias($.variable_identifier, $.type_variable),
+ $.tuple,
+ $.list,
+ $.parenthesized_constructor
+ ),
+ optional(seq('->', $.type))
),
- '->',
- choice($._type, repeat1(alias($.variable_identifier, $.type_variable)))
- )),
unit_type: $ => '()',
list_constructor: $ => '[]',
function_constructor: $ => '(->)',
