putStr

Ferenc Wagner wferi at afavant.elte.hu
Tue Oct 14 17:13:08 EDT 2003


Keith Wansbrough <Keith.Wansbrough at cl.cam.ac.uk> writes:

>> Hal Daume III <hdaume at 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
>
> It is much easier to use in real code.  Consider
> [...]

You went to extreme lengths answering my silly question.
Thanks a lot, I see the point now.

Feri.


More information about the Haskell-Cafe mailing list