From 07230fc0ed80148e4e85128c6b6e6d106bc24873 Mon Sep 17 00:00:00 2001 From: Nicolas PENELOUX Date: Mon, 4 Dec 2023 18:40:31 +0100 Subject: [PATCH] sequence --- flap/src/hopix/hopixTypechecker.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flap/src/hopix/hopixTypechecker.ml b/flap/src/hopix/hopixTypechecker.ml index 5f0c30d..3a91703 100644 --- a/flap/src/hopix/hopixTypechecker.ml +++ b/flap/src/hopix/hopixTypechecker.ml @@ -157,7 +157,16 @@ and synth_tuple and synth_sequence : HopixTypes.typing_environment -> expression Position.located list -> HopixTypes.aty = - fun tenv elist -> failwith "Students! This is your job! (synth_sequence)" + fun tenv elist -> + match elist with + | [] -> failwith "erreur sequence" + | [x] -> synth_expression tenv x + | x::l -> + ( + let x_type = synth_expression tenv x in + check_equal_types x.position HopixTypes.hunit x_type + ; synth_sequence tenv l) + and synth_define : HopixTypes.typing_environment -> value_definition -> expression Position.located