Version française
Home     About     Download     Resources     Contact us    
Browse thread
Constructors are not functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Gerd Stolpmann <gerd@g...>
Subject: Re: [Caml-list] Constructors are not functions
Here is the answer:

http://groups.google.com/group/fa.caml/browse_thread/thread/20e96409c5418394/5907e1593a84b03a

Gerd

Am Dienstag, den 06.10.2009, 14:01 +0200 schrieb Chantal KELLER:
> Dear Ocaml users,
> 
>   Is there a reason for constructors not to behave like functions? For
> instance, one cannot make a partial application from a constructor:
> 
> # type foo = | Bar of int;;
> type foo = Bar of int
> # let foobar = Bar in foobar 17;;
> Error: The constructor Bar expects 1 argument(s),
>        but is applied here to 0 argument(s)
> 
>   Thanks,
-- 
------------------------------------------------------------
Gerd Stolpmann, Bad Nauheimer Str.3, 64289 Darmstadt,Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------