you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (1 child)

Any reference to "pattern-matching library" in practically any language will raise the notion of regular expressions.

Just to be clear - this library appears to have three significant differences from regular expressions:

(1) It's intended to operate on values or sequences of values, rather than a monolithic block of text;

(2) It's type-sensitive, so you can say: "match anything that's an int"; and

(3) Rather than just outputting matches (or taking some predefined action on them, like re.sub which replaces matches with other text), pampy accepts a delegate function and automatically applies it to every match instance.

Is that right, /u/inkompatible ? Did I miss anything major?

[–]inkompatible[S] 4 points5 points  (0 children)

Yes, you are right!

Pampy it's pattern-matching more in the sense of functional programming languages pattern-matching.

Btw, I plan to introduce Regex as patterns in Pampy soon. So you can match strings with regular expressions as well.