RE: Avoiding use of the stack

"Josef Svenningsson" <[email protected]>
Newsgroups gmane.comp.lang.haskell.hugs.user
Message-ID <[email protected]>
> -----Original Message-----
> From: [email protected]
> Sent: den 20 november 2004 14:19
> To: [email protected]
> Subject: RE: [Hugs-users] Avoiding use of the stack
> 
> G'day all.
> 
> Quoting Josef Svenningsson <[email protected]>:
> 
> > In what sense is it wrong, and in what sense does this example show
> that?
> 
> The time that you want to use $! is when you want some argument to some
> function to be strict.  Unfortunately, $! and $ have different
> associativities to normal function application, requiring you to introduce
> readability-imparing parentheses if the strict argument is not the last
> one:
> 
>         testR2' a n = (testR2' $! (a+n)) (n-1)
> 
> If $! and $ were both left-associative, you could write this instead:
> 
>         testR2' a n = testR2' $! (a+n) $ (n-1)
> 
Ah, you're quite right of course. This surely must be a bug in the report.

Cheers,

	/Josef
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.