{ "fileTypes": [ "lhs" ], "name": "Literate Haskell", "scopeName": "text.tex.latex.haskell", "macros": { "identStartCharClass": "[\\p{Ll}_\\p{Lu}\\p{Lt}]", "identContCharClass": "[\\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}](?|=>)+\\s*)+)", "ctor": "(?:(?:(?:(?=[\\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*)+)))*)?))", "typeDeclOne": "(?:(?!(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?(?:(?:(?!(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) ([ \\t]*)", "indentBlockEnd": "^(?!(?:>|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "maybeBirdTrack": "^(?:>|<) ", "lb": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?<] )", "end": "^(?![><] )", "name": "meta.embedded.haskell", "patterns": [ { "include": "#haskell_source" }, { "match": "^> ", "name": "punctuation.definition.bird-track.haskell" } ] }, { "match": "(?|<) [ \\t]+)?(?=--+\\s+[|^])", "end": "(?!\\G)", "patterns": [ { "name": "comment.line.double-dash.haddock.haskell", "begin": "(--+)\\s+([|^])", "end": "$", "beginCaptures": { "1": { "name": "punctuation.definition.comment.haskell" }, "2": { "name": "punctuation.definition.comment.haddock.haskell" } } } ] }, { "begin": "(^(?:>|<) [ \\t]+)?(?=--+(?!(?:[\\p{S}\\p{P}](?|<) ([ \\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}](?|<) \\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" } ] } ] }, "lazy_function_type_signature": { "patterns": [ { "name": "meta.function.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{Ll}_][\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']*|(?:\\((?!--+\\))(?:[\\p{S}\\p{P}](?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "patterns": [ { "include": "#function_name" }, { "include": "#infix_op" } ] } }, "patterns": [ { "include": "#double_colon_operator" }, { "include": "#type_signature" } ] } ] }, "double_colon_operator": { "patterns": [ { "name": "keyword.other.double-colon.haskell", "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{S}\\p{P}](?|<) \\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}](?|⇒)(?!(?:[\\p{S}\\p{P}](?|<) ([ \\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}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#comments" }, { "include": "#module_name" }, { "include": "#module_exports" }, { "include": "#invalid" } ] } ] }, "hsig_decl": { "patterns": [ { "name": "meta.declaration.module.haskell", "begin": "^(?:>|<) ([ \\t]*)(signature)(?:(?<=[\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}'])(?![\\p{Ll}_\\p{Lu}\\p{Lt}\\p{Nd}']))", "end": "(?:(?=[\\p{Ll}_\\p{Lu}\\p{Lt}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#comments" }, { "include": "#module_name" }, { "include": "#module_exports" }, { "include": "#invalid" } ] } ] }, "class_decl": { "patterns": [ { "name": "meta.declaration.class.haskell", "begin": "^(?:>|<) ([ \\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}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "beginCaptures": { "2": { "name": "keyword.other.class.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#type_signature" } ] } ] }, "instance_decl": { "patterns": [ { "name": "meta.declaration.instance.haskell", "begin": "^(?:>|<) ([ \\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}])(?|<) \\1[ \\t]|(?:>|<) [ \\t]*$)|^(?!(?:>|<) )", "contentName": "meta.type-signature.haskell", "beginCaptures": { "2": { "name": "keyword.other.haskell" } }, "endCaptures": { "1": { "name": "keyword.other.haskell" } }, "patterns": [ { "include": "#pragma" }, { "include": "#type_signature" } ] } ] }, "deriving_instance_decl": { "patterns": [ { "name": "meta.declaration.instance.deriving.haskell", "begin": "^(?:>|<) ([ \\t]*)(deriving\\s+instance)(?:(?<=[\\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": "keyword.other.haskell" } }, "patterns": [ { "include": "#pragma" }, { "include": "#type_signature" } ] } ] }, "foreign_import": { "patterns": [ { "name": "meta.foreign.haskell", "begin": "^(?:>|<) ([ \\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": "#function_type_declaration" }, { "include": "#haskell_expr" }, { "include": "#comments" } ] } ] }, "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": "keyword.other.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": "keyword.other.type.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": "#haskell_expr" } ] } } }, { "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}](?