
Miguel Pignatelli
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: -- 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.