tuplez-parse

Tuple composition utilities for cats-parse

License

License

MIT
GroupId

GroupId

app.tulz
ArtifactId

ArtifactId

tuplez-parse_2.13
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

tuplez-parse
Tuple composition utilities for cats-parse
Project URL

Project URL

https://github.com/tulz-app/tuplez-parse
Project Organization

Project Organization

app.tulz
Source Code Management

Source Code Management

https://github.com/tulz-app/tuplez-parse

Download tuplez-parse_2.13

How to add to project

<!-- https://jarcasting.com/artifacts/app.tulz/tuplez-parse_2.13/ -->
<dependency>
    <groupId>app.tulz</groupId>
    <artifactId>tuplez-parse_2.13</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/app.tulz/tuplez-parse_2.13/
implementation 'app.tulz:tuplez-parse_2.13:0.3.0'
// https://jarcasting.com/artifacts/app.tulz/tuplez-parse_2.13/
implementation ("app.tulz:tuplez-parse_2.13:0.3.0")
'app.tulz:tuplez-parse_2.13:jar:0.3.0'
<dependency org="app.tulz" name="tuplez-parse_2.13" rev="0.3.0">
  <artifact name="tuplez-parse_2.13" type="jar" />
</dependency>
@Grapes(
@Grab(group='app.tulz', module='tuplez-parse_2.13', version='0.3.0')
)
libraryDependencies += "app.tulz" % "tuplez-parse_2.13" % "0.3.0"
[app.tulz/tuplez-parse_2.13 "0.3.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.13.5
org.typelevel : cats-parse_2.13 jar 0.3.3

provided (1)

Group / Artifact Type Version
app.tulz : tuplez-full-light_2.13 jar 0.3.6

test (2)

Group / Artifact Type Version
junit : junit jar 4.13.2
com.novocode : junit-interface jar 0.11

Project Modules

There are no modules declared in this project.

Maven Central

tuplez-parse

A syntax extension for cats-parse for product tuple concatenation.

Based on the tuplez library.

Published for Scala 2.12, 2.13 and 3.0.0-RC3, JVM and Scala.js 1.5.1+.

Adding to a project

"app.tulz" %%% "tuplez-parse" % "0.3.0"

Additionally, one of the following dependencies is required (see tuplez).

This is required because this library depends on tuplez-full-light but with the Provided modifier, so it will not be transitively added to your project.

// tupleN + scalar, scalar + tupleN, tupleN + tupleM, up to Tuple22
"app.tulz" %%% "tuplez-full" % "0.3.6"

// or

// tupleN + scalar, scalar + tupleN, tupleN + tupleM, up to Tuple10
"app.tulz" %%% "tuplez-full-light" % "0.3.6"

// or

// tupleN + scalar, up to Tuple22
"app.tulz" %%% "tuplez-basic" % "0.3.6"

// or

// tupleN + scalar, up to Tuple10 
"app.tulz" %%% "tuplez-basic-light" % "0.3.6" 

Extension method

Currently, the only extension method provided is ~~. It calls the underlying ~ method, and concatenates the resulting tuple using the implicits from the tuplez library.

Usage

import cats.parse.{Parser => P}
import app.tulz.tuplez.parse._

// no concatenation
P.char('0') ~ P.char('1') // Parser[(Unit, Unit)]

// with concatenation
P.char('0') ~~ P.char('1') // Parser[Unit]


// no concatenation
P.charIn('0') ~ P.charIn('1') ~ P.charIn('2') // Parser[((Char, Char), Char)]

// with concatenation
P.charIn('0') ~~ P.charIn('1') ~~ P.charIn('2') // Parser[(Char, Char, Char)]


// no concatenation
P.charIn('1') ~ P.char('/') ~ P.charIn('2') // Parser[((Char, Unit), Char)]

// with concatenation
P.charIn('1') ~~ P.char('/') ~~ P.charIn('2') // Parser[(Char, Char)]

Author

Iurii Malchenko – @yurique / keybase.io/yurique

License

tuplez-parse is provided under the MIT license.

app.tulz

tulz.app

Tools for building apps (in Scala and Scala.js)

Versions

Version
0.3.0