From 11511ab0a2bfd02c5d9828f570ac65bc65b9ff57 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 27 Apr 2024 12:41:50 +0200 Subject: [PATCH] hmm --- lib/inference.ml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/inference.ml b/lib/inference.ml index 54e9702..4706f5f 100644 --- a/lib/inference.ml +++ b/lib/inference.ml @@ -39,13 +39,13 @@ let typeof t = (match Unification.unify ty_param ty_args with | Some _ -> Some ty_fn, env | None -> None, env) - | (Some _ (* (Type.Var _ as ty1) *), _), _ -> - (* On this case we may have a function represented as the variable *) - (* let ty2 = Type.Arrow (ty1, ty1) in - (match Unification.unify ty1 ty2 with - | Some env' -> Some ty2, env' - | _ -> None, env) *) - None, env + (* | (Some (Type.Var _ as ty1), _), _ -> + (* On this case we may have a function represented as the variable *) + let ty2 = Type.Arrow (ty1, ty1) in + (match Unification.unify ty1 ty2 with + | Some env' -> Some ty2, env' + | _ -> None, env) *) + | (Some _, _), _ -> None, env | _ -> None, env) in fst (infer TypeSubstitution.empty t)