polytropos-cassava: Fast CSV codecs for polytropos open records via cassava

[ csv, library, text ] [ Propose Tags ] [ Report a vulnerability ]

CSV tabular serialization and deserialization connecting polytropos open records to the standard Haskell CSV library cassava without intermediate nominal data conversions.

Supports both named records (Data.Csv.FromNamedRecord, Data.Csv.ToNamedRecord) and ordered positional records (Data.Csv.FromRecord, Data.Csv.ToRecord) with genuine heterogeneous field decoding via Polytropos.Core.AllFields. Marshals directly to and from the flat contiguous Data.Primitive.SmallArray.SmallArray payload without tuple arity restrictions.

Start at the front door module Polytropos.Cassava for complete documentation, streaming guidance, and worked examples.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.2
Change log CHANGELOG.md
Dependencies base (>=4.14 && <5), bytestring (>=0.10 && <0.13), cassava (>=0.5 && <0.6), polytropos-core (>=0.1 && <0.2), polytropos-plugin (>=0.1 && <0.2) [details]
License (EUPL-1.2 OR Apache-2.0)
Author Nadia Yvette Chambers
Maintainer nadia.yvette.chambers@ik.me
Uploaded by nyc at 2026-10-21T21:34:29Z
Category Text, CSV
Home page https://github.com/NadiaYvette/polytropos
Bug tracker https://github.com/NadiaYvette/polytropos/issues
Source repo head: git clone https://github.com/NadiaYvette/polytropos(packages/polytropos-cassava)
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-10-21 [all 1 reports]

Readme for polytropos-cassava-0.1.0.2

[back to package description]

polytropos-cassava

High-throughput CSV tabular encoding and decoding for polytropos open records via cassava.

Overview

polytropos-cassava provides ToNamedRecord and FromNamedRecord instances for open records, unrolling row fields directly into CSV header maps and byte vectors.

Features

  • Header Derivation: Automatically maps type-level field names (Symbol) to CSV headers.
  • Heterogeneous Decoding: Converts CSV row maps into flat Record r instances.
  • Zero Intermediates: Avoids intermediate tuples or algebraic data types.

Quick Example

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fplugin=Polytropos.Plugin #-}

import Data.Csv (encodeByName, header)
import Polytropos
import Polytropos.Cassava ()

type Employee = Record '[ "name" := String, "salary" := Int ]

main :: IO ()
main = do
  let emps =
        [ REC { name = "Alice", salary = 95000 }
        , REC { name = "Bob", salary = 85000 }
        ]
  print (encodeByName (header ["name", "salary"]) emps)

License

Dual-licensed under EUPL-1.2 OR Apache-2.0.