jsonl-conduit-0.1.1: Conduit interface to JSONL-encoded data
Safe HaskellNone
LanguageHaskell2010

JSONL.Conduit

Description

Streaming interface for JSONL-encoded files, based on conduit

The JSONL (JSON Lines) format : https://jsonlines.org/

Synopsis

Encode

jsonToLBSC :: (ToJSON a, Monad m) => ConduitT a o m ByteString Source #

Render a stream of JSON-encodable objects into a ByteString

I/O

sinkFileC Source #

Arguments

:: (ToJSON a, MonadResource m) 
=> FilePath

path of JSONL file to be created

-> ConduitT a o m () 

Render a stream of JSON-encodable objects into a JSONL file

appendFileC :: (ToJSON a, MonadResource m) => FilePath -> ConduitT a o m () Source #

Like sinkFileC but in AppendMode, which means that the handle is positioned at the end of the file.

Since: 0.1.1

Decode

jsonFromLBSC :: (FromJSON a, Monad m) => ByteString -> ConduitT Void a m () Source #

Source a ByteString for JSONL records

I/O

sourceFileC Source #

Arguments

:: (MonadResource m, FromJSON a) 
=> FilePath

path of JSONL file to be read

-> ConduitT () a m () 

Read a JSONL file and stream the decoded records

NB : ignores any parsing errors and returns