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.
In reply to Re^3: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)
by raiph
in thread Capturing parenthesis and grouping square brackets
by Eily
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |