{ "fileTypes": [ "lhs" ], "name": "Literate Haskell", "scopeName": "text.tex.latex.haskell", "macros": { "identStartCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}]", "identCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']", "functionNameOne": "[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", "classNameOne": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", "functionName": "(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*", "className": "[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*", "operatorChar": "[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]", "operator": "[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+", "operatorFun": "(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))", "basicChar": "[\\ -\\[\\]-~]", "escapeChar": "\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])", "octalChar": "(?:\\\\o[0-7]+)", "hexChar": "(?:\\\\x[0-9A-Fa-f]+)", "controlChar": "(?:\\^[A-Z@\\[\\]\\\\\\^_])", "character": "(?:[\\ -\\[\\]-~]|\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|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<) ", "lb": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<] )", "end": "^(?![><] )", "name": "meta.embedded.haskell", "patterns": [ { "name": "block.liquidhaskell.haskell", "contentName": "block.liquidhaskell.annotation.haskell", "begin": "\\{-@(?!#)", "end": "@-\\}", "patterns": [ { "include": "$self" } ] }, { "name": "comment.line.shebang.haskell", "match": "^\\#\\!.*\\brunhaskell\\b.*$" }, { "include": "#infix_function" }, { "include": "#unit" }, { "include": "#empty_list" }, { "include": "#quasi_quotes" }, { "include": "#module_decl" }, { "include": "#class_decl" }, { "include": "#instance_decl" }, { "include": "#foreign_import" }, { "include": "#regular_import" }, { "include": "#data_decl" }, { "include": "#type_alias" }, { "include": "#keywords" }, { "include": "#c_preprocessor" }, { "include": "#pragma" }, { "include": "#string" }, { "include": "#newline_escape" }, { "include": "#quoted_character" }, { "include": "#scoped_type_override" }, { "include": "#function_type_declaration" }, { "include": "#scoped_type" }, { "include": "#comments" }, { "include": "#infix_op" }, { "include": "#comma" }, { "include": "#lit_num" }, { "include": "#operator" }, { "include": "#identifier" }, { "include": "#type_ctor" }, { "match": "^> ", "name": "punctuation.definition.bird-track.haskell" } ] }, { "begin": "(?|<) [ \\t]+)?(?=--+\\s+[|^])", "end": "(?!\\G)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.haskell" } }, "patterns": [ { "name": "comment.line.double-dash.haddock.haskell", "begin": "(--+)\\s+([|^])", "end": "\\n", "beginCaptures": { "1": { "name": "punctuation.definition.comment.haskell" }, "2": { "name": "punctuation.definition.comment.haddock.haskell" } } } ] }, { "begin": "(^(?:>|<) [ \\t]+)?(?=--+(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]))", "end": "(?!\\G)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.haskell" } }, "patterns": [ { "name": "comment.line.double-dash.haskell", "begin": "--", "end": "\\n", "beginCaptures": { "0": { "name": "punctuation.definition.comment.haskell" } } } ] }, { "include": "#block_comment" } ] }, "characters": { "patterns": [ { "match": "\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&])", "name": "constant.character.escape.haskell" }, { "match": "(?:\\\\o[0-7]+)", "name": "constant.character.escape.octal.haskell" }, { "match": "(?:\\\\x[0-9A-Fa-f]+)", "name": "constant.character.escape.hexadecimal.haskell" }, { "match": "(?:\\^[A-Z@\\[\\]\\\\\\^_])", "name": "constant.character.escape.control.haskell" } ] }, "infix_op": { "patterns": [ { "name": "entity.name.function.infix.haskell", "match": "(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))" } ] }, "module_exports": { "patterns": [ { "name": "meta.declaration.exports.haskell", "begin": "\\(", "end": "\\)", "patterns": [ { "include": "#comments" }, { "include": "#function_name" }, { "include": "#type_name" }, { "include": "#comma" }, { "name": "meta.other.constructor-list.haskell", "begin": "(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))\\s*\\(", "end": "\\)", "patterns": [ { "include": "#type_ctor" }, { "include": "#attribute_name" }, { "include": "#comma" }, { "match": "\\.\\.", "name": "keyword.operator.wildcard.haskell" } ] }, { "include": "#infix_op" } ] } ] }, "module_name": { "patterns": [ { "name": "support.other.module.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(?:(?:((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))))*))(?:\\s*(::|∷)))", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "patterns": [ { "include": "#function_name" }, { "include": "#infix_op" } ] }, "3": { "name": "keyword.other.double-colon.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "ctor_type_declaration": { "patterns": [ { "name": "meta.ctor.type-declaration.haskell", "begin": "^(?:>|<) ([ \\t]*)(?:(?:((?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\)))(?:(?:\\s*,\\s*)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))))*))(?:\\s*(::|∷)))", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "patterns": [ { "include": "#type_ctor" }, { "include": "#infix_op" } ] }, "3": { "name": "keyword.other.double-colon.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "record_field_declaration": { "patterns": [ { "name": "meta.record-field.type-declaration.haskell", "begin": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|→)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]])" }, { "name": "keyword.other.big-arrow.haskell", "match": "(?|⇒)(?![\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]])" }, { "include": "#operator" }, { "name": "variable.other.generic-type.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(module)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(class)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(instance)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(foreign)\\s+(import|export)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "keyword.other.haskell" }, "3": { "name": "keyword.other.haskell" } }, "patterns": [ { "match": "(?:un)?safe", "captures": { "0": { "name": "keyword.other.haskell" } } }, { "include": "$self" } ] } ] }, "regular_import": { "patterns": [ { "name": "meta.import.haskell", "begin": "^(?:>|<) ([ \\t]*)(import)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#module_name" }, { "include": "#module_exports" }, { "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)(data|newtype)\\s+((?:(?!=|where).)*)", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "storage.type.data.haskell" }, "3": { "name": "meta.type-signature.haskell", "patterns": [ { "include": "#family_and_instance" }, { "include": "#type_signature" } ] } }, "patterns": [ { "include": "#comments" }, { "include": "#where" }, { "include": "#deriving" }, { "include": "#assignment_op" }, { "match": "(?:(?:(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|=>)+\\s*)+))(?:(?:\\s+)(?:(?!deriving)(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*|(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:(?!deriving)(?:[\\w()'→⇒\\[\\],]|->|=>)+\\s*)+)))*)?))", "captures": { "1": { "patterns": [ { "include": "#type_ctor" } ] }, "2": { "name": "meta.type-signature.haskell", "patterns": [ { "include": "#type_signature" } ] } } }, { "match": "\\|", "captures": { "0": { "name": "punctuation.separator.pipe.haskell" } } }, { "name": "meta.declaration.type.data.record.block.haskell", "begin": "\\{", "beginCaptures": { "0": { "name": "keyword.operator.record.begin.haskell" } }, "end": "\\}", "endCaptures": { "0": { "name": "keyword.operator.record.end.haskell" } }, "patterns": [ { "include": "#comments" }, { "include": "#comma" }, { "include": "#record_field_declaration" } ] }, { "include": "#ctor_type_declaration" } ] } ] }, "type_alias": { "patterns": [ { "name": "meta.declaration.type.type.haskell", "begin": "^(?:>|<) ([ \\t]*)(type)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "name": "storage.type.data.haskell" } }, "patterns": [ { "include": "#comments" }, { "include": "#family_and_instance" }, { "include": "#where" }, { "include": "#assignment_op" }, { "include": "#type_signature" } ] } ] }, "keywords": { "patterns": [ { "name": "keyword.other.haskell", "match": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) (?=#)", "end": "(?(?:[^()]|\\(\\g\\))*)(::|∷)(?(?:[^()]|\\(\\g\\))*)\\)", "captures": { "1": { "patterns": [ { "include": "source.haskell" } ] }, "2": { "name": "keyword.other.double-colon.haskell" }, "3": { "name": "meta.type-signature.haskell", "patterns": [ { "include": "#type_signature" } ] } } }, { "match": "(::|∷)(.*?)(?:(?|<) ([ \\t]*)(?:(?:((?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\)))(?:(?:\\s*,\\s*)(?:(?:[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*(?:\\.[\\p{Lu}\\p{Lt}][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*)*\\.)?[\\p{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))[\\p{S}\\p{P}&&[^(),;\\[\\]`{}_\"'\\|]]+\\))))*))(?:\\s*(::|∷)))(.*)(?