This commit is contained in:
Mylloon 2023-12-04 18:38:57 +01:00
parent 97fc6d3d86
commit 72c323b2c8
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -48,8 +48,6 @@ let check_type_scheme
HopixTypes.Scheme (ts, HopixTypes.internalize_ty env ty), env
;;
let rec check_pattern
: HopixTypes.typing_environment -> HopixAST.pattern Position.located -> HopixTypes.aty
-> HopixTypes.typing_environment
@ -83,7 +81,7 @@ let rec synth_expression
| While (ecase, expr) -> synth_while env ecase expr
| For (id, ecase, expr1, expr2) -> synth_for env id ecase expr1 expr2
and synth_literal : HopixAST.literal -> HopixTypes.aty =
and synth_literal : HopixAST.literal -> HopixTypes.aty =
fun l ->
match l with
| LInt _ -> HopixTypes.hint
@ -113,16 +111,16 @@ and synth_apply
: HopixTypes.typing_environment -> expression Position.located
-> expression Position.located -> HopixTypes.aty
=
fun tenv f x -> (*failwith "Students! This is your job! (synth_apply)"*)
fun tenv f x ->
(*failwith "Students! This is your job! (synth_apply)"*)
let f_type = synth_expression tenv f in
match f_type with
| HopixTypes.ATyArrow (gauche,droit) -> (* a' -> b' *)
(
match f_type with
| HopixTypes.ATyArrow (gauche, droit) ->
(* a' -> b' *)
let x_type = synth_expression tenv x in
check_equal_types x.position gauche x_type; droit
)
check_equal_types x.position gauche x_type;
droit
| _ -> failwith ""
and synth_record
: HopixTypes.typing_environment
@ -208,7 +206,6 @@ and synth_for
=
fun tenv id estart eend expr -> failwith "Students! This is your job! (synth_for)"
and check_expression
: HopixTypes.typing_environment -> HopixAST.expression Position.located
-> HopixTypes.aty -> unit