Haskell Check If List Is Sorted

[Solved] Haskell Check If List Is Sorted | Haskell - Code Explorer | yomemimo.com
Question : haskell check if list is sorted

Answered by : glorious-gerenuk-jfm2b92bvrze

sorted :: (Ord a) => [a] -> Bool
sorted [] = True
sorted [x] = True
sorted (x:y:xs) = if x <= y then sorted (y:xs) else False

Source : | Last Update : Fri, 05 Feb 21

Answers related to haskell check if list is sorted

Code Explorer Popular Question For Haskell