Skip to content

Commit

Permalink
fix #35
Browse files Browse the repository at this point in the history
  • Loading branch information
thautwarm committed Feb 3, 2019
1 parent 7f4c7bc commit 4c8fac2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Pervasives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using MLStyle.Infras
using MLStyle.Extension
using MLStyle.Err
using MLStyle.toolz: ($), isCase

import MLStyle.Infras: mk_gapp_pattern

@use GADT
Expand All @@ -15,8 +16,10 @@ function mk_pat_by(f)
end
end

const strict_eq_types = @static VERSION < v"1.1.0" ? Union{Int, Nothing} : Union{Int, String, Nothing}

def_pattern(Pervasives,
predicate = x -> x isa Union{Int, String, Nothing},
predicate = x -> x isa strict_eq_types,
rewrite = mk_pat_by(===)
)

Expand Down

0 comments on commit 4c8fac2

Please sign in to comment.