implicit final class ParserFs2Ops[In, Out] extends AnyVal
Since Parser
is by design a stream consumer, we can provide the parseF
helper which
consumes a fs2.Stream
in an effectful way. We can also provide the toPipe
method, which transforms
an input fs2.Stream
to a new stream which emits exactly one value or raises an error.
- Source
- package.scala
- Grouped
- Alphabetic
- By Inheritance
- ParserFs2Ops
- AnyVal
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##(): Int
- Definition Classes
- Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toany2stringadd[ParserFs2Ops[In, Out]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (ParserFs2Ops[In, Out], B)
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toArrowAssoc[ParserFs2Ops[In, Out]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ensuring(cond: (ParserFs2Ops[In, Out]) => Boolean, msg: => Any): ParserFs2Ops[In, Out]
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toEnsuring[ParserFs2Ops[In, Out]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (ParserFs2Ops[In, Out]) => Boolean): ParserFs2Ops[In, Out]
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toEnsuring[ParserFs2Ops[In, Out]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): ParserFs2Ops[In, Out]
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toEnsuring[ParserFs2Ops[In, Out]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): ParserFs2Ops[In, Out]
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toEnsuring[ParserFs2Ops[In, Out]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toStringFormat[ParserFs2Ops[In, Out]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def parseF[F[_], G[_]](stream: Stream[F, In])(implicit compiler: Compiler[F, G], G: MonadError[G, Throwable], pos: CallerPos): G[Out]
Convenience for
stream.through(parser.toPipe).compile.lastOrError
.Convenience for
stream.through(parser.toPipe).compile.lastOrError
.Uses this parser to pull from the
stream
until the parser emits a result or the stream is depleted.- F
The stream effect type, e.g.
cats.effect.IO
- G
The stream-compiler output type. Usually the same as
F
- stream
The stream of events (of type
In
) to consume- compiler
The fs2 stream compiler
- G
Evidence that the
G
effect type can raise Throwables as errors- pos
call-point information used to generate the top SpacTraceElement for error handling
- def toPipe[F[_]](implicit pos: CallerPos): Pipe[F, In, Out]
Convert this parser to a FS2 "Pipe".
Convert this parser to a FS2 "Pipe". The resulting pipe will forward inputs from the upstream into this parser, emitting a single value to the downstream when this parser finishes. Since a
Parser
may abort early (e.g. withParser.first
), the pipe may not pull the entire input stream. - def toString(): String
- Definition Classes
- Any
Deprecated Value Members
- def →[B](y: B): (ParserFs2Ops[In, Out], B)
- Implicit
- This member is added by an implicit conversion from ParserFs2Ops[In, Out] toArrowAssoc[ParserFs2Ops[In, Out]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.