[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: Re: putStr
From: Hal Daume III <hdaume () ISI ! EDU>
Date: 2003-10-14 14:20:16
Message-ID: 1066141216.7474.2.camel () hal
[Download RAW message or body]
In addition to what Keith said, it's also guarenteed that the trace is
evaluated as soon as the function is entered.
- Hal
On Tue, 2003-10-14 at 02:36, Ferenc Wagner wrote:
> Hal Daume III <hdaume@ISI.EDU> writes:
>
> >> f1 :: Int -> Int
> >> f1 x
> >> | trace ("The initial value is " ++ show x) False = undefined
> >> | otherwise = f2 x
> >
> > In general, the 'trace ... False = undefined' thing is
> > quite useful
>
> How is it better than
>
> > f1 x = trace ("The initial value is " ++ show x) $ f2 x
>
> ?
>
> Feri.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
--
Hal Daume III | hdaume@isi.edu
"Arrest this man, he talks in maths." | www.isi.edu/~hdaume
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic