Sorting algorithms/Sleep sort: Difference between revisions

Content added Content deleted
No edit summary
Line 555: Line 555:
end while
end while
end if</lang>
end if</lang>

=={{header|F#}}==
<lang fsharp>
let sleepSort (values: seq<int>) =
values
|> Seq.map (fun x -> async {
do! Async.Sleep x
Console.WriteLine x
})
|> Async.Parallel
|> Async.Ignore
|> Async.RunSynchronously
</lang>

Usage:
<lang fsharp>
sleepSort [10; 33; 80; 32]
10
32
33
80
</lang>


=={{header|Factor}}==
=={{header|Factor}}==