
7stud wrote:
Miguel Pignatelli
writes: What about...
mySort xs = let myCompare x y | lx < ly = LT | lx == ly = EQ | lx > ly = GT where lx = length x ly = length y in sortBy myCompare xs
That doesn't work for me:
Yes, sorry about that, it is an issue with indentation while copy/pasting the code M;
-- bhask.hs
mySort xs = let myCompare x y | lx < ly = LT | lx == ly = EQ | lx > ly = GT where lx = length x ly = length y in sortBy myCompare xs
Prelude> :load bhask.hs [1 of 1] Compiling Main ( bhask.hs, interpreted )
bhask.hs:4:16: parse error (possibly incorrect indentation) Failed, modules loaded: none. Prelude>
Line 4 is the first guard.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners