Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnynek/fastparse-cats
Cats instances for fastparse
https://github.com/johnynek/fastparse-cats
Last synced: 3 months ago
JSON representation
Cats instances for fastparse
- Host: GitHub
- URL: https://github.com/johnynek/fastparse-cats
- Owner: johnynek
- License: apache-2.0
- Created: 2018-04-29T21:54:29.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T02:57:46.000Z (over 6 years ago)
- Last Synced: 2023-07-28T17:24:07.191Z (over 1 year ago)
- Language: Scala
- Size: 27.3 KB
- Stars: 19
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://api.travis-ci.org/johnynek/fastparse-cats.svg)](https://travis-ci.org/johnynek/fastparse-cats)
[![codecov.io](http://codecov.io/github/johnynek/fastparse-cats/coverage.svg?branch=master)](http://codecov.io/github/johnynek/fastparse-cats?branch=master)
[![Latest version](https://index.scala-lang.org/johnynek/fastparse-cats/fastparse-cats-core/latest.svg?color=orange)](https://index.scala-lang.org/johnynek/fastparse-cats/fastparse-cats-core)# fastparse-cats
[Cats](https://github.com/typelevel/cats) instances for [Fastparse](https://github.com/lihaoyi/fastparse) parsers.
This gives you a lawful Monad and Alternative for fastparse Parsers. This allows you to easily
reuse generic functions from cats with fastparse.### Quick Start
fastparse-cats supports Scala 2.11, and 2.12. It supports both the JVM
and JS platforms.To use fastparse-cats in your own project, you can include this snippet in
your `build.sbt` file:```scala
// use this snippet for the JVM
libraryDependencies ++= List("org.bykn" %% "fastparse-cats-core" % "0.1.0")// use this snippet for JS, or cross-building
libraryDependencies ++= List("org.bykn" %%% "fastparse-cats-core" % "0.1.0")
```There is also support for `fastparse-byte` by using
```scala
libraryDependencies ++= List("org.bykn" %% "fastparse-cats-byte" % "0.1.0")
```To use the instances, make the following imports:
```scala
// get the Monad and Alternative for string Parser
import org.bykn.fastparse_cats.StringInstances._
```
or
```scala
// get the Monad and Alternative for byte Parser
import org.bykn.fastparse_cats.ByteInstances._
```There are also utilities at `buildParser.{ delay, suspend, pure, fromEval, fromEvalParser }` to build generic parsers lazily.