[Haskell-cafe] Re: Re: Proving stuff about IORefs

Ben Franksen ben.franksen at online.de
Sun Oct 17 08:19:57 EDT 2010


Ben Millwood wrote:
> On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace
> <malcolm.wallace at me.com> wrote:
>>
>> The problem with the code you originally posted was that it looked like
>> this:
>>
>> f r = do r' <- something
>> f r'
>> something else -- this is dead code
>>
>> That is, the computation is non-terminating, because f simply calls
>> itself recursively, with no base case.
>>
>> Regards,
>> Malcolm
> 
> He was using ==, not =, it was a statement of equality not a definition :)
> 
> Much like one might say that sort xs == sort (reverse xs).

Yes, I thought that was obvious from the context. A different layout i.e.

  f r
= 
  do r' <- something
     f r'

would have made that clearer.

Cheers
Ben



More information about the Haskell-Cafe mailing list