MLStyle.jl
latest
GitHub
MLStyle.jl
What is MLStyle.jl?
Motivations
Why use MLStyle.jl?
Straightforward
Performance Gain
Extensibility
Referential Transparency
Intuition of AST Manipulations
Installation, Documentations and Tutorials
Preview
Rock Paper Scissors
Homoiconic pattern matching for Julia ASTs
Generalized Algebraic Data Types
Active Patterns
Benchmark
Arrays
Tuples
Data Types
Extracting Struct Definitions
Misc
An Example from Match.jl Documentation
Contributing to MLStyle
Algebraic Data Types
Basic constructors
Specifying field names
Specifying field names and types
Subtyping
Less familiar
Singleton instances
Cheat Sheet
Examples
Example: Modeling Arithmetic Operations
About Type Parameters
Pattern Matching
Literal Patterns
Capturing Patterns
Type Patterns
if
patterns
GuardBy
patterns
And-Patterns
Destructuring Tuples, Arrays, and Dictionaries with Pattern Matching
Deconstruction of Custom Composite Data
Range Patterns
Reference Patterns
Macro Call Patterns
Custom Patterns
Support Pattern Matching for Julia Enums
Pattern Synonyms
Or Patterns
Advanced Type Patterns
Active Patterns
Expr Patterns
Julia Code as Expr Patterns
Advanced: Do-Patterns & Many-Patterns
Advanced: Let Patterns
The Switch Statements
Records
When Destructuring
Allow Destructuring in Let-Binding
Sole Destructuring
Multiple Branches
Pattern Functions
MLStyle.Modules.AST
@matchast
Capture
@capture
MLStyle.Modules.Cond
@cond
Static Capturing
Capture
Pattern from
MLStyle.Modules.AST
:
RAII-Style
Structure
Index