Can anyone shed some light on the following error? Thanks in advance.

isSorted :: Ord a => [a] -> Bool
isSorted [] = True
isSorted [x] = True
isSorted (x1:x2:xs)
        | x1 <= x2  = isSorted (x2:xs)
        | otherwise = False

--------
Hugs session for:
/usr/local/share/hugs/lib/Prelude.hs
haskell/sort.hs
Main> isSorted [1]
True
Main> isSorted [1,2]
True
Main> isSorted [2,1]
False
Main> isSorted []
ERROR: Unresolved overloading
*** Type       : Ord a => Bool
*** Expression : isSorted []
--------


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to