-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
polymorphic type constraints
let id: 'a. 'a => 'a = x => x;(source_file [0, 0] - [1, 0]
(let_binding [0, 0] - [0, 29]
(value_identifier [0, 4] - [0, 6])
(type_annotation [0, 6] - [0, 20]
(function_type [0, 8] - [0, 20]
(function_type_parameters [0, 8] - [0, 10]
(type_identifier [0, 8] - [0, 10]))
(ERROR [0, 10] - [0, 14]
(ERROR [0, 13] - [0, 14]))
(type_identifier [0, 18] - [0, 20])))
(function [0, 23] - [0, 29]
parameter: (value_identifier [0, 23] - [0, 24])
body: (value_identifier [0, 28] - [0, 29]))))
locally abstract type
let eval:
type a. prim<a> => a =
x =>
switch x {
| Int(i) => i
| Float(f) => f
| Bool(b) => b
| Str(s) => s
}(source_file [0, 0] - [9, 0]
(let_binding [0, 0] - [8, 5]
(value_identifier [0, 4] - [0, 8])
(type_annotation [0, 8] - [1, 22]
(function_type [1, 2] - [1, 22]
(function_type_parameters [1, 2] - [1, 17]
(generic_type [1, 2] - [1, 17]
(type_identifier [1, 2] - [1, 6])
(ERROR [1, 7] - [1, 14]
(ERROR [1, 7] - [1, 8])
(ERROR [1, 10] - [1, 14]))
(type_arguments [1, 14] - [1, 17]
(type_identifier [1, 15] - [1, 16]))))
(type_identifier [1, 21] - [1, 22])))
(function [2, 2] - [8, 5]
parameter: (value_identifier [2, 2] - [2, 3])
body: (switch_expression [3, 4] - [8, 5]
(value_identifier [3, 11] - [3, 12])
(switch_match [4, 4] - [4, 17]
(variant_pattern [4, 6] - [4, 12]
(variant_identifier [4, 6] - [4, 9])
(formal_parameters [4, 9] - [4, 12]
(value_identifier [4, 10] - [4, 11])))
(expression_statement [4, 16] - [4, 17]
(value_identifier [4, 16] - [4, 17])))
(switch_match [5, 4] - [5, 19]
(variant_pattern [5, 6] - [5, 14]
(variant_identifier [5, 6] - [5, 11])
(formal_parameters [5, 11] - [5, 14]
(value_identifier [5, 12] - [5, 13])))
(expression_statement [5, 18] - [5, 19]
(value_identifier [5, 18] - [5, 19])))
(switch_match [6, 4] - [6, 18]
(variant_pattern [6, 6] - [6, 13]
(variant_identifier [6, 6] - [6, 10])
(formal_parameters [6, 10] - [6, 13]
(value_identifier [6, 11] - [6, 12])))
(expression_statement [6, 17] - [6, 18]
(value_identifier [6, 17] - [6, 18])))
(switch_match [7, 4] - [7, 17]
(variant_pattern [7, 6] - [7, 12]
(variant_identifier [7, 6] - [7, 9])
(formal_parameters [7, 9] - [7, 12]
(value_identifier [7, 10] - [7, 11])))
(expression_statement [7, 16] - [7, 17]
(value_identifier [7, 16] - [7, 17])))))))
Metadata
Metadata
Assignees
Labels
No labels