编辑代码

sorted :: Ord a => [a] -> Bool
sorted [] = true
sorted [h] = true
sorted (h:t) 
    | h <= (head t) = sorted t
    | otherwise = false