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."
I've read both codes and both explanations (the fact that the one for Haskell is quite a bit shorter is telling. On a Perl forum.) and still think the Haskell code is much clearer and cleaner.
A better explanation of the Perl6 code might help somewhat. "take yields a value that is added to a gather'd list." Humpf?!? "Cool is a flavor of undef." Whatafuck?
Heck the all fringe($a) Z=== fringe($b) alone is crazy enough to require two pages of explanation.
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re^2: Haskell vs Perl 6 (was Re: Capturing parenthesis and grouping square brackets)
by Jenda
in thread Capturing parenthesis and grouping square brackets
by Eily
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |