Created
August 16, 2011 12:25
-
-
Save kakkun61/1148954 to your computer and use it in GitHub Desktop.
Real World Haskell, Ex. 3.2.6 (p.72 in Ja)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.List | |
sortByLength = sortBy ord | |
where ord l1 l2 = if length l1 < length l2 | |
then LT | |
else if length l1 > length l2 | |
then GT | |
else EQ | |
where l1l = length l1 | |
l2l = length l2 | |
-- 8:8: parse error on input `where' |
Indent the where
line so that it starts further to the right than the line before:
else EQ
where l1l = length l1
Thank you very much.
Hmm, Offside rule is different for me.
I'll try to learn.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh! It's so simple. Thank you.
But I want to know why the error occurred.