Releases: thautwarm/MLStyle.jl
Releases · thautwarm/MLStyle.jl
ML Core
enhancement for ADTs/GADTs, active patterns and capturing
- Fixed subtyping of ADT/GADT
- Enhanced the implicit conversion for GADTs
- Allowed capturing by uppercase symbols, via enabling
UppercaseCapturing
- Allowed ML style enumerations and view/active patterns
v0.2.7
When destructuring
The documentations are more exhaustive than before, and something like if-let
in Rust is finally introduced in.
@when (a, 1) = tp begin
a + 1
end
@when let (a, 1) = tp,
f = x -> x + 1
f(a)
end
Speed up literal string patterns and fix a bug of unexpected capturing
- Improve string pattern performance
@match str begin
"This" => ...
end
Now we use ===
instead of ==
to make string comparisons at julia v1.1+.
- Avoid to regard symbol
nothing
as as-pattern:
A bug occurred at the previous version, wherenothing
s are not treated as literals, so following assertion used to fail.
@assert @match 1 begin
nothing => false
_ => true
end # =>
Solved via defining a special pattern before capturing to handle with this.
only bugfix and code style refinement
- fix ADT/GADT constructor issues
- fix GADT implicit conversion issues
- fix exception handling issues
- refine code style
dictionary matching for null-value cases.
v0.2.3 fix 0.2.3
only bugfix
Fix a bug that used to occur when there is single ...
as the argument of Expr
pattern.
@match begin Expr(:a, :b) begin
Expr(a...) => a
end
tiny optimization
At this release, we avoid redundant unpacking when compiling Expr patterns.
A benchmark script have been available,
which tells that MLStyle.jl is almost 30 times faster than MacroTools.jl when matching ASTs.
Regularly it's about 20 times faster than Match.jl when performing pattern matching for Expr
.
0.2.0 preview
New features
- GADTs
- Ast patterns
- Active patterns
- And patterns instead of as-patterns