   reduceLeft  = (op) -> (z, x) -> x.reduceLeft(z, op)
   reduceRight = (op) -> (x, z) -> x.reduceRight(op, z)
 
-  asTree = (s) -> reduceLeft((a, b) -> a.before b) Empty, s
+  asTree = (s) -> s.reduceLeft Empty, (a, b) -> a.before b
+  asSeq  = (s) -> s.reduceRight ((a, b) -> Sequence.conj a, -> b), null
 
   constructor: (left, mid, right) ->
     @l = left


exports ?= this.pazy ?= {}

exports.Empty       = Empty

    else
      new Deep @l, @m, @r.init()

  nodes = (n, s) ->
    if n == 0
      null
    else if n == 2 or n % 3 == 1
      Sequence.conj new Tree2(s.take(3).into([])...), -> nodes n-2, s.drop 2
    else if n >= 3
      Sequence.conj new Tree3(s.take(3).into([])...), -> nodes n-3, s.drop 3
    else
      raise new Error "this should not happen"


# --------------------------------------------------------------------
# Exporting.
