Requirements: Captures for matching rules
- Lenguaje dominante
- Haskell
- Estrellas
- 1.3k
- Forks
- 201
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
In addition to the feature in #772, allow matching rules to capture matches into an environment. For instance, you should be able to write:
f(__var_x) = __var_x + 42
and this should match any of:
f(x) = x + 42
f(banana) = banana + 42
but not
f(x) = y + 42
Note that this extends the syntax of matches... `__var_x` carries all the same requirements as `__var`, but also binds the match. There's some flexibility though, since on the left-hand side above, `__var` matches a `PVar` (pattern variable), while on the right, it matches a `Var`. There should be an equivalence of sorts between patterns and expressions, by which a match of patterns that are also valid expressions (like `PVar _ (Ident _ a)` and `Var _ (UnQual _ (Ident _ a))` match each other.
Guía de contribución
Línea de trabajo
Comienza leyendo la funcionalidad de matching-rule referenciada en #772 y sigue cómo se representan la sintaxis de match, los patrones y las expresiones. Define cómo __var_x enlaza variables de patrón y de expresión equivalentes, y verifica después que los ejemplos coincidan o fallen según lo especificado. Se considera terminado cuando los matches capturados están disponibles en el entorno sin romper el comportamiento existente de __var.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- haskell
- Área
- compilers
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100