v0.1.14: Add support for types in dynamic pattern matches

parent 08e3fbaa
......@@ -209,6 +209,7 @@ var highlightRules = {
[/([^\s;]+)/, ['modulename'], 'pop']
],
funcargs: [
[/(::)/, ['punctuation'], 'type'],
[/(=:)/, ['punctuation']],
[/((?::=)?=)/, ['punctuation'], 'jump:rhs'],
[/(\[\|)/, ['punctuation']], /* overloaded list */
......@@ -253,6 +254,8 @@ var highlightRules = {
[/(\(\))/, ['type']],
[/(\()(->)(\))/, ['punctuation', 'type', 'punctuation']],
[/(\|)/, ['punctuation'], 'context'],
[/(\()/, ['punctuation'], 'type'],
[/(\))/, ['punctuation'], 'pop'],
[/([^\s\w])/, ['punctuation']]
],
typeOfPattern: [
......
{
"name": "clean-highlighter",
"version": "0.1.13",
"version": "0.1.14",
"description": "Clean language highlighter",
"keywords": ["clean","highlighter"],
"main": "clean.js",
......
-----
unpack :: Dynamic -> Maybe a
unpack (x :: a^) = Just x
unpack (f :: A.a: Int -> Maybe a) = Just (f 37)
unpack _ = Nothing
-----
funcname unpack
whitespace
punctuation ::
whitespace
type Dynamic
whitespace
punctuation ->
whitespace
type Maybe
whitespace
typevar a
whitespace \n
funcname unpack
whitespace
punctuation (
argument x
whitespace
punctuation ::
whitespace
typevar a
punctuation ^)
whitespace
punctuation =
whitespace
constructor Just
whitespace
argumentinrhs x
whitespace \n
funcname unpack
whitespace
punctuation (
argument f
whitespace
punctuation ::
whitespace
existential A
punctuation .
typevar a
punctuation :
whitespace
type Int
whitespace
punctuation ->
whitespace
type Maybe
whitespace
typevar a
punctuation )
whitespace
punctuation =
whitespace
constructor Just
whitespace
punctuation (
argumentinrhs f
whitespace
literal literal-int literal-int-dec 37
punctuation )
whitespace \n
funcname unpack
whitespace
argument _
whitespace
punctuation =
whitespace
constructor Nothing
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