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.
Re^3: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)
Replies are listed 'Best First'.
|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 (Hermit) on Jul 04, 2013 at 16:22 UTC