Stefan pushed to branch master at Stefan / Typer
Commits: d6005a0c by Stefan Monnier at 2018-05-18T17:44:46Z * src/lexp.ml (push_susp): Fix list inversion
Reported by Jonathan Graveline.
- - - - -
1 changed file:
- src/lexp.ml
Changes:
===================================== src/lexp.ml ===================================== --- a/src/lexp.ml +++ b/src/lexp.ml @@ -272,11 +272,11 @@ let rec push_susp e s = (* Push a suspension one level down. *)
| Let (l, defs, e) -> let s' = L.fold_left (fun s (v, _, _) -> ssink v s) s defs in - let (_,ndefs) = L.fold_left (fun (s,ndefs) (v, def, ty) - -> (ssink v s, - (v, mkSusp def s', mkSusp ty s) :: ndefs)) - (s, []) defs in - mkLet (l, ndefs, mkSusp e s') + let rec loop s defs = match defs with + | [] -> [] + | (v, def, ty) :: defs + -> (v, mkSusp def s', mkSusp ty s) :: loop (ssink v s) defs in + mkLet (l, loop s defs, mkSusp e s') | Arrow (ak, v, t1, l, t2) -> mkArrow (ak, v, mkSusp t1 s, l, mkSusp t2 (ssink (maybev v) s)) | Lambda (ak, v, t, e) -> mkLambda (ak, v, mkSusp t s, mkSusp e (ssink v s))
View it on GitLab: https://gitlab.com/monnier/typer/commit/d6005a0ccdd2ff8735c831ee989da65891e8...