Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Nothing by itself. It's just a definable constructor of some sort.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
gue.schmidt:
Günther
Usually it is a strict product. It's just a type constructor of some sort though
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Fri, 2007-12-28 at 09:51 -0700, Luke Palmer wrote:
On Dec 28, 2007 9:35 AM, Jules Bean [EMAIL PROTECTED] wrote:
In particular, adding sharing can stop something being GCed, which can
convert an algorithm which runs in linear time and constant space to one
which runs in linear space (and
Hello, I wonder if someone could answer the following...
The short question is what does @ mean in
mulNat a b
| a = b = mulNat' a b b
| otherwise = mulNat' b a a
where
mulNat' x@(S a) y orig
| x == one = y
| otherwise = mulNat' a
@ works as an aliasing primitive for the arguments of a function
f x@(Just y) = ...
using x in the body of f is equivalent to use Just y. Perhaps in
this case is not really useful, but in some other cases it saves the
effort and space of retyping really long expressions. And what is even
more
, Mark
Cc: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] what does @ mean?.
@ works as an aliasing primitive for the arguments of a function
f x@(Just y) = ...
using x in the body of f is equivalent to use Just y. Perhaps in
this case is not really useful, but in some other cases
2007/12/28, Alfonso Acosta [EMAIL PROTECTED]:
@ works as an aliasing primitive for the arguments of a function
f x@(Just y) = ...
using x in the body of f is equivalent to use Just y. Perhaps in
this case is not really useful, but in some other cases it saves the
effort and space of
2007/12/28, Nicholls, Mark [EMAIL PROTECTED]:
So in the example given...
mulNat a b
| a = b = mulNat' a b b
| otherwise = mulNat' b a a
where
mulNat' x@(S a) y orig
| x == one = y
| otherwise = mulNat' a (addNat orig y) orig
Lovelythank you very muchanother small step forward.
-Original Message-
From: Chaddaï Fouché [mailto:[EMAIL PROTECTED]
Sent: 28 December 2007 11:29
To: Nicholls, Mark
Cc: Alfonso Acosta; haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] what does @ mean?.
2007/12/28
On Dec 28, 2007 12:21 PM, Nicholls, Mark [EMAIL PROTECTED] wrote:
So in the example given...
Is equivalent ?
Yes, it is
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jedaï wrote:
[...]
Yes, but in the second version, it has to reconstruct (S a) before
comparing it to one where in the first it could do the comparison
directly. In this cas there may be some optimisation involved that
negate this difference but in many case it can do a real performance
Serge LE HUITOUZE wrote:
I tend to believe that the '@' notation is mere syntactic sugar.
Indeed, it seems to me that Haskell compilers need not to be very clever to
share the identical sub-expressions, for one very simple reason implied by
Haskell semantics: referential transparency.
Am I
On Dec 28, 2007 9:35 AM, Jules Bean [EMAIL PROTECTED] wrote:
In particular, adding sharing can stop something being GCed, which can
convert an algorithm which runs in linear time and constant space to one
which runs in linear space (and therefore, perhaps, quadratic time).
I've heard of this
Luke Palmer wrote:
On Dec 28, 2007 9:35 AM, Jules Bean [EMAIL PROTECTED] wrote:
In particular, adding sharing can stop something being GCed, which can
convert an algorithm which runs in linear time and constant space to one
which runs in linear space (and therefore, perhaps, quadratic time).
-cafe] what does ' mean?
Dear list
A v. newbie question.
I found the following code on the web
/-- Andrew Bromage
/
/-- If you're doing permutations, then I suppose you want this too:
//-- (subLists might be a more suggestive name)
/combinations *:: [a] - [[a]]
*combinations
Dear list
A v. newbie question.
I found the following code on the web
/-- Andrew Bromage
/
/-- If you're doing permutations, then I suppose you want this too:
//-- (subLists might be a more suggestive name)
/combinations *:: [a] - [[a]]
*combinations [] = [[]]
combinations (x:xs)
=
Logesh Pillay [EMAIL PROTECTED] wrote:
Dear list
A v. newbie question.
I found the following code on the web
/-- Andrew Bromage
/
/-- If you're doing permutations, then I suppose you want this too:
//-- (subLists might be a more suggestive name)
/combinations *:: [a] - [[a]]
Logesh Pillay wrote:
I found the following code on the web
/-- Andrew Bromage
/
/-- If you're doing permutations, then I suppose you want this too:
//-- (subLists might be a more suggestive name)
/combinations *:: [a] - [[a]]
*combinations [] = [[]]
combinations (x:xs)
= combinations
19 matches
Mail list logo