caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Diego Olivier FERNANDEZ PONS <diego.fernandez_pons@etu.upmc.fr>
To: "ketty ." <kattlachan@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Type inference inside exceptions ?
Date: Tue, 10 Oct 2006 12:28:48 +0200	[thread overview]
Message-ID: <20061010122848.dcxzu0s11cwks8o8@webmail.etu.upmc.fr> (raw)
In-Reply-To: <6ebe51ce0610061320s1ef4402al54de5bab22071f0f@mail.gmail.com>

Quoting "ketty ." <kattlachan@gmail.com>:

>> I would like the type-checker to infer the type inside exceptions (or
>> at least to help me in the "guess a type and test" loop).
>
> I'd like it to infer the types of record-fields as well :)

WISH GRANTED.

type ('a, 'b, 'c) environment = {
     mutable solutions : 'a;
     mutable backtracks : 'b;
     mutable objective : 'c
}

let min_card = fun env ... -> ...

# val min_card :
   (int list list, int, int) environment ->
   int -> int list -> int list -> int list * int list continuation list =
   <fun>

The typechecker inferred the type of your record-fields.

Polymorphic exceptions are forbidden because they could break the type  
system, leading to a ['a -> 'b] type. That is why I asked for "type  
inference" or any kind of useful help and not for "polymorphic  
exceptions". I would accept the compiler to deny the use of the  
exception if it is not monomorphic.

         Diego Olivier


  reply	other threads:[~2006-10-10 10:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-06 18:16 Diego Olivier FERNANDEZ PONS
2006-10-06 20:20 ` [Caml-list] " ketty .
2006-10-10 10:28   ` Diego Olivier FERNANDEZ PONS [this message]
2006-10-11 22:50 ` Stéphane Glondu
2006-10-13 12:23   ` Diego Olivier FERNANDEZ PONS
2006-10-13 12:42     ` Pietro Abate
2006-10-14 19:56       ` Reordering continuations (was :Type inference inside exceptions ?) Diego Olivier FERNANDEZ PONS
2006-10-16  9:25         ` [Caml-list] " Diego Olivier FERNANDEZ PONS
2006-10-17 12:33           ` Diego Olivier FERNANDEZ PONS
2006-10-19  7:32             ` Looking for references to usage of ocaml in data mining, knowleadge discovery, etc  Dr. Axel Poigné 
2006-10-19 14:06               ` [Caml-list] " Markus Mottl

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=20061010122848.dcxzu0s11cwks8o8@webmail.etu.upmc.fr \
    --to=diego.fernandez_pons@etu.upmc.fr \
    --cc=caml-list@inria.fr \
    --cc=kattlachan@gmail.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;
as well as URLs for NNTP newsgroup(s).