I'd add a note saying something like "While the code looks like the two trees are flattened to lists first and then compared, Haskell is lazy, which means that behind the scenes it will only do as much work as it has to and stop flattening once it finds the first mismatch. Simply don't worry about it. It works."
This is misleading, as it suggests that P6's gather/take is not lazy. Would you be willing to update your comment to fix this mistake?
Update: I was wrong. Apologies to Jenda.
|Comment on Re^3: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)|
|Re^4: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)|
by Jenda (Abbot) on Jul 04, 2013 at 15:46 UTC
by raiph (Friar) on Jul 04, 2013 at 16:22 UTC