     public func close() {}
 
 }
-
 
 /// An event.
 public enum Packet<A> {

                        let k = f(+x)
                        var chan = map[k]
                        if (chan == nil) {
                            chan = Dispatcher(outer.callerContext, outer.calleeContext)
                            map[k] = chan
                            outer.emitIfOpen(.Next(Box(chan!)))
                        }
                        chan!.emitValue((k, x.raw))
                    default:
                        for o in map.values { o.emit(e.map { _ in undefined() } ) }
                    }
                }
            }

        }
    }
    
    public func map<B>(f: A -> B) -> Packet<B> {
        switch self {
        case let .Next(x): return .Next(x.map(f))
        case let .Fail(x): return .Fail(x)
        case let .Done( ): return .Done( )
        }
    }
    
    public func nullify<B>() -> Packet<B> { return map { _ in undefined() } }

}

