登录 注册

megaparsec

去点 Star
数据分析与数据处理
981
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Haskell
语言
—
创建时间
最近更新

项目能做什么

Megaparsec 是一个工业级的 Haskell 单子解析器组合子库,旨在兼顾解析速度、灵活性与高质量的错误提示。 核心功能包括: 1. **灵活的 Monad 栈构建**:基于 `MonadParsec`,支持结合各类 Monad 变换器定制状态与回溯行为; 2. **丰富的错误处理**:支持自定义解析错误、观察错误以及动态错误恢复(`withRecovery`); 3. **高性能组合子**:提供零拷贝分块匹配(如 `tokens`、`takeWhileP`),大幅提升文本解析效率; 4. 支持字符、二进制解析及词法分析器构建。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Megaparsec

[![License FreeBSD](https://img.shields.io/badge/license-FreeBSD-brightgreen.svg)](http://opensource.org/licenses/BSD-2-Clause)
[![Hackage](https://img.shields.io/hackage/v/megaparsec.svg?style=flat)](https://hackage.haskell.org/package/megaparsec)
[![Stackage Nightly](http://stackage.org/package/megaparsec/badge/nightly)](http://stackage.org/nightly/package/megaparsec)
[![Stackage LTS](http://stackage.org/package/megaparsec/badge/lts)](http://stackage.org/lts/package/megaparsec)
[![CI](https://github.com/mrkkrp/megaparsec/actions/workflows/ci.yaml/badge.svg)](https://github.com/mrkkrp/megaparsec/actions/workflows/ci.yaml)

* [Features](#features)
    * [Core features](#core-features)
    * [Error messages](#error-messages)
    * [External lexers](#external-lexers)
    * [Character and binary parsing](#character-and-binary-parsing)
    * [Lexer](#lexer)
* [Documentation](#documentation)
* [Tutorials](#tutorials)
* [Performance](#performance)
* [Comparison with other solutions](#comparison-with-other-solutions)
    * [Megaparsec vs Attoparsec](#megaparsec-vs-attoparsec)
    * [Megaparsec vs Parsec](#megaparsec-vs-parsec)
    * [Megaparsec vs Trifecta](#megaparsec-vs-trifecta)
    * [Megaparsec vs Earley](#megaparsec-vs-earley)
    * [Megaparsec vs Flatparse](#megaparsec-vs-flatparse)
* [Related packages](#related-packages)
* [Prominent projects that use Megaparsec](#prominent-projects-that-use-megaparsec)
* [Links to announcements and blog posts](#links-to-announcements-and-blog-posts)
* [Contribution](#contribution)
* [License](#license)

This is an industrial-strength monadic parser combinator library. Megaparsec
is a feature-rich package that strikes a nice balance between speed,
flexibility, and the quality of parse errors.

## Features

The project provides flexible solutions for common parsing needs. This
section describes them briefly. If you're looking for comprehensive
documentation, see the [section about documentation](#documentation).

### Core features

The package is built around `MonadParsec`, an MTL-style type class. Most
features work with all instances of `MonadParsec`. You can achieve various
effects by combining monad transformers, i.e. by building a monadic stack.
Since the common monad transformers like `WriterT`, `StateT`, and `ReaderT`
are instances of the `MonadParsec` type class, you can also wrap `ParsecT`
*in* these monads, achieving, for example, backtracking state.

`ParsecT` is also an instance of many type classes itself. The most useful
ones are `Monad`, `Applicative`, `Alternative`, and `MonadParsec`.

Megaparsec includes all functionality that is typically available in
Parsec-like libraries and also features some special combinators:

* `parseError` allows us to end parsing and report an arbitrary parse error.
* `withRecovery` can be used to recover from parse errors “on the fly” and
  continue parsing. Once parsing is finished, the collected parse errors may
  be reported or ignored altogether.
* `
阅读完整原文

项目深度分析 规则生成(AI 未配置)

综合评分 49.5 分。该项目在“个人可实施性”维度得 30 分,“付费可能性”维度得 20.0 分,差异化空间 88.0 分(评分依据见评分卡)。

面向细分需求的二次开发产品

产品构想基于 megaparsec 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建时间待补全,最近推送
社区活跃Star 981 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。