pattern-matching

Solid

Expert skill for implementing pattern matching including exhaustiveness checking, decision tree compilation, and efficient match dispatch code generation.

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Pattern Matching Skill Implement pattern matching for programming languages including exhaustiveness checking, usefulness analysis, and efficient compilation to decision trees. ## Capabilities - Parse pattern syntax (constructor, wildcard, binding, literals) - Implement exhaustiveness and usefulness checking - Compile patterns to decision trees - Implement guard clause handling - Design or-patterns and as-patterns - Implement nested pattern matching - Optimize pattern match coverage - Generate efficient match dispatch code ## Usage Invoke this skill when you need to: - Add pattern matching to a language - Implement exhaustiveness checking - Compile patterns efficiently - Handle complex pattern features ## Inputs | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | patternTypes | array | Yes | Types of patterns to support | | targetLanguage | string | Yes | Language for implementation | | compilationStrategy | string | No | Strategy (decision-tree, backtracking) | | features | array | No | Advanced features to implement | ### Pattern Types ```json { "patternTypes": [ "wildcard", "variable", "literal", "constructor", "tuple", "record", "list", "or-pattern", "as-pattern", "guard" ] } ``` ### Feature Options ```json { "features": [ "exhaustiveness-checking", "usefulness-checking", "decision-tree-compilation", "guard-clauses", "nested-patterns", "view-pattern...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Related Skills