Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] type annotations for function values [Answer]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: fis@w...
Subject: [Caml-list] type annotations for function values [Answer]


i wrote:
> [...]
> which is horribly inelegant.  why can't i do something like this?
> 
>   let ((f x y) : (float -> float -> int)) = 3 in 4;;

thanks for all your replies.  here is the solution:

let f (x : float) (y : float) : int = 3 in 4

regards,
matthias

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners