File: pcase.el.html

ML-style pattern matching.

The entry points are autoloaded.

Todo:

- Allow to provide new pcase--split-<foo> thingy.
- provide something like (setq VAR) so a var can be set rather than
  let-bound.
- provide a way to continue matching to subsequent cases
  (e.g. Like Racket's (=> ID).
- try and be more clever to reduce the size of the decision tree, and
  to reduce the number of leaves that need to be turned into functions:
  - first, do the tests shared by all remaining branches (it will have
    to be performed anyway, so better do it first so it's shared).
  - then choose the test that discriminates more (?).
- provide Agda's with (along with its ... companion).
- implement (not PAT). This might require a significant redesign.
- ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to
  generate a lex-style DFA to decide whether to run E1 or E2.

While the first version was written before I knew about Racket's match construct, the second version was significantly influenced by it, so a good presentation of the underlying ideas can be found at:

  Extensible Pattern Matching in an Extensible Language
  Sam Tobin-Hochstadt, 2010
  https://arxiv.org/abs/1106.2578

Defined variables (1)

pcase--subtype-bitsetsHash table mapping type predicates to their sets of types.

Defined functions (37)

`--pcase-macroexpander(QPAT)
let--pcase-macroexpander(PAT EXPR)
pcase(EXP &rest CASES)
pcase--and(MATCH MATCHES)
pcase--app-subst-match(MATCH SYM FUN NSYM)
pcase--app-subst-rest(REST SYM FUN NSYM)
pcase--edebug-match-pat-args(HEAD PF)
pcase--eval(EXP VARS)
pcase--expand(EXP CASES)
pcase--expand-`(QPAT)
pcase--flip(FUN ARG1 ARG2)
pcase--funcall(FUN ARG VARS)
pcase--get-macroexpander(S)
pcase--if(TEST THEN ELSE)
pcase--let*(BINDINGS BODY)
pcase--macroexpand(PAT)
pcase--mark-used(SYM)
pcase--match(VAL UPAT)
pcase--mutually-exclusive-p(PRED1 PRED2)
pcase--self-quoting-p(UPAT)
pcase--small-branch-p(CODE)
pcase--split-equal(ELEM PAT)
pcase--split-match(SYM SPLITTER MATCH)
pcase--split-member(ELEMS PAT)
pcase--split-pred(VARS UPAT PAT)
pcase--split-rest(SYM SPLITTER REST)
pcase--trivial-upat-p(UPAT)
pcase--u(BRANCHES)
pcase--u1(MATCHES CODE VARS REST)
pcase-compile-patterns(EXP CASES)
pcase-defmacro(NAME ARGS [DOC] &rest BODY...)
pcase-dolist((PATTERN LIST) BODY...)
pcase-exhaustive(EXP &rest CASES)
pcase-lambda(LAMBDA-LIST &rest BODY)
pcase-let(BINDINGS &rest BODY)
pcase-let*(BINDINGS &rest BODY)
pcase-setq(PATTERN VALUE PATTERN VALUE ...)

Defined faces (0)