When a Parser parses a Stream, it produces a Response. This response can be an Accept, or a Reject

### Type parameters

- #### T

### Hierarchy

- Response
  - Reject
  - Accept

## Index

### Properties

- offset
- value

### Methods

- filter
- flatMap
- fold
- isAccepted
- isEos
- location
- map

## Properties

### offset

offset: number

- Defined in masala-parser.d.ts:312

Index in the stream. See location.

### value

value: T

- Defined in masala-parser.d.ts:270

The value built by the parsing

## Methods

### filter

- filter(predicate: function): Response<T>

- - Defined in masala-parser.d.ts:307

  #### Parameters

  - ##### predicate: function

    - - (value: any): boolean

      - #### Parameters

        - ##### value: any

        #### Returns boolean

  #### Returns Response<T>

### flatMap

- flatMap<Y>(f: function): Response<Y>

- - Defined in masala-parser.d.ts:305

      Response.accept('a')
           .flatMap(a=>Response.accept(a))
           .isAccepted(),

  #### Type parameters

  - #### Y

  #### Parameters

  - ##### f: function

    mapping function

    - - (v: T): Response<Y>

      - #### Parameters

        - ##### v: T

        #### Returns Response<Y>

### fold

- fold(accept: function, reject?: function): Response<T>

- - Defined in masala-parser.d.ts:288

  Execute accept if response in an Accept, or reject and create a new Response. A Reject could thus lead to a new Accept

  #### Parameters

  - ##### accept: function

    - - (): Response<T>

      - #### Returns Response<T>

  - ##### Optional reject: function

    - - (): Response<T>

      - #### Returns Response<T>

### isAccepted

- isAccepted(): boolean

- - Defined in masala-parser.d.ts:275

  True if the parser succeed all steps, false if parser stopped

  #### Returns boolean

### isEos

- isEos(): boolean

- - Defined in masala-parser.d.ts:280

  Returns true if parser has reached end of stream to build the Response

  #### Returns boolean

### location

- location(): number

- - Defined in masala-parser.d.ts:318

  Index in the final text. Is equal to offset for low level parsers.

  #### Returns number

### map

- map<Y>(f: function): Response<Y>

- - Defined in masala-parser.d.ts:294

  Transform the response in case of success. Won't touch a Reject.

  #### Type parameters

  - #### Y

  #### Parameters

  - ##### f: function

    - - (v: T): Y

      - #### Parameters

        - ##### v: T

        #### Returns Y

  #### Returns Response<Y>

Generated using TypeDoc