Skip to content

A simple pattern matching library for people who love currying!

License

Notifications You must be signed in to change notification settings

spontoreau/match

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license CI Codecov DeepScan grade Discord Gitmoji

match

A simple pattern matching library for people who love currying!

Getting started

match is super easy to use:

import { isSome, match } from "https://deno.land/x/match/mod.ts";

const value = "Deno";

const option = match<string, string>(value)(
  [(v) => v === "Deno", () => `Deno found!`],
  [(v) => v === "Node", () => `We are not looking for you Node, sorry!`],
)();

const result = isSome(option) ? option.value : "Not found";

console.log(result);

You can found more information in the documentation!

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant.

Contributing

Before you contribute, please take a few minutes to read the contribution guidelines.

Contributors


Sylvain PONTOREAU

📖 💻

Licence

MIT

About

A simple pattern matching library for people who love currying!

Resources

License

Stars

Watchers

Forks

Packages

No packages published