I am trying to implement something like this:
mymin (x:[]) = x
mymin (x:y:xs) = mymin ((if x < y then x else y):xs)
mysort [] = []
mysort (x) = mymin x (mysort othervalues)
i know this code is wrong but its just the idea. How can i concat the rest of values with the min value that return the recursion. input will be like
mysort [7,9,3,7,1,2]
[1,**7,9,3,7,2**]
[1,2,**7,9,3,7**]
[1,2,3,**7,9,7**]
[1,2,3,7,**7,9**]
[1,2,3,7,7,**9**]
[1,2,3,7,7,9]