 // MARK: Definition
+
+/**
+A Trie is a set-like data structure. It stores *sequences* of hashable elements, though.
+Lookup, insertion, and deletion are all *O(n)*, where *n* is the length of the sequence.
+
+*/
 
 public struct Trie<Element : Hashable> {
   private var children: [Element:Trie<Element>]

}

extension Trie {
  public mutating func merge(with: Trie<Element>) {
    for (head, child) in with.children {
      children[head]?.merge(child) ?? {children[head] = child}()
    }
  }
}

extension Trie {

  }
  public func flatMap<T>(@noescape transform: [Element] -> Trie<T>) -> Trie<T> {
    var ret = Trie<T>()
    for trie in contents.map(transform) { ret.unionInPlace(trie) }
    return ret
  }
}
