[Haskell-cafe] Clarification on proof section of HS: The Craft of FP

Daniel Carrera dcarrera at digitaldistribution.com
Mon May 2 10:16:44 EDT 2005


Henning Thielemann wrote:

>> Well, I also omited the word "countable". I figure it's understood 
>> since computers only deal with finite data. And given an infinite 
>> list, any finite "head" of it would meet the criteria, so the 
>> distinction is moot. Unless Haskell has some neat property I am not 
>> aware of :-)
> 
> If you don't take care you may end up "proving" that e.g.
>   repeat 1 ++ [0]  ==  repeat 0
>  because for the first list you can prove that every reachable element 
> is equal to its neighbour and the "last" element is 0.

Note:  I'm totally new at Haskell.

What does ++ do?
What does 'repeat' do?

Cheers,
Daniel.


More information about the Haskell-Cafe mailing list