From: Sven <luther@dpt-info.u-strasbg.fr>
To: Dave Mason <dmason@sarg.ryerson.ca>
Cc: Mattias Waldau <mattias.waldau@abc.se>,
Arturo Borquez <aborquez@altavista.com>,
steven@murdomedia.net, caml-list@inria.fr
Subject: Re: [Caml-list] Haskell features in O'Caml
Date: Mon, 24 Sep 2001 13:14:27 +0200 [thread overview]
Message-ID: <20010924131427.A19055@dpt-info.u-strasbg.fr> (raw)
In-Reply-To: <200109231750.f8NHoLp03884@sarg.ryerson.ca>; from dmason@sarg.ryerson.ca on Sun, Sep 23, 2001 at 01:50:21PM -0400
On Sat, 22 Sep 2001 13:50:11 +0200, Steven Murdoch <steven@murdomedia.net> wrote:
> The main one I would like is the type assertion facility of Haskell.
> For example, one might write:
> mul :: Int -> Int -> Int
> mul a b = a * b
>
On Sun, 23 Sep 2001 18:08:36 +0200, Florian Hars <florian@hars.de> wrote:
> # module M : sig
> val mul : int -> int -> int
> end = struct
> let mul a b = a * b
> end;;
> module M : sig val mul : int -> int -> int end
>
On Sun, 23 Sep 2001 18:21:07 +0200, "Mattias Waldau" <mattias.waldau@abc.se> wrote:
> # let mul (a:int) (b:int) : int = a*b;;
> val mul : int -> int -> int = <fun>
>
On Sun, Sep 23, 2001 at 01:50:21PM -0400, Dave Mason wrote:
>
> # let (mul : int -> int -> int) = fun x y -> x*y;;
> val mul : int -> int -> int = <fun>
>
But you have to recognize that non of these solution is as elegant as the
haskel way of doing it, isn't ti ?
maybe this would be nice :
val mul : int -> int -> int
let mul x y = ...
Sure, i know the right way is to put the declaration of mul in a separate
file, but still, it would be nice to be able to do it in one file only.
Friendly,
Sven Luthert
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-09-24 11:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-22 14:56 Arturo Borquez
2001-09-23 16:08 ` Florian Hars
2001-09-23 16:21 ` Mattias Waldau
2001-09-23 17:50 ` Dave Mason
2001-09-24 11:14 ` Sven [this message]
2001-09-24 15:29 ` Brian Rogoff
-- strict thread matches above, loose matches on Subject: below --
2001-09-24 22:51 Christian.Schaller
2001-09-25 9:15 ` Remi VANICAT
2001-09-24 16:26 Christian.Schaller
2001-09-24 19:53 ` Remi VANICAT
2001-09-23 23:25 Arturo Borquez
2001-09-22 11:46 Steven Murdoch
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=20010924131427.A19055@dpt-info.u-strasbg.fr \
--to=luther@dpt-info.u-strasbg.fr \
--cc=aborquez@altavista.com \
--cc=caml-list@inria.fr \
--cc=dmason@sarg.ryerson.ca \
--cc=mattias.waldau@abc.se \
--cc=steven@murdomedia.net \
/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