isort :: [Int] -> [Int]
isort :: [Int] -> [Int]. isort [ ] = [ ] isort (head : tail) = insert head (isort tail) where insert v [] = [v] insert v (h : t) = if v <= h then v : h : t else h : (insert v t) Main> isort [9,5,2,8,3] [2,3,5,8,9]. List Comprehensions. General form Body Selector
204 views • 7 slides