_)) => (insert_host(u) andThen insert_from)(hs) case >>>(Response(_, hs, _)) if hs ?: UID => hs :-: UID } class FilterHeader(g: PartialFunction[Direction, List[String]]) extends Stage {...} object FilterHeader { sealed trait Direction case class >>>(frame: Frame) extends Direction case class <<<(frame: Frame) extends Direction def apply(g: PartialFunction[Direction, List[String]]) = new FilterHeader(g) }