caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: tf@functionality.de
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Is this a bug?
Date: Wed, 02 May 2007 09:25:38 +0900 (JST)	[thread overview]
Message-ID: <20070502.092538.74749440.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <4637399F.6010103@functionality.de>

From: Thomas Fischbacher <tf@functionality.de>
> If we look at the following piece of code:
> 
> ===>
> type dof_region_spec = (string * bool * (int option array)) array;;
> type opt_field_restriction = dof_region_spec option;;
> 
> let make_field ?(name="Field") ?restriction ?constant_value mwe =
>    let restriction:opt_field_restriction = restriction in
> 	failwith "FOO";;
> <===
> 
> ...then make_field types as:
> 
> ===>
> val make_field :
>    ?name:string -> ?restriction:<hidden> -> ?constant_value:'a -> 'b -> 'c
> <===
> 
> The <hidden> actually should not show up here. What is going on?

You could call it a printer "bug", but it's probably not worth fixing.
The problem is that opt_field_restriction hides the "option" type
constructor. To recover it one would have to expand it, but the
printer is not supposed to do type expansion (it must show the types
as they are).

So I would be tempted to say that a reasonable fix would be to replace
<hidden> by <option hidden>, to make things clearer?

Note that this is purely a printer problem. The type-checker itself
shall work correctly.

Jacques Garrigue


  parent reply	other threads:[~2007-05-02  0:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01 12:59 Thomas Fischbacher
2007-05-01 13:34 ` [Caml-list] " Eric Cooper
2007-05-02  0:25 ` Jacques Garrigue [this message]
2007-05-02  0:50   ` Thomas Fischbacher
2007-05-02  2:40     ` Jacques GARRIGUE
  -- strict thread matches above, loose matches on Subject: below --
2006-05-09 13:09 is this a bug ? Christophe Raffalli
2006-05-09 13:16 ` [Caml-list] " Remi Vanicat
2006-05-09 13:19 ` Samuel Mimram
2006-05-09 13:26   ` Christophe Raffalli
2006-05-09 13:33     ` Samuel Mimram
2006-05-09 13:30   ` Yoann Padioleau
2006-05-09 13:22 ` Christophe Raffalli
2006-05-09 13:33 ` Luc Maranget
2006-05-09 13:47 ` Arne Ehrlich
2006-05-09 18:24   ` Jonathan Roewen
2006-05-09 13:47 ` Alain Frisch
2002-07-08 19:53 [Caml-list] productivity improvement Oleg
2002-07-10 15:39 ` John Max Skaller
2002-07-12 12:16   ` [Caml-list] Is this a bug? John Max Skaller
2002-07-12 14:05     ` Xavier Leroy

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=20070502.092538.74749440.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=tf@functionality.de \
    /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).