caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Optional arguments "between" non-optional ones
@ 2010-09-23 13:20 Adrien
  2010-09-23 14:32 ` bluestorm
  0 siblings, 1 reply; 4+ messages in thread
From: Adrien @ 2010-09-23 13:20 UTC (permalink / raw)
  To: Caml Mailing List

Hi,

I was refactoring code today and hit a typing error that I couldn't
explain. I eventually tracked it down to the following:

  let f () ?a () =
    print_endline "bouh!"

  let h f =
    f () ()

  let () = h f;;  (* error is for "f" here *)

  Error: This expression has type unit -> ?a:'a -> unit -> unit
         but an expression was expected of type unit -> unit -> 'b


If I remove the first unit argument of f, then it works as expected.
There also seems to be variations around that.

Is there any explanation for that difference? And any chance of it
getting improved?

Thanks.


-- 

Adrien Nader


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-24  1:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23 13:20 [Caml-list] Optional arguments "between" non-optional ones Adrien
2010-09-23 14:32 ` bluestorm
2010-09-23 15:05   ` Adrien
2010-09-24  1:32     ` Jacques Garrigue

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).