Attoparsec-monoidal

attoparsec-monoidal is fork of attoparsec parser combinator library allowed to implement right-to-left CSV parser for RobinHood activity report processor with “constant” memory footprint. The problem with these reports is row order is important, but rows are reversed. So classic parser combinator library is not applicable without loading whole input.

4 Likes

The library is interesting, but the name you chose for it is misleading. I expected it would be something like picoparsec, generalizing attoparsec to any monoidal (or rather LeftGCDMonoid and FactorialMonoid) input type.

I’m not sure I can offer a better alternative though: attoparsec-bidirectional might be mistaken for parsing and serializing, attoparsec-commutative is rather obscure.

I didn’t want to choose a name.
In left-to-right mode library is 100% compatible with attoparsec so I sent a pull request and have not published the library on Hackage in the hope of the merge.

On other side I had to come with a new name because attoparsec is used by HLS and nixpkgs dependency management breaks.

Reason behind the current name:

  • should contain attoparsec prefix to be easy discoverable by hackage search
  • when I was hoogling for classes with signature f a -> f b -> f (a, b) I found Monoidal one from invertible library.
  • “monoidal” is pretty buzzy )

Please, please take some time to understand what the word means before you use it.

2 Likes

I will change package name to attoparsec-isotropic.