package fs2
Provides implicits to allow for interop between the core SPaC classes and fs2 / cats-effect.
- Parser
gets toPipe
and parseF
- Transformer
gets toPipe
- Source
gets toResource
and toStream
- Source
- package.scala
- Alphabetic
- By Inheritance
- fs2
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit final class ParserFs2Ops[In, Out] extends AnyVal
Since
Parser
is by design a stream consumer, we can provide theparseF
helper which consumes afs2.Stream
in an effectful way.Since
Parser
is by design a stream consumer, we can provide theparseF
helper which consumes afs2.Stream
in an effectful way. We can also provide thetoPipe
method, which transforms an inputfs2.Stream
to a new stream which emits exactly one value or raises an error. - implicit final class SourceFs2Ops[A] extends AnyVal
Since
Source
is a synchronous-only encoding of theResource
pattern, it can be converted to acats.effect.Resource
by suspending itsopen
andclose
operations in a Sync effect typeF
, yielding anIterator[A]
as its value.Since
Source
is a synchronous-only encoding of theResource
pattern, it can be converted to acats.effect.Resource
by suspending itsopen
andclose
operations in a Sync effect typeF
, yielding anIterator[A]
as its value.This can be taken a step further by lifting that
Resource
to afs2.Stream
and wrapping the provided Iterator as a stream, to treat the wholeSource[A]
as afs2.Stream[F, A]
- implicit final class TransformerFs2Ops[In, Out] extends AnyVal
Since a
Transformer
is by design a stream transformation, we can naturally provide a conversion fromTransformer
tofs2.Pipe
Value Members
- implicit def unconsableForFs2Chunk: Unconsable[Chunk]