Stefan pushed to branch graveline at Stefan / Typer
Commits: aaa4c5dc by Stefan Monnier at 2018-05-18T21:10:47Z Add missing parts of last commit
- - - - -
4 changed files:
- samples/bool.typer - − samples/bugs.typer - samples/empty.typer - src/opslexp.ml
Changes:
===================================== samples/bool.typer ===================================== --- a/samples/bool.typer +++ b/samples/bool.typer @@ -25,20 +25,22 @@ if_then_else_
%% FIXME: Type annotations should not be needed below. not : t -> t; -not x = if x then false else true; +%% FIXME: We use braces here to delay parsing, otherwise the if/then/else +%% part of the grammar declared above is not yet taken into account. +not x = { if x then false else true };
or : t -> t -> t; -or x y = if x then x else y; +or x y = { if x then x else y };
and : t -> t -> t; -and x y = if x then y else x; +and x y = { if x then y else x };
xor : t -> t -> t; -xor x y = if x then (not y) else y; +xor x y = { if x then (not y) else y };
%% FIXME: Can't use ?a because that is generalized to be universe-polymorphic, %% which we don't support in `load` yet. fold : t -> (a : Type) ≡> a -> a -> a; -fold x t e = if x then t else e; +fold x t e = { if x then t else e};
===================================== samples/bugs.typer deleted ===================================== --- a/samples/bugs.typer +++ /dev/null
===================================== samples/empty.typer ===================================== --- a/samples/empty.typer +++ b/samples/empty.typer @@ -0,0 +1 @@ +%%% empty.typer --- Yay! An empty library!
===================================== src/opslexp.ml ===================================== --- a/src/opslexp.ml +++ b/src/opslexp.ml @@ -958,8 +958,8 @@ let ctx2tup ctx nctx = types) SMap.empty), cons_label), - List.map (fun (oname, t) - -> (P.Aimplicit, Var (maybev oname, offset))) + List.mapi (fun i (oname, t) + -> (P.Aimplicit, Var (maybev oname, offset - i - 1))) types) | (DB.CVlet (oname, LetDef (_, e), t, _) :: blocs) -> Let (loc, [(maybev oname, mkSusp e (S.shift 1), t)],
View it on GitLab: https://gitlab.com/monnier/typer/commit/aaa4c5dccf508240be9afda1615bff788572...