F#unctional Immutable Trie (Prefix Tree)
There are several libraries for writing unit tests in F#. For example:


FsUnit
Unquote
Fuchu


The logic is pretty clear, but there are a couple of comments

1.
Instead of:

        let child = 
            match Map.tryFind el trie.Children with
            | Some t -&gt; t
            | None -&gt; empty


you can rewrite this code with using defaultArg

        let child = 
            Map.tryFind el trie.Children
            |&gt; defaultArg  &lt;| empty


2.
You can use functions from a module Option, so..instead:

        match Map.tryFind el trie.Children with
        | Some t -&gt; contains els t
        | None -&gt; false


better:

        Map.tryFind el trie.Children
        |&gt; Option.exists (contains els)