jsonl-0.2.0.0: JSON Lines
Safe HaskellNone
LanguageHaskell2010

JSONL

Contents

Description

Synopsis

Encode

jsonlWriteFile :: (Foldable t, ToJSON a) => FilePath -> t a -> IO () Source #

Write a collection of objects to a JSONL-encoded file

jsonlToLBS :: (Foldable t, ToJSON a) => t a -> ByteString Source #

Render a collection of objects to a JSONL-encoded ByteString

jsonLine :: ToJSON a => a -> Builder Source #

Render a single JSONL line (together with its newline)

Since: 0.2

Decode

jsonlFromLBS :: FromJSON a => ByteString -> Either String [a] Source #

Parse a JSONL-encoded collection of objects from a ByteString

If parsing fails, returns the first parsing error in a Left