aihc-cabal-syntax: Parse Cabal files for aihc

[ library, parsing ] [ Propose Tags ] [ Report a vulnerability ]

Parse Cabal package files for the aihc compiler. Read package data, version ranges, and condition expressions.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0.1
Change log CHANGELOG.md
Dependencies base (>=4.16 && <5), bytestring (<0.13), containers (<0.9), megaparsec (>=9 && <10), parser-combinators (<1.4), text (<2.2) [details]
License Unlicense
Author
Maintainer David Himmelstrup <lemmih@gmail.com>
Uploaded by DavidHimmelstrup at 2026-09-29T08:06:16Z
Category Parsing
Distributions
Downloads 2 total (2 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-09-29 [all 1 reports]

Readme for aihc-cabal-syntax-1.0.0.1

[back to package description]

aihc-cabal-syntax

A small Haskell library that parses .cabal files for the aihc compiler. It provides package data, version ranges, and condition evaluation without a runtime dependency on Cabal or Cabal-syntax. It uses Megaparsec. It does not solve dependencies or build packages.

Hackage results

The fixed Hackage index contains 200,642 file revisions. The reference parser is Cabal-syntax 3.18.1.0.

Result Files All files
aihc-cabal-syntax accepts 200,642 100.00%
Cabal-syntax accepts 200,642 100.00%
Equal converted data 200,642 100.00%

An accepted file does not prove full compliance. The equality test compares complete GenericPackageDescription values after conversion of our AST. Conversion limits can also cause differences. This library is not a complete replacement for Cabal-syntax.

Stackage LTS results

The Stackage test uses Stackage LTS 24.38 with 3,370 packages. The pinned Nixpkgs revision supplies the package list. The test uses the last revision of each package version in the fixed Hackage index.

Result Packages All packages
aihc-cabal-syntax accepts 3,370 100.00%
Cabal-syntax accepts 3,370 100.00%
Equal converted data 3,370 100.00%

The Nix check fails if a package in the snapshot does not have equal converted data.

Parse benchmark

Each parser reads all 200,642 revisions in a separate process on the same machine.

Measurement aihc-cabal-syntax Cabal-syntax aihc / Cabal-syntax
Elapsed time 47.64 s 132.77 s 0.36×
Peak process memory (RSS) 23.20 MiB 37.56 MiB 0.62×

A ratio below 1 means less time or memory than Cabal-syntax. Measured on aarch64-darwin with GHC 9.10.3, -O2, and one RTS capability. Time includes archive input, parsing, and result evaluation through show. The benchmark includes rejected files. It discards each result before the next file. Each parser has one measured run. Machine load and file caching affect the time. The parsers produce different data and accept different numbers of files; these ratios include that difference.

Build and update

nix build --no-update-lock-file
nix flake check --no-update-lock-file
nix run .#update-readme --no-update-lock-file

The update command runs the full comparison and a new benchmark, then writes this README and the measurement data. Nix pins the tools and test data. See test details and API use and limits.