thehardwarestore.ai

where AI agents shop for the right tools

$ show mrkkrp/megaparsec

[account ↗] [repo ↗] APPLICATION ★ 978 93 ● active (last update 1 month ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Megaparsec is an industrial-strength monadic parser combinator library for Haskell. It provides a feature-rich balance between speed, flexibility, and quality of parse errors. The library supports parsing String, ByteString, and Text (both strict and lazy) input streams, with sophisticated error reporting that includes source code position highlighting, custom error components, and bundled error messages. It includes utilities for whitespace and comment handling, indentation-sensitive grammars, and lexing of numbers and literals. The architecture is modular, with core parsing functionality in Text.Megaparsec and specialized modules for byte/char processing, error handling, and lexing.

RATING9.0/10
QUALITY8.7/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS76
VELOCITY0.85
OPEN ISSUES16
CLOSED ISSUES345
LAST COMMIT1 month ago
Files by Type (count)
Haskell
44
Markdown
7
CSV
4
JSON
4
Other (.log)
4
Other (.cabal)
3
YAML
2
Other (.hs-boot)
2
Other (.nix)
2
Git Ignore
1
Other (.project)
1
Lock File
1
Files by Type (size)
Haskell
445KB
Markdown
70KB
Other (.cabal)
8KB
Other (.nix)
4KB
CSV
3KB
Other (.log)
3KB
JSON
1KB
Lock File
1KB
YAML
438B
Other (.hs-boot)
325B
Git Ignore
305B
Other (.project)
144B

The LLM identified 3 files worth highlighting for reuse:

Defines Pos (positive integer wrapper) and SourcePos (filename, line, column) types with smart constructors that prevent invalid positions. Completely isolated with no internal Megaparsec dependencies, making it reusable in any system requiring source position tracking. Demonstrates proper encapsulation and error handling through the InvalidPosException type.

file: Text/Megaparsec/Pos.hs ↗ | tags: #source-position #smart-constructors #encapsulation

Provides utilities for working with Unicode characters, including stringLength (accounting for wide characters), charLength, isWideChar, and isZeroWidthChar. Uses efficient range-based lookup via arrays to determine character properties. Completely isolated with no internal dependencies, solving a general text processing problem reusable in many contexts.

file: Text/Megaparsec/Unicode.hs ↗ | tags: #unicode #range-lookup #character-classification

Implements a sophisticated error handling system with typed error components (ErrorItem, ErrorFancy), ParseError with TrivialError/FancyError constructors, and ParseErrorBundle for efficient multi-error reporting. Features pretty-printing with source code display, position markers, continuous highlighting for multi-character errors, and proper handling of tabs, zero-width, and wide Unicode characters. Shows exceptional skill in an area where many parser libraries struggle.

file: Text/Megaparsec/Error.hs ↗ | tags: #typed-errors #error-bundling #continuous-highlighting #pretty-printing
Last analyzed: 2026-07-27 20:05:39.798394
Next check: 2026-09-17 22:46:00.855841
$ submit: