typer: bugfix: arrow is now a built-in type constructor

This commit is contained in:
Suzanne Dupéron 2019-12-06 18:33:01 +01:00 committed by Suzanne Dupéron
parent 0f420eaaf5
commit d97044b581

View File

@ -146,6 +146,11 @@ let rec transpile_type (t:AST.type_value) : type_value result =
| T_operator (TC_option o) -> | T_operator (TC_option o) ->
let%bind o' = transpile_type o in let%bind o' = transpile_type o in
ok (T_option o') ok (T_option o')
| T_operator (TC_arrow (param , result)) -> (
let%bind param' = transpile_type param in
let%bind result' = transpile_type result in
ok (T_function (param', result'))
)
(* TODO hmm *) (* TODO hmm *)
| T_sum m -> | T_sum m ->
let node = Append_tree.of_list @@ kv_list_of_cmap m in let node = Append_tree.of_list @@ kv_list_of_cmap m in
@ -181,7 +186,6 @@ let rec transpile_type (t:AST.type_value) : type_value result =
ok (T_pair ((None, a), (None, b))) ok (T_pair ((None, a), (None, b)))
in in
Append_tree.fold_ne transpile_type aux node Append_tree.fold_ne transpile_type aux node
| T_operator (TC_arrow (param, result))
| T_arrow (param, result) -> ( | T_arrow (param, result) -> (
let%bind param' = transpile_type param in let%bind param' = transpile_type param in
let%bind result' = transpile_type result in let%bind result' = transpile_type result in