Skip to content

Instantly share code, notes, and snippets.

@4lex1v
Last active August 29, 2015 14:00
Show Gist options
  • Save 4lex1v/11373538 to your computer and use it in GitHub Desktop.
Save 4lex1v/11373538 to your computer and use it in GitHub Desktop.
StreamT marshaller
implicit def streamTMarshaller[M[+_]](implicit mtm: MarshallerM[M], M: Monad[M], arf: ActorRefFactory) = {
new MarshallerM[({ type λ[α] = StreamT[M, α] })#λ] {
override def marshaller[T](implicit mt: Marshaller[T]): Marshaller[StreamT[M, T]] = {
new Marshaller[StreamT[M, T]] {
override def apply(value: StreamT[M, T], ctx: MarshallingContext): Unit = {
implicitly[MarshallerM[M]].marshaller[Stream[T]].apply(value.toStream, ctx)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment