cangjie-generic

Explain Cangjie generics with code examples for functions, classes, interfaces, structs, and enums.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps learners understand and apply Cangjie language generics, explaining core concepts and how to use generic types across functions, classes, interfaces, structs, and enums.

Core Features & Use Cases

  • Comprehensive explanations of type parameters, constraints (where), and variance
  • Practical examples showing generic functions, classes, interfaces, structs, and enums
  • Use-case oriented guidance for designing generic APIs in Cangjie

Quick Start

Explain basic to advanced Cangjie generics with concise examples covering functions, classes, interfaces, and constraints.

Frequently Asked Questions about cangjie-generic

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

FAQPage Schema
How do I use generics in Cangjie programming language?

Cangjie generics allow defining type parameters for functions, classes, interfaces, structs, and enums. This Skill provides practical code examples and standard syntax rules to implement generic types without needing external context.

How do constraints and where clauses work with Cangjie generics?

Constraints in Cangjie generics restrict the types usable as type parameters using where clauses. This Skill illustrates how to apply these constraints to enforce specific type behaviors across generic classes and interfaces.

What is type variance and how is it demonstrated in Cangjie?

Type variance defines how subtyping between complex types relates to their component types. This Skill demonstrates Cangjie type variance alongside type parameters and constraints to ensure precise type system usage.

Can I define generic functions and enums in Cangjie?

Yes, Cangjie supports generic functions and enums alongside generic classes, interfaces, and structs. The Skill offers use-case oriented guidance and concise examples covering these applicable scenarios for API design.

What is the best way to design generic APIs in Cangjie?

Designing generic APIs in Cangjie requires understanding type parameters, constraints, and variance. This Skill provides use-case oriented guidance with precise technical definitions to help you build robust generic interfaces.