     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.


exports ?= this.pazy ?= {}

exports.Empty       = Empty

#
# Copyright (c) 2011 Olaf Delgado-Friedrichs (odf@github.com)
# --------------------------------------------------------------------


if typeof(require) != 'undefined'
  require.paths.unshift('#{__dirname}/../lib')
  { Sequence } = require('sequence')
else
  { Sequence } = pazy


# A node.
