Skip to content

Commit

Permalink
Use context bound
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz authored and travisbrown committed Sep 7, 2018
1 parent fb02783 commit dcfd13b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/io/circe/fs2/package.scala
Expand Up @@ -17,18 +17,18 @@ package object fs2 {

final def byteStreamParserC[F[_] : RaiseThrowable]: Pipe[F, Chunk[Byte], Json] = byteParserC(AsyncParser.ValueStream)

final def stringParser[F[_]](mode: AsyncParser.Mode)(implicit F: RaiseThrowable[F]): Pipe[F, String, Json] = new ParsingPipe[F, String] {
override protected[this] val raiseThrowable: RaiseThrowable[F] = F
final def stringParser[F[_] : RaiseThrowable](mode: AsyncParser.Mode): Pipe[F, String, Json] = new ParsingPipe[F, String] {
override protected[this] val raiseThrowable: RaiseThrowable[F] = implicitly[RaiseThrowable[F]]

protected[this] final def parseWith(p: AsyncParser[Json])(in: String): Either[ParseException, Seq[Json]] =
p.absorb(in)(CirceSupportParser.facade)

protected[this] val parsingMode: AsyncParser.Mode = mode
}

final def byteParserC[F[_]](mode: AsyncParser.Mode)(implicit F: RaiseThrowable[F]): Pipe[F, Chunk[Byte], Json] =
final def byteParserC[F[_] : RaiseThrowable](mode: AsyncParser.Mode): Pipe[F, Chunk[Byte], Json] =
new ParsingPipe[F, Chunk[Byte]] {
override protected[this] val raiseThrowable: RaiseThrowable[F] = F
override protected[this] val raiseThrowable: RaiseThrowable[F] = implicitly[RaiseThrowable[F]]

protected[this] final def parseWith(p: AsyncParser[Json])(in: Chunk[Byte]): Either[ParseException, Seq[Json]] =
p.absorb(in.toArray)(CirceSupportParser.facade)
Expand Down

0 comments on commit dcfd13b

Please sign in to comment.