0.3.0 • Published 3 years ago

@perfective/match v0.3.0

Weekly downloads
35
License
MIT
Repository
github
Last release
3 years ago

Match

The @perfective/match package provides functions and types for the pattern matching.

  • match<T>(value: T | Nullary<T>): Match<T>
    • Match.that<U>(...statements: Statement<T, U>[]): Maybe<U>
    • Match.to<U>(statements: Statement<T, U>[]): Maybe<U> — applies the given value to the Statement.condition predicate until the first one match, returns the result of applying the value to the Statement.evaluate function; when match is not found, returns Nothing.
  • when<T>(condition: T | Predicate<T>): When<T>Statement<T, U> builder; * then<U>(value: U | Unary<T, U>): Statement<T, U>
  • statements<T, U>(entries: StatementEntry<T, U>[]): Statement<T, U>[] — creates statements from an array of tuples [Predicate<T>, Unary<T, U>].

Read the full documentation in the repository.

0.3.0

3 years ago

0.3.0-alpha

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

4 years ago

0.2.0-beta.1

4 years ago

0.2.0-beta

4 years ago

0.2.0-alpha.2

4 years ago

0.2.0-alpha.1

4 years ago

0.2.0-alpha

4 years ago

0.1.0

4 years ago