Verified Commit e23f2e93 authored by Camil Staps's avatar Camil Staps 🚀

Add ^ for overloaded type variables in dynamic pattern matches

parent 2b42fddd
...@@ -185,6 +185,7 @@ builtin_syntax = ...@@ -185,6 +185,7 @@ builtin_syntax =
, bs_macro , bs_macro
, bs_module , bs_module
, bs_newtype , bs_newtype
, bs_overloaded_type_variable
, bs_otherwise , bs_otherwise
, bs_pattern_named , bs_pattern_named
, bs_selection_array , bs_selection_array
...@@ -476,6 +477,14 @@ bs_newtype = (["=:", "newtype"], ...@@ -476,6 +477,14 @@ bs_newtype = (["=:", "newtype"],
] ]
}) })
bs_overloaded_type_variable = (["^", "a^"],
{ syntax_title = "Overloaded type variable"
, syntax_code = ["... :: ...^"]
, syntax_description = "A pattern match on the type of a dynamic depending on the type of the function."
, syntax_doc_locations = [CLR 10 "8.2.5" "_Toc311798087"]
, syntax_examples = [EX "Function" "unpack :: Dynamic -> Maybe a\nunpack (x :: a^) = Just x // Only values of type a\nunpack _ = Nothing"]
})
bs_otherwise = (["otherwise"], bs_otherwise = (["otherwise"],
{ syntax_title = "otherwise" { syntax_title = "otherwise"
, syntax_code = ["otherwise"] , syntax_code = ["otherwise"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment