serras

serras

Patternr - experiment with pattern matching

Hi! I’ve created a small application to help learners experiment with pattern matching, https://www.patternr.dev/. It currently supports (a subset of) Elixir and Haskell syntax. I’m happy to hearn any suggestions you may have :slight_smile:

PS: It’s my first app built with LiveView, and the experience has been great!

Most Liked

axelson

axelson

Scenic Core Team

This looks like a really neat project! I think it would be really helpful to have a couple links that will prefix an example pattern so users can easily see working examples of supported patterns.

Also it would be good if more complex patterns were accepted:

And a minor improvement would be to change “Incorrect Pattern” to “Invalid Pattern”. Incorrect doesn’t really match because you don’t know the users intention.

But overall great job!

eksperimental

eksperimental

Hi, here are some suggestions

  1. case 1..2 does not work

  2. case 1 when x when is_integer(x) -> does not work either (maybe guards are not supported yet)

  3. I would add an end to the the template

case [ TERM ] do
  [ PATTERN ] -> ...
end
Exadra37

Exadra37

That is the Phoenix color :wink:

Last Post!

serras

serras

Implementing binary matching is really hard. But my PRs are open :wink:

Where Next?

Popular in Discussions Top

PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
New
scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
ben-pr-p
In general I’ve been sticking to this community style guide GitHub - christopheradams/elixir_style_guide: A community driven style guide ...
New
acrolink
How does the two languages compare when it comes to server side application development? Any experiences or ideas? Thank you.
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44139 214
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42533 114
New

We're in Beta

About us Mission Statement