       }
     case .Remove(let range):
       array.removeRange(range)
-    case .Batch:
-      fatalError("Hmm, not a unit operation.")
+    case .Batch(let operations):
+      for operation in operations {
+        ObservableArray.performOperation(operation, onArray: &array)
+      }
     }
   }
 }

  }
  
  /// The underlying array.
  public var array: [ElementType]
  
  /// Creates a new array with the given initial value.
  public init(_ array: [ElementType]) {
    self.array = array
    
    var capturedSink: Sink! = nil
    super.init(replayLength: 1, lifecycle: .Normal) { sink in
      capturedSink = sink
      return nil
    }
    
    self.capturedSink = capturedSink
    self.capturedSink(ObservableArrayEvent(sequence: array, operation: ObservableArrayOperation.Reset(array: array)))
  }
  
  /// Performs batch updates on the array.

/// A type that can be used to encapsulate an array and observe its (incremental) changes.
public final class ObservableArray<ElementType>: EventProducer<ObservableArrayEvent<Array<ElementType>>>, ObservableArrayType {
  
  /// Batched array operations.
  private var batchedOperations: [ObservableArrayOperation<ElementType>]! = nil
  
  /// Temporary array to work with while batch is in progress.
  private var workingBatchArray: [ElementType]! = nil
  
  /// Returns `true` if batch update is in progress at the moment.
  private var isBatchUpdateInProgress: Bool {
