Safe Haskell | None |
---|---|
Language | Haskell2010 |
JSON Lines https://jsonlines.org/
Synopsis
- jsonlWriteFile :: (Foldable t, ToJSON a) => FilePath -> t a -> IO ()
- jsonlToLBS :: (Foldable t, ToJSON a) => t a -> ByteString
- jsonlBuilder :: (Foldable t, ToJSON a) => t a -> Builder
- jsonLine :: ToJSON a => a -> Builder
- jsonlFromLBS :: FromJSON a => ByteString -> Either String [a]
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