 			})
 
 			subscriber.disposable.addDisposable(disposable)
-		}
-	}
-
-	/// Merges a signal of signals down into a single signal, biased toward the
-	/// signals added earlier.
-	///
-	/// evidence - Used to prove to the typechecker that the receiver is
-	///            a signal of signals. Simply pass in the `identity` function.
-	///
-	/// Returns a signal that will forward events from the original signals
-	/// as they arrive.
-	public func merge<U>(evidence: ColdSignal<T> -> ColdSignal<ColdSignal<U>>) -> ColdSignal<U> {
-		return ColdSignal<U> { subscriber in
-			let disposable = CompositeDisposable()
-			let inFlight = Atomic(1)
-
-			let decrementInFlight: () -> () = {
-				let orig = inFlight.modify { $0 - 1 }
-				if orig == 1 {
-					subscriber.put(.Completed)
-				}
-			}
-
-			let selfDisposable = evidence(self).subscribe(next: { stream in
-				inFlight.modify { $0 + 1 }
-
-				let streamDisposable = SerialDisposable()
-				disposable.addDisposable(streamDisposable)
-
-				streamDisposable.innerDisposable = stream.subscribe(Subscriber { event in
-					if event.isTerminating {
-						streamDisposable.dispose()
-						disposable.pruneDisposed()
-					}
-
-					switch event {
-					case let .Completed:
-						decrementInFlight()
-
-					default:
-						subscriber.put(event)
-					}
-				})
-			}, error: { error in
-				subscriber.put(.Error(error))
-			}, completed: {
-				decrementInFlight()
-			})
-
-			subscriber.disposable.addDisposable(selfDisposable)
-		}
-	}
-
-	/// Switches on a signal of signal, forwarding events from the
-	/// latest inner signal.
-	///
-	/// evidence - Used to prove to the typechecker that the receiver is
-	///            a signal of signals. Simply pass in the `identity` function.
-	///
-	/// Returns a signal that will forward events only from the latest
-	/// signal sent upon the receiver.
-	public func switchToLatest<U>(evidence: ColdSignal<T> -> ColdSignal<ColdSignal<U>>) -> ColdSignal<U> {
-		return ColdSignal<U> { subscriber in
-			let selfCompleted = Atomic(false)
-			let latestCompleted = Atomic(false)
-
-			let completeIfNecessary: () -> () = {
-				if selfCompleted.value && latestCompleted.value {
-					subscriber.put(.Completed)
-				}
-			}
-
-			let latestDisposable = SerialDisposable()
-			subscriber.disposable.addDisposable(latestDisposable)
-
-			let selfDisposable = evidence(self).subscribe(next: { stream in
-				latestDisposable.innerDisposable = nil
-				latestDisposable.innerDisposable = stream.subscribe(Subscriber { innerEvent in
-					switch innerEvent {
-					case let .Completed:
-						latestCompleted.value = true
-						completeIfNecessary()
-
-					default:
-						subscriber.put(innerEvent)
-					}
-				})
-			}, error: { error in
-				subscriber.put(.Error(error))
-			}, completed: {
-				selfCompleted.value = true
-				completeIfNecessary()
-			})
-
-			subscriber.disposable.addDisposable(selfDisposable)
 		}
 	}
 

		}
	}

	/// Concatenates `signal` after the receiver.
	public func concat(signal: ColdSignal) -> ColdSignal {
		return ColdSignal { subscriber in
			let serialDisposable = SerialDisposable()
			subscriber.disposable.addDisposable(serialDisposable)

			serialDisposable.innerDisposable = self.subscribe(Subscriber { event in
				switch event {
				case let .Completed:
					serialDisposable.innerDisposable = signal.subscribe(subscriber)

				default:
					subscriber.put(event)
				}
			})
		}
	}

	/// Waits for the receiver to complete successfully, then forwards only the
	/// last `count` values.
	public func takeLast(count: Int) -> ColdSignal {

	public func subscribe(next: T -> () = doNothing, error: NSError -> () = doNothing, completed: () -> () = doNothing) -> Disposable {
		return subscribe(Subscriber(next: next, error: error, completed: completed))
	}
}

/// Convenience constructors.
extension ColdSignal {
	/// Creates a signal that will execute the given action upon subscription,
	/// then forward all events from the generated signal.
	public static func defer(action: () -> ColdSignal) -> ColdSignal {
		return ColdSignal { subscriber in
			action().subscribe(subscriber)
			return ()
		}
	}

	/// Creates a signal that will immediately complete.
	public static func empty() -> ColdSignal {
		return ColdSignal { subscriber in
			subscriber.put(.Completed)
		}
	}

	/// Creates a signal that will immediately yield a single value then
	/// complete.
	public static func single(value: T) -> ColdSignal {
		return ColdSignal { subscriber in
			subscriber.put(.Next(Box(value)))
			subscriber.put(.Completed)
		}
	}

	/// Creates a signal that will immediately generate an error.
	public static func error(error: NSError) -> ColdSignal {
		return ColdSignal { subscriber in
			subscriber.put(.Error(error))
		}
	}

	/// Creates a signal that will never send any events.
	public static func never() -> ColdSignal {
		return ColdSignal { _ in () }
	}

	/// Creates a signal that will iterate over the given sequence whenever a
	/// Subscriber is attached.
	///
	/// If the signal will be consumed multiple times, the given sequence must
	/// be multi-pass (i.e., support obtaining and using multiple generators).
	public static func fromValues<S: SequenceType where S.Generator.Element == T>(values: S) -> ColdSignal {
		return ColdSignal { subscriber in
			var generator = values.generate()

			while let value: T = generator.next() {
				subscriber.put(.Next(Box(value)))
			}

			subscriber.put(.Completed)
		}
	}
}

/// Transformative operators.
extension ColdSignal {
	/// Maps over the elements of the signal, accumulating a state along the
	/// way.
	///
