Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Char map (dictionary) which can work on intervals. #3

Open
sergey-shandar opened this issue Jun 28, 2019 · 0 comments
Open

Char map (dictionary) which can work on intervals. #3

sergey-shandar opened this issue Jun 28, 2019 · 0 comments
Milestone

Comments

@sergey-shandar
Copy link
Member

sergey-shandar commented Jun 28, 2019

We need it for the parser #2

type Char = string

type CharInterval<T> = {
  readonly min: Char
  readonly max: Char
  readonly value: T
}

type CharMap<T> = {  
  readonly iterable: () => Iterable<CharInterval<T>>
  readonly add: (_: CharInterval<T>) => CharMap<T>
}

const create
  : <T>(default: T) => CharMap<T>

Simple implementation is a list. In the future, we may consider to use a tree.

@sergey-shandar sergey-shandar added this to the Stage 0 milestone Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant