parser overview

Added in v0.6.0


Table of contents


parsers

Parser (class)

Signature

export declare class Parser<A> {
  constructor(readonly run: (r: Route) => O.Option<[A, Route]>)
}

Added in v0.4.0

of (static method)

Signature

static of<A>(a: A): Parser<A>

Added in v0.4.0

map (method)

Signature

map<B>(f: (a: A) => B): Parser<B>

Added in v0.4.0

ap (method)

Signature

ap<B>(fab: Parser<(a: A) => B>): Parser<B>

Added in v0.4.0

chain (method)

Signature

chain<B>(f: (a: A) => Parser<B>): Parser<B>

Added in v0.4.0

alt (method)

Signature

alt(that: Parser<A>): Parser<A>

Added in v0.4.0

then (method)

Signature

then<B>(that: Parser<RowLacks<B, keyof A>>): Parser<A & B>

Added in v0.4.0

_A (property)

Signature

readonly _A: A

Added in v0.4.0

alt

Signature

export declare const alt: <A>(that: Lazy<Parser<A>>) => (fa: Parser<A>) => Parser<A>

Added in v0.5.1

ap

Signature

export declare const ap: <A>(fa: Parser<A>) => <B>(fab: Parser<(a: A) => B>) => Parser<B>

Added in v0.5.1

apFirst

Signature

export declare const apFirst: <B>(fb: Parser<B>) => <A>(fa: Parser<A>) => Parser<A>

Added in v0.5.1

apSecond

Signature

export declare const apSecond: <B>(fb: Parser<B>) => <A>(fa: Parser<A>) => Parser<B>

Added in v0.5.1

chain

Signature

export declare const chain: <A, B>(f: (a: A) => Parser<B>) => (ma: Parser<A>) => Parser<B>

Added in v0.5.1

chainFirst

Signature

export declare const chainFirst: <A, B>(f: (a: A) => Parser<B>) => (ma: Parser<A>) => Parser<A>

Added in v0.5.1

flatten

Signature

export declare const flatten: <A>(mma: Parser<Parser<A>>) => Parser<A>

Added in v0.5.1

getParserMonoid

Signature

export declare const getParserMonoid: <A>() => Monoid<Parser<A>>

Added in v0.5.1

map

Signature

export declare const map: <A, B>(f: (a: A) => B) => (fa: Parser<A>) => Parser<B>

Added in v0.5.1

parse

Signature

export declare const parse: <A>(parser: Parser<A>, r: Route, a: A) => A

Added in v0.4.0

parser

Signature

export declare const parser: Monad1<'fp-ts-routing/Parser'> & Alternative1<'fp-ts-routing/Parser'>

Added in v0.5.1

then

Signature

export declare const then: <B>(fb: Parser<B>) => <A>(fa: Parser<A> & Parser<RowLacks<A, keyof B>>) => Parser<A & B>

Added in v0.6.0

zero

Signature

export declare const zero: <A>() => Parser<A>

Added in v0.4.0