
8 Jun
2009
8 Jun
'09
1:01 p.m.
Jan Christiansen wrote:
This definition is too strict. The evaluation of intersect [] [1..] yields [] while the evaluation of intersect [1..] [] does not terminate. This function can be improved such that it yields the empty list in both cases. This function was probably not implemented by a Haskell novice ; )
Right, so unlike in append in this example the extra case for [] is actually desirable! Welcome to Haskell. ;-) Martijn.