From: Alain Frisch <Alain.Frisch@inria.fr>
To: oleg@pobox.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Eliminating array bounds check
Date: Mon, 04 Sep 2006 09:22:26 +0200 [thread overview]
Message-ID: <44FBD432.8030602@inria.fr> (raw)
In-Reply-To: <20060904010002.9A553AC00@Adric.metnet.fnmoc.navy.mil>
Hello Oleg,
oleg@pobox.com wrote:
> For example:
> http://pobox.com/~oleg/ftp/ML/eliminating-array-bound-check-literally.ml
>From your code:
=======================================
(* First, we, on off-chance, check if we can obtain type
eigen-variables via the module system.
*)
module GenT : sig type t val v : t end =
struct type t = int let v = 1 end
;;
let module M1 = GenT in
let module M2 = GenT in
M1.v = M2.v
;;
(* Alas, the latter succeeds and reports no type error. What did we
expect: OCaml functors are applicative.
Fortunately, OCaml supports higher-rank types.
*)
=======================================
What about making GenT a functor and passing it unnamed structures as
arguments? (Ok, you must then trust the client not to apply GenT with
named structures.)
module GenT(X:sig end) : sig type t val v : t end =
struct type t = int let v = 1 end
;;
let module M1 = GenT(struct end) in
let module M2 = GenT(struct end) in
M1.v = M2.v
;;
You could then simplify the TrustedKernel so as not to use polymorphic
record fields (and also to use a direct style instead of a continuation
style for brand).
-- Alain
next prev parent reply other threads:[~2006-09-04 7:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-04 1:00 oleg
2006-09-04 7:22 ` Alain Frisch [this message]
2006-09-04 7:42 ` [Caml-list] " Alain Frisch
2006-09-06 5:03 ` oleg
2006-09-06 5:15 ` Jonathan Roewen
2006-09-07 9:48 ` oleg
2006-09-04 9:43 ` skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44FBD432.8030602@inria.fr \
--to=alain.frisch@inria.fr \
--cc=caml-list@inria.fr \
--cc=oleg@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox