Directory listing, sorting and filtering in F#
I am not sure if I can summarize the changes I made better, but I made several refactorings and better error handling (when inputing a string, for example, your program crashed.) I also chose to make it zero-indexed, rather than 1-indexed, mostly to simplify the code.

open System
open System.IO

let getLatestSubDir = Seq.maxBy Directory.GetCreationTime // Refactored
let sortedSubDirs = Directory.GetDirectories &gt;&gt; Seq.sort // Refactored
let printDirMenu = 
    sortedSubDirs &gt;&gt; Seq.iteri (fun idx path -&gt; printfn "%d %s" idx path)
let openDir (dir : string) = System.Diagnostics.Process.Start(dir) |&gt; ignore

[&lt;EntryPoint&gt;]
let main argv = 
    let path = argv |&gt; Seq.head
    printDirMenu path
    let input = System.Console.ReadLine()
    match Int32.TryParse(input) with
    | true, n -&gt; 
        let dir = 
            path
            |&gt; sortedSubDirs
            |&gt; Seq.tryItem n
        match dir with
        | Some d -&gt; 
            Directory.GetDirectories(d)
            |&gt; getLatestSubDir
            |&gt; openDir
        | None -&gt; printfn "Invalid input"
    | _ -&gt; printfn "Invalid input"
    Console.ReadKey() |&gt; ignore
    0


It is definitely possible to factor the sorting so it is only done once, rather than twice in my code.

The code also crashes when the chosen folder doesn't have any sub folders.