Discussion

Show HN: OCaml-like pattern-matching with vanilla JavaScript (no transpiler)

A few years back I wrote a little library that implements OCaml-inspired pattern matching using just plan JavaScript destructuring syntax. I don't think I ever shared it here. Thought you might find it interesting.

I did this just for fun, don't use it in prod. It's very inefficient. Have a look at the source for a chuckle, it's a single 145 line file.

Link: https://github.com/mrkev/fnMatch

Playground: https://aykev.dev/fnMatch/

3 points aylmao 2 years ago 1 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton