 # A digit in a finger tree.
 class Digit1
   constructor: -> [@a] = arguments
-  reducel: (z, op) -> op(z, @a)
-  reducer: (op, z) -> op(@a, z)
+  reduceLeft:  (z, op) -> op(z, @a)
+  reduceRight: (op, z) -> op(@a, z)
 
 class Digit2
   constructor: -> [@a, @b] = arguments
-  reducel: (z, op) -> op(op(z, @a), @b)
-  reducer: (op, z) -> op(@a, op(@b, z))
+  reduceLeft:  (z, op) -> op(op(z, @a), @b)
+  reduceRight: (op, z) -> op(@a, op(@b, z))
 
 class Digit3
   constructor: -> [@a, @b, @c] = arguments
-  reducel: (z, op) -> op(op(op(z, @a), @b), @c)
-  reducer: (op, z) -> op(@a, op(@b, op(@c, z)))
+  reduceLeft:  (z, op) -> op(op(op(z, @a), @b), @c)
+  reduceRight: (op, z) -> op(@a, op(@b, op(@c, z)))
 
 class Digit4
   constructor: -> [@a, @b, @c, @d] = arguments
-  reducel: (z, op) -> op(op(op(op(z, @a), @b), @c), @d)
-  reducer: (op, z) -> op(@a, op(@b, op(@c, op(@d, z))))
+  reduceLeft:  (z, op) -> op(op(op(op(z, @a), @b), @c), @d)
+  reduceRight: (op, z) -> op(@a, op(@b, op(@c, op(@d, z))))
 
-make_digit = (args...) ->
+makeDigit = (args...) ->
   type = switch args.length
     when 1 then Digit1
     when 2 then Digit2

    @m = middle
    @r = right

  reducel: (z, op0) ->
    op1 = reducel op0
    op2 = reducel op1
    op1(op2(op1(z, @l), @m), @r)

  reducer: (op0, z) ->
    op1 = reducer op0
    op2 = reducer op1
    op1(@l, op2(@m, op1(@r, z)))

class Single
  constructor: (a) -> @a = a

  reduceLeft:  (z, op) -> op z, @a
  reduceRight: (op, z) -> op @a, z


# A deep finger tree.
