Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Optional arguments and type annotations
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christian RINDERKNECHT <rinderkn@h...>
Subject: [Caml-list] Optional arguments and type annotations
Hello List,

First, let me say I am quite new to labels (I was waiting for the 3.03
release for using them).

I am used to annotate the top-level functions with their types, and I
was surprised to see that I must write the following to make it

#let bump ?(step:int option) (x:int) =
   match step with
     None -> x * 2
   | Some y -> x + y
#val bump : ?step:int -> int -> int = <fun>

and then there is a discrepancy between the "int option" annotation in
the .ml and the "int" in the interface.

This is not a big deal to solve:), but it looks strange to me.

Best regards,



Christian Rinderknecht                     Phone  +82 42 866 6147
Network Architecture Laboratory            Fax    +82 42 866 6154
Information and Communications University  WWW
58-4 Hwaam-dong, Yuseong-gu, Daejeon,      e-mail
305-732, Korea
Bug reports:  FAQ:
To unsubscribe, mail  Archives: