cangjie-pattern-match

Apply Cangjie pattern matching across enums, tuples, and type checks.

4|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-pattern-match-junjiechen0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cangjie-pattern-match
Source: https://github.com/JunjieChen0/NJUST/tree/main/.njust-ai/skills/cangjie-pattern-match
Command: npx skills add https://github.com/JunjieChen0/NJUST --skill cangjie-pattern-match-junjiechen0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers learn and apply Cangjie pattern matching across constant, wildcard, binding, tuple, type, and enum patterns, including nested patterns and pattern guards.

Core Features & Use Cases

  • Supports exhaustive matching strategies for all defined patterns and nested structures.
  • Demonstrates how to use guards (where) and binding semantics in real code scenarios.
  • Provides guidance for common pitfalls and best practices when constructing match expressions in Cangjie.

Quick Start

Ask the AI to demonstrate a nested match with a complex data structure and return the selected branch.

Frequently Asked Questions about cangjie-pattern-match

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use pattern matching in Cangjie to destructure complex data types?

You can write match expressions in Cangjie using constant, wildcard, binding, tuple, type, and enum patterns to destructure complex data. This approach ensures exhaustive coverage and clear binding semantics for robust data extraction.

What is the best way to add conditional logic to Cangjie match expressions?

Use pattern guards to add conditional logic to Cangjie match expressions. Guards apply precise where conditions to specific branches, ensuring predictable runtime behavior when matching complex nested data structures.

How do I ensure exhaustive coverage when matching Cangjie enums and tuples?

Ensure exhaustive coverage in Cangjie by defining match branches for all enum variants and tuple structures. Leveraging nested patterns and binding semantics allows the compiler to verify that all possible runtime values are handled safely.

Does Cangjie pattern matching support type checks and nested structures?

Cangjie pattern matching supports type checks and nested structures. You can combine type patterns with nested tuple and enum matching to target specific data shapes deep within complex hierarchies while maintaining clear binding semantics.

What are common pitfalls when using guards in Cangjie match expressions?

Common pitfalls when using guards in Cangjie match expressions include non-exhaustive matching and unpredictable runtime behavior. Carefully structuring nested patterns and applying precise where conditions helps avoid missing edge cases in complex data structures.