mello: No-fuss syntax with s-expressions

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

Please see the README on GitHub at https://github.com/ejconlon/mello#readme


[Skip to Readme]

Modules

[Last Documentation]

  • Mello
    • Mello.Match
    • Mello.Parse
    • Mello.Print
    • Mello.Recognize
    • Mello.Syntax
    • Mello.Text

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1
Dependencies base (>=4.12 && <5), bowtie (>=0.8 && <0.9), containers (>=0.6 && <0.9), foldl (>=1.4 && <1.5), hashable (>=1.4 && <1.6), looksee (>=0.8 && <0.9), mtl (>=2.3 && <2.5), prettyprinter (>=1.7 && <1.8), recursion-schemes (>=5.2 && <5.3), scientific (>=0.3 && <0.4), text (>=2.0 && <2.2) [details]
Tested with ghc ==9.6.4
License BSD-3-Clause
Copyright (c) 2024 Eric Conlon
Author Eric Conlon
Maintainer ejconlon@gmail.com
Uploaded by ejconlon at 2026-06-07T23:27:17Z
Category Parsing
Home page https://github.com/ejconlon/mello#readme
Bug tracker https://github.com/ejconlon/mello/issues
Source repo head: git clone https://github.com/ejconlon/mello
Distributions
Downloads 183 total (22 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-06-08 [all 2 reports]

Readme for mello-0.7.1

[back to package description]

mello

No-fuss syntax with s-expressions

Parsing Diagnostics

Mello.Parse exposes two parsing entry points:

  • parseSexp :: Text -> Either (Err Void) LocSexp preserves the original Looksee error API.
  • parseSexpDetailed :: Text -> Either ParseErr LocSexp adds Mello-domain diagnostics before falling back to Looksee errors.

ParseErr classifies delimiter failures with source locations:

  • ParseErrUnclosedList Brace LocSpan
  • ParseErrUnexpectedClose Brace LocSpan
  • ParseErrMismatchedBrace Brace LocSpan Brace LocSpan
  • ParseErrLooksee LocSpan (Err Void)

ParseErrLooksee intentionally keeps the raw Looksee.Err while also carrying its span converted to LocSpan. This lets clients either render with Looksee or use Mello line/column locations without traversing Looksee internals.

For interactive use, parseSexpI prints Looksee parse errors and parseSexpDetailedI prints detailed delimiter errors or the underlying Looksee parse error.

Delimiter Recognition

Mello.Recognize provides a lightweight delimiter recognizer used by parseSexpDetailed:

  • recognizeSexpText :: Text -> Either RecogErr ()
  • sexpRecognizer :: Fold Char (Either RecogErr ())

The recognizer checks delimiter balance while respecting strings, chars, comments, and escapes. It does not parse s-expressions; it only reports offset-based delimiter errors:

  • RecogErrUnclosedList Brace openOffset eofOffset
  • RecogErrUnexpectedClose Brace closeOffset
  • RecogErrMismatchedBrace expected openOffset actual closeOffset