├── Snippets
├── data _.tmSnippet
├── type _.tmSnippet
├── do _.tmSnippet
├── where _.tmSnippet
├── Guard.tmSnippet
├── Type Signature.tmSnippet
├── deriving _.tmSnippet
├── newtype _.tmSnippet
├── Haddock Postfix.tmSnippet
├── Haddock Prefix.tmSnippet
├── Hashbang.tmSnippet
├── class _.tmSnippet
├── Definition.tmSnippet
├── Lambda Expression.tmSnippet
├── Type Constraint.tmSnippet
├── Type Sequence.tmSnippet
├── import _.tmSnippet
├── let _.tmSnippet
├── instance _.tmSnippet
├── Function.tmSnippet
├── Main.tmSnippet
├── import _ hiding _.tmSnippet
├── if _ then _ else _.tmSnippet
├── Left Arrow.tmSnippet
├── Right Arrow.tmSnippet
├── import qualified _.tmSnippet
├── case _ of _.tmSnippet
└── List Comprehension.tmSnippet
├── Preferences
├── Symbol List.tmPreferences
├── Indentation.tmPreferences
├── Typing Pairs.plist
└── Comments.tmPreferences
├── Commands
├── Show Type.tmCommand
├── Lookup on Hoogle.tmCommand
├── New Module.tmCommand
├── Infix Function Call from Selection - Word.tmCommand
├── Load in GHCi.tmCommand
└── Run.plist
├── README.mdown
├── Syntaxes
├── Literate Haskell.plist
└── Haskell.plist
├── info.plist
└── Support
└── bin
└── haskelltype
/Snippets/data _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | data ${1:Type} = ${0:Other}
7 | name
8 | data …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | dat
13 | uuid
14 | 4C5EC5BB-6AE1-4825-AB50-1CF4741285E9
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/type _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | type ${1:Type} = ${0:Other}
7 | name
8 | type …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | typ
13 | uuid
14 | 3C25C0C7-D764-4BF8-9BFF-AE6954AF106D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/do _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | do
7 | ${1:return ${0:expression}}
8 | name
9 | do …
10 | scope
11 | source.haskell
12 | tabTrigger
13 | do
14 | uuid
15 | 397D02C1-A10B-4A83-8C05-6EB71E50D4CF
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/where _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | where
7 | ${0:definitions}
8 | name
9 | where …
10 | scope
11 | source.haskell
12 | tabTrigger
13 | where
14 | uuid
15 | A6FD9AB4-8E7E-47A8-B17D-D82F47A0C495
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/Guard.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | | ${1:predicate} = ${0:definition}
7 | name
8 | Guard
9 | scope
10 | source.haskell - comment
11 | tabTrigger
12 | |
13 | uuid
14 | BA1329DB-9437-4246-839A-48A49B48D31D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Type Signature.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:name} :: ${0:Type}
7 | name
8 | Type Signature
9 | scope
10 | source.haskell
11 | tabTrigger
12 | ::
13 | uuid
14 | 78719987-0091-407A-B5F1-68456A67130D
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/deriving _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | deriving (${0:Class})
7 | name
8 | deriving …
9 | scope
10 | source.haskell meta.type
11 | tabTrigger
12 | der
13 | uuid
14 | 3FA57615-871F-4465-B35D-781B2EA9F5FC
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/newtype _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | newtype ${1:Type} = ${0:Other}
7 | name
8 | newtype …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | new
13 | uuid
14 | EFCBAB59-D574-454D-A05A-8928CF81947F
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Haddock Postfix.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | | ${0:documentation}
7 | name
8 | Haddock Postfix
9 | scope
10 | source.haskell comment.block
11 | tabTrigger
12 | |
13 | uuid
14 | 961E79B9-CC31-4843-BBE9-51F46598BC25
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Haddock Prefix.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ^ ${0:documentation}
7 | name
8 | Haddock Prefix
9 | scope
10 | source.haskell comment.block
11 | tabTrigger
12 | ^
13 | uuid
14 | E0E613C1-0760-46BC-A51E-168E658904C5
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Hashbang.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | #!/usr/bin/env ${1:runhaskell}
7 |
8 | name
9 | #!/usr/bin/env…
10 | scope
11 | source.haskell
12 | tabTrigger
13 | #!
14 | uuid
15 | 54495635-CC26-4C14-A202-5C0CA4B078C2
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/class _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | class ${1:Class} where
7 | ${0:definition}
8 | name
9 | class …
10 | scope
11 | source.haskell
12 | tabTrigger
13 | cla
14 | uuid
15 | 23F6173A-6390-46FF-865C-F59AB70E360A
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/Definition.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:name} ${2:pattern}${2/.+/ /}= ${0:definition}
7 | name
8 | Definition
9 | scope
10 | source.haskell
11 | tabTrigger
12 | =
13 | uuid
14 | 81886A7D-5EE8-438C-9FC8-6BA3B65E444A
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Lambda Expression.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | \\${1:pattern} -> ${0:expression}
7 | name
8 | Lambda Expression
9 | scope
10 | source.haskell
11 | tabTrigger
12 | \
13 | uuid
14 | 0672CE3D-A796-44B1-AEF2-975C0FB27184
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Type Constraint.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | (${1:Class}) => $0
7 | name
8 | Type Constraint
9 | scope
10 | source.haskell meta.function.type
11 | tabTrigger
12 | =
13 | uuid
14 | 1D72833B-ED9F-4A5E-9B72-F77E4FD09CE9
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/Type Sequence.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:Type} -> ${0:Type}
7 | name
8 | Type Sequence
9 | scope
10 | source.haskell meta.function.type
11 | tabTrigger
12 | -
13 | uuid
14 | 17FC3207-9DC4-47F8-A9B3-B38FE5F84158
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/import _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | import ${1:Module}${2/.+/ (/}${2:function}${2/.+/)/}$0
7 | name
8 | import …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | imp
13 | uuid
14 | 85150C9B-A5F1-450A-BEBF-119091146957
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/let _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | let
7 | ${1:name} = ${2:expression}
8 | in ${0:expression}
9 | name
10 | let …
11 | scope
12 | source.haskell
13 | tabTrigger
14 | let
15 | uuid
16 | 88C8A6FB-B06D-4386-BA33-51E28F64AD88
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Preferences/Symbol List.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Symbol List
7 | scope
8 | source.haskell entity.name.function.infix
9 | settings
10 |
11 | showInSymbolList
12 | 0
13 |
14 | uuid
15 | 0C39B945-E2C0-4E43-8A5B-332F6FA73C67
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/instance _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | instance ${1:Class} ${2:Type} where
7 | ${0:definition}
8 | name
9 | instance …
10 | scope
11 | source.haskell
12 | tabTrigger
13 | ins
14 | uuid
15 | 26F8FAFE-4438-4D3C-A453-AAB72FD0F719
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/Function.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:name} :: ${2:Type}
7 | ${1} ${3:pattern}${3/.+/ /}${4/.+/= /}${4:definition}
8 | name
9 | Function
10 | scope
11 | source.haskell
12 | tabTrigger
13 | fun
14 | uuid
15 | A83076A6-EC6F-418F-B8F9-9AE952964242
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Snippets/Main.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | module Main where
7 |
8 | main :: IO ()
9 | main = ${0:putStrLn "Hello World"}
10 |
11 | name
12 | Main
13 | scope
14 | source.haskell
15 | tabTrigger
16 | main
17 | uuid
18 | A3A65891-D126-4D2D-9E6B-E20ADE2EAA88
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Snippets/import _ hiding _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | import ${1:Module}${2/.+/ hiding (/}${2:function}${2/.+/)/}$0
7 | name
8 | import … hiding …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | imph
13 | uuid
14 | 1BA6898C-E8C4-44C9-98F4-4823608FEFD1
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/if _ then _ else _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | if ${1:condition}
7 | then ${2:expression}
8 | else ${3:expression}
9 | name
10 | if … then … else …
11 | scope
12 | source.haskell
13 | tabTrigger
14 | if
15 | uuid
16 | 5F2050D1-1347-40CE-854E-24B2BF389849
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/Left Arrow.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:name} <- ${0:expression}
7 | keyEquivalent
8 | ^,
9 | name
10 | Left Arrow
11 | scope
12 | source.haskell
13 | tabTrigger
14 | <
15 | uuid
16 | 9EF1F854-442C-40B2-BED5-454A015AA26D
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/Right Arrow.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | ${1:expression} -> ${0:expression}
7 | keyEquivalent
8 | ^.
9 | name
10 | Right Arrow
11 | scope
12 | source.haskell
13 | tabTrigger
14 | >
15 | uuid
16 | BAF52ED4-6A5B-4260-B5BC-93D2012200C8
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/import qualified _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | import qualified ${1:Module}${2/.+/ as /}${2:Mod}${3/.+/ (/}${3:function}${3/.+/)/}$0
7 | name
8 | import qualified …
9 | scope
10 | source.haskell
11 | tabTrigger
12 | impq
13 | uuid
14 | 32BC2D63-AF02-4DBA-8A75-6A74E334FE0C
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Snippets/case _ of _.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | case ${1:expression} of
7 | ${2:pattern} -> ${3:expression}
8 | ${4:otherwise} -> ${5:expression}
9 | name
10 | case … of …
11 | scope
12 | source.haskell
13 | tabTrigger
14 | case
15 | uuid
16 | DD1D7C05-BC60-4E62-BC8C-9230A32C2533
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Snippets/List Comprehension.tmSnippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | content
6 | [ ${1:expression} | ${2:name} <- ${3:expression}${4/.+/, /}${4:condition}
7 | name
8 | List Comprehension
9 | scope
10 | source.haskell constant.language.empty-list
11 | tabTrigger
12 | [
13 | uuid
14 | C721BD84-71FA-423F-8460-2CED4954137F
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Commands/Show Type.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | haskelltype "$(cat)"
9 | fallbackInput
10 | word
11 | input
12 | selection
13 | keyEquivalent
14 | ^h
15 | name
16 | Show Type
17 | output
18 | showAsTooltip
19 | scope
20 | source.haskell
21 | uuid
22 | 6B723007-D4EE-476B-8282-76230C559D5A
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Preferences/Indentation.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Indentation
7 | scope
8 | source.haskell
9 | settings
10 |
11 | decreaseIndentPattern
12 | ^\s*$
13 | disableIndentCorrections
14 |
15 | increaseIndentPattern
16 | ((^.*(=|\bdo|\bwhere|\bthen|\belse|\bof)\s*$)|(^.*\bif(?!.*\bthen\b.*\belse\b.*).*$))
17 | indentOnPaste
18 | simple
19 |
20 | uuid
21 | 39417FB9-B85C-4213-BB1D-C19BCDD4E487
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Commands/Lookup on Hoogle.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/bin/bash
9 | echo "<meta http-equiv=\"refresh\" content=\"0; http://haskell.org/hoogle/?q=$(cat)\">"
10 | fallbackInput
11 | word
12 | input
13 | selection
14 | keyEquivalent
15 | ^H
16 | name
17 | Lookup on Hoogle
18 | output
19 | showAsHTML
20 | scope
21 | source.haskell
22 | uuid
23 | 50D814AE-D850-4C97-AF3E-1FDE4366C6A3
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Commands/New Module.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/bin/bash
9 |
10 | NAME=${TM_FILENAME%.hs}
11 | if [[ -z "$NAME" ]]; then
12 | NAME="Main"
13 | fi
14 |
15 | cat <<SNIPPET
16 | module \${1:$NAME} \${2/.+/(
17 | /m}\${2:function}\${2/.+/
18 | ) /m}where
19 | \$0
20 | SNIPPET
21 | input
22 | none
23 | name
24 | module …
25 | output
26 | insertAsSnippet
27 | scope
28 | source.haskell
29 | tabTrigger
30 | mod
31 | uuid
32 | 156D0588-A61A-4419-9C71-6E47320A4DA5
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Commands/Infix Function Call from Selection - Word.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/bin/bash
9 |
10 | NAME="$(cat)"
11 | if [[ -z "$NAME" ]]; then
12 | NAME="\$1"
13 | fi
14 |
15 | echo "\`$NAME\`\$0"
16 |
17 | fallbackInput
18 | word
19 | input
20 | selection
21 | keyEquivalent
22 | ^'
23 | name
24 | Infix Function Call From Word / Selection
25 | output
26 | insertAsSnippet
27 | scope
28 | source.haskell
29 | uuid
30 | FA4AA254-EB7D-4B43-AC67-066AA9E8E8D9
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Preferences/Typing Pairs.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Typing Pairs
7 | scope
8 | source.haskell - comment
9 | settings
10 |
11 | smartTypingPairs
12 |
13 |
14 | "
15 | "
16 |
17 |
18 | {
19 | }
20 |
21 |
22 | [
23 | ]
24 |
25 |
26 | (
27 | )
28 |
29 |
30 | `
31 | `
32 |
33 |
34 |
35 | uuid
36 | FBF9D932-D5CE-4EC4-9162-122E511C8627
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Preferences/Comments.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Comments
7 | scope
8 | source.haskell
9 | settings
10 |
11 | shellVariables
12 |
13 |
14 | name
15 | TM_COMMENT_START_2
16 | value
17 | {-
18 |
19 |
20 | name
21 | TM_COMMENT_END_2
22 | value
23 | -}
24 |
25 |
26 | name
27 | TM_COMMENT_START
28 | value
29 | --
30 |
31 |
32 |
33 | uuid
34 | E3994307-4D9E-44D6-832E-52C244F1CDF3
35 |
36 |
37 |
--------------------------------------------------------------------------------
/README.mdown:
--------------------------------------------------------------------------------
1 | # Installation
2 |
3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.
4 |
5 | # General
6 |
7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_
8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_
9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_
10 |
11 | # License
12 |
13 | If not otherwise specified (see below), files in this repository fall under the following license:
14 |
15 | Permission to copy, use, modify, sell and distribute this
16 | software is granted. This software is provided "as is" without
17 | express or implied warranty, and with no claim as to its
18 | suitability for any purpose.
19 |
20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”.
--------------------------------------------------------------------------------
/Commands/Load in GHCi.tmCommand:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | nop
7 | command
8 | #!/bin/bash
9 |
10 | THASKELL=${TM_HASKELL:-ghci}
11 |
12 | esc () {
13 | STR="$1" ruby18 <<"RUBY"
14 | str = ENV['STR']
15 | str = str.gsub(/'/, "'\\\\''")
16 | str = str.gsub(/[\\"]/, '\\\\\\0')
17 | print "'#{str}'"
18 | RUBY
19 | }
20 |
21 | osascript <<- APPLESCRIPT
22 | tell app "Terminal"
23 | launch
24 | activate
25 | do script "clear; cd $(esc "${TM_DIRECTORY}"); ${THASKELL} $(esc "${TM_FILEPATH}")"
26 | set position of first window to {100, 100}
27 | end tell
28 | APPLESCRIPT
29 |
30 | input
31 | none
32 | inputFormat
33 | text
34 | keyEquivalent
35 | @R
36 | name
37 | Load in GHCi
38 | outputCaret
39 | afterOutput
40 | outputFormat
41 | text
42 | outputLocation
43 | toolTip
44 | scope
45 | source.haskell
46 | semanticClass
47 | process.external.run.haskell
48 | uuid
49 | 2242C46C-153E-4EEB-B80B-A5398559D759
50 | version
51 | 2
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Commands/Run.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeRunningCommand
6 | saveModifiedFiles
7 | command
8 | #!/usr/bin/env ruby18 -wKU
9 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/save_current_document"
10 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/tm/executor"
11 | require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape"
12 |
13 | TextMate.save_if_untitled('hs')
14 |
15 | haskell = e_sh(ENV['TM_HASKELL'] || 'runhaskell')
16 | TextMate::Executor.run(haskell, ENV['TM_FILEPATH'])
17 |
18 | input
19 | document
20 | inputFormat
21 | text
22 | keyEquivalent
23 | @r
24 | name
25 | Run
26 | outputCaret
27 | afterOutput
28 | outputFormat
29 | html
30 | outputLocation
31 | newWindow
32 | requiredCommands
33 |
34 |
35 | command
36 | runhaskell
37 | locations
38 |
39 | /opt/local/bin/runhugs
40 | /usr/local/bin/runhaskell
41 |
42 | variable
43 | TM_HASKELL
44 |
45 |
46 | scope
47 | source.haskell
48 | semanticClass
49 | process.run.script.haskell
50 | uuid
51 | 3B083BE7-9812-4F06-A758-CCAD9514E797
52 | version
53 | 2
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Syntaxes/Literate Haskell.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | lhs
8 |
9 | keyEquivalent
10 | ^~H
11 | name
12 | Literate Haskell
13 | patterns
14 |
15 |
16 | begin
17 | ^((\\)begin)({)code(})(\s*\n)?
18 | captures
19 |
20 | 1
21 |
22 | name
23 | support.function.be.latex
24 |
25 | 2
26 |
27 | name
28 | punctuation.definition.function.latex
29 |
30 | 3
31 |
32 | name
33 | punctuation.definition.arguments.begin.latex
34 |
35 | 4
36 |
37 | name
38 | punctuation.definition.arguments.end.latex
39 |
40 |
41 | contentName
42 | source.haskell.embedded.latex
43 | end
44 | ^((\\)end)({)code(})
45 | name
46 | meta.embedded.block.haskell.latex
47 | patterns
48 |
49 |
50 | include
51 | source.haskell
52 |
53 |
54 |
55 |
56 | begin
57 | ^(> )
58 | beginCaptures
59 |
60 | 1
61 |
62 | name
63 | punctuation.definition.bird-track.haskell
64 |
65 |
66 | comment
67 | This breaks type signature detection for now, but it's better than having no highlighting whatsoever.
68 | contentName
69 | source.haskell
70 | end
71 | $
72 | name
73 | meta.embedded.haskell
74 | patterns
75 |
76 |
77 | include
78 | source.haskell
79 |
80 |
81 |
82 |
83 | include
84 | text.tex.latex
85 |
86 |
87 | scopeName
88 | text.tex.latex.haskell
89 | uuid
90 | 439807F5-7129-487D-B5DC-95D5272B43DD
91 |
92 |
93 |
--------------------------------------------------------------------------------
/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | contactEmailRot13
6 | wnzvf@37fvtanyf.pbz
7 | contactName
8 | Jamis Buck
9 | description
10 | Support for <a href="http://www.haskell.org/">Haskell</a>, a general purpose, purely functional programming language featuring static typing, higher order functions, polymorphism, type classes, and monadic effects.
11 | mainMenu
12 |
13 | items
14 |
15 | 3B083BE7-9812-4F06-A758-CCAD9514E797
16 | 2242C46C-153E-4EEB-B80B-A5398559D759
17 | ------------------------------------
18 | 6B723007-D4EE-476B-8282-76230C559D5A
19 | 50D814AE-D850-4C97-AF3E-1FDE4366C6A3
20 | ------------------------------------
21 | FA4AA254-EB7D-4B43-AC67-066AA9E8E8D9
22 | ------------------------------------
23 | A3A65891-D126-4D2D-9E6B-E20ADE2EAA88
24 | 21646767-DD1B-4BA9-BF3B-15968F8672AB
25 | 18F43074-566D-4AD9-8DCE-9C26B8516B64
26 | CE424A97-E486-4DE7-9328-C6ADB99B4ABD
27 | ------------------------------------
28 | 89248B78-C2C6-48EE-BC47-CF8E9A5EA0E7
29 |
30 | submenus
31 |
32 |
33 | name
34 | Haskell
35 | ordering
36 |
37 | 3B083BE7-9812-4F06-A758-CCAD9514E797
38 | 2242C46C-153E-4EEB-B80B-A5398559D759
39 | 6B723007-D4EE-476B-8282-76230C559D5A
40 | 50D814AE-D850-4C97-AF3E-1FDE4366C6A3
41 | FA4AA254-EB7D-4B43-AC67-066AA9E8E8D9
42 | A3A65891-D126-4D2D-9E6B-E20ADE2EAA88
43 | 21646767-DD1B-4BA9-BF3B-15968F8672AB
44 | 18F43074-566D-4AD9-8DCE-9C26B8516B64
45 | CE424A97-E486-4DE7-9328-C6ADB99B4ABD
46 | 89248B78-C2C6-48EE-BC47-CF8E9A5EA0E7
47 | 4B154C05-D107-4316-9AAD-43A3DCF1860A
48 | 5C034675-1F6D-497E-8073-369D37E2FD7D
49 | 439807F5-7129-487D-B5DC-95D5272B43DD
50 | E3994307-4D9E-44D6-832E-52C244F1CDF3
51 | 39417FB9-B85C-4213-BB1D-C19BCDD4E487
52 | 0C39B945-E2C0-4E43-8A5B-332F6FA73C67
53 | FBF9D932-D5CE-4EC4-9162-122E511C8627
54 |
55 | uuid
56 | 118557A4-4FEF-406D-A68E-BD191D9CBC83
57 |
58 |
59 |
--------------------------------------------------------------------------------
/Support/bin/haskelltype:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby18 -w
2 |
3 | word = ARGV.first
4 |
5 | prelude = '
6 | (!!) :: [a] -> Int -> a ||||| [0,1,2] !! 1 = 1
7 | ($) :: (a -> b) -> a -> b ||||| f x $ g y = f x (g y)
8 | ($!) :: (a -> b) -> (a -> b) |||||
9 | (&&) :: Bool -> Bool -> Bool ||||| Boolean \'and\'
10 | (||) :: Bool -> Bool -> Bool ||||| Boolean \'or\'
11 | (*) :: Num a => a -> a -> a ||||| Multiplication
12 | (**) :: Floating a => a -> a -> a ||||| Exponentiation
13 | (+) :: Num a => a -> a -> a ||||| Addition
14 | (++) :: [a] -> [a] -> [a] ||||| Concatonation: "abc" ++ "def" = "abcdef"
15 | (-) :: Num a => a -> a -> a ||||| Subtraction
16 | (.) :: (b -> c) -> (a -> b) -> a -> c ||||| Function composition
17 | (/) :: Fractional a => a -> a -> a ||||| Division
18 | (/=) :: Eq a => a -> a -> Bool ||||| not equal
19 | (<) :: Ord a => a -> a -> Bool ||||| Less Than
20 | (<=) :: Ord a => a -> a -> Bool ||||| Less Than or Equal To
21 | (==) :: Eq a => a -> a -> Bool ||||| Equality
22 | (=<<) :: Monad a => (a -> m b) -> m a -> m b ||||| Monadic binding
23 | (>) :: Ord a => a -> a -> Bool ||||| Greater Than
24 | (>=) :: Ord a => a -> a -> Bool ||||| Greater Than or Equal To
25 | (>>) :: Monad m => m a -> m b -> m b ||||| Monadic binding
26 | (>>=) :: Monad m => m a -> (a -> m b) -> m b ||||| Monadic binding
27 | (^) :: (Num a, Integral b) => a -> b -> a ||||| Exponentiation
28 | (^^) :: (Fractional a, Integral b) => a -> b -> a ||||| negative exponent allowed
29 | abs :: Num a => a -> a ||||| Absolute Value
30 | acos :: Floating a => a -> a ||||| Arccosine
31 | acosh :: Floating a => a -> a ||||| Hyperbolic Arccosine
32 | all :: (a -> Bool) -> [a] -> Bool ||||| all (/= \'a\') "cba" = False
33 | and :: [Bool] -> Bool ||||| and [True, True, True] = True
34 | any :: (a -> Bool) -> [a] -> Bool ||||| any (== \'c\') "abc" = True
35 | appendFile :: FilePath -> String -> IO () ||||| Appends String to FilePath
36 | applyM :: Monad m => (a -> m b) -> m a -> m b |||||
37 | asTypeOf :: a -> a -> a ||||| Sort of a type cast
38 | asin :: Floating a => a -> a ||||| Arcsine
39 | asinh :: Floating a => a -> a ||||| Hyperbolic Arcsine
40 | atan :: Floating a => a -> a ||||| Arctangent
41 | atan2 :: RealFrac a => a -> a ||||| ArcTangent
42 | atanh :: Floating a => a -> a ||||| Hyperbolic Arctangent
43 | break :: (a -> Bool) -> [a] -> ([a], [a]) ||||| break (<2) [1,2,3] = ([1],[2,3])
44 | catch :: IO a -> (IOError -> IO a) -> IO a |||||
45 | ceiling :: (RealFrac a, Integral b) => a -> b |||||
46 | compare :: Ord a => a -> a -> Ordering |||||
47 | concat :: MonadPlus m => [m a] -> m a ||||| concat ["a","bc","d"] = "abcd"
48 | concatMap :: (a -> [b]) -> [a] -> [b] |||||
49 | const :: a -> b -> a |||||
50 | cos :: Floating a => a -> a |||||
51 | cosh :: Floating a => a -> a |||||
52 | curry :: ((a, b) -> c) -> a -> b -> c |||||
53 | cycle :: [a] -> [a] ||||| cycle "abc" = "abcabcabc...
54 | decodeFloat :: RealFloat a => a -> (Integer, Int) |||||
55 | div :: Integral a => a -> a -> a |||||
56 | divMod :: Integral a => a -> a -> (a, a) |||||
57 | drop :: Int -> [a] -> [a] ||||| drop 2 "abcd" = "cd"
58 | dropWhile :: (a -> Bool) -> [a] -> [a] ||||| dropWhile (>3) [5,3,5] = [3,5]
59 | elem :: Eq a => a -> [a] -> Bool ||||| \'a\' \'elem\' "abc" = True
60 | encodeFloat :: RealFloat a => Integer -> Int -> a |||||
61 | enumFrom :: Enum a => a -> [a] ||||| [n..]
62 | enumFromThen :: Enum a => a -> a -> [a] ||||| [m,n..]
63 | enumFromThenTo :: Enum a => a -> a -> a -> [a] ||||| [m,n..o]
64 | enumFromTo :: Enum a => a -> a -> [a] ||||| [m..n]
65 | error :: String -> a |||||
66 | even :: Integral a => a -> Bool |||||
67 | exp :: Floating a => a -> a |||||
68 | exponent :: RealFloat a => a -> Int |||||
69 | fail :: Monad m => String -> m a |||||
70 | filter :: (a -> Bool) -> [a] -> [a] |||||
71 | flip :: (a -> b -> c) -> (b -> a -> c) |||||
72 | floatDigits :: RealFloat a => a -> Int |||||
73 | floatRadix :: RealFloat a => a -> Integer |||||
74 | floatRange :: RealFloat a => a -> (Int, Int) |||||
75 | floor :: (RealFrac a, Integral b) => a -> b |||||
76 | fmap :: Functor f => (a -> b) -> f a -> f b |||||
77 | foldl :: (a -> b -> a) -> a -> [b] -> a ||||| foldl (+) 0 [a,b,c] = ((0+a)+b)+c
78 | foldl1 :: (a -> a -> a) -> [a] -> a ||||| foldl1 (+) [a,b,c] = (a+b)+c
79 | foldr :: (a -> b -> b) -> b -> [a] -> b ||||| foldr (+) 0 [a,b,c] = a+(b+(c+0))
80 | foldr1 :: (a -> a -> a) -> [a] -> a ||||| foldr1 (+) [a,b,c] = a+(b+c)
81 | fromEnum :: Enum a => a -> Int |||||
82 | fromInteger :: Num a => Integer -> a |||||
83 | fromIntegral :: (Integral a, Num b) => a -> b |||||
84 | fromRational :: Fractional a => Rational -> a |||||
85 | fst :: (a, b) -> a |||||
86 | gcd :: (Integral a) => a -> a -> a |||||
87 | getChar :: IO Char ||||| eof generates an IOError
88 | getContents :: IO String |||||
89 | getLine :: IO String ||||| eof generates an IOError
90 | head :: [a] -> a |||||
91 | id :: a -> a |||||
92 | init :: [a] -> [a] ||||| init "abcd" = "abc"
93 | interact :: (String -> String) -> IO () |||||
94 | ioError :: IOError -> IO a |||||
95 | isDenormalized :: RealFloat a => a -> Bool |||||
96 | isIEEE :: RealFloat a => a -> Bool |||||
97 | isInfinite :: RealFloat a => a -> Bool |||||
98 | isNaN :: RealFloat a => a -> Bool |||||
99 | isNegativeZero :: RealFloat a => a -> Bool |||||
100 | iterate :: (a -> a) -> a -> [a] ||||| iterate (++ " ") "" = ["", " ", " ",...]
101 | last :: [a] -> a ||||| last "abcde" = "e"
102 | lcm :: Integral a => a -> a -> a |||||
103 | length :: [a] -> Int ||||| length "Abc" = 3
104 | lex :: ReadS String ||||| lex "abc def" = [("abc"," def")]
105 | lines :: String -> [String] |||||
106 | log :: Floating a => a -> a |||||
107 | logBase :: Floating a => a -> a -> a |||||
108 | lookup :: Eq a => a -> [(a, b)] -> Maybe b |||||
109 | map :: (a -> b) -> [a] -> [b] |||||
110 | mapM :: Monad m => (a -> m b) -> [a] -> m [b] |||||
111 | mapM_ :: Monad m => (a -> m b) -> [a] -> m () |||||
112 | max :: Ord a => a -> a -> a |||||
113 | maxBound :: Bounded a => a |||||
114 | maximum :: Ord a => [a] -> a |||||
115 | maybe :: b -> (a -> b) -> Maybe a -> b ||||| maybe 0 (+1) (Just 1) = 2
116 | min :: Ord a => a -> a -> a |||||
117 | minBound :: Bounded a => a |||||
118 | minimum :: Ord a => [a] -> a |||||
119 | mod :: Integral a => a -> a -> a |||||
120 | negate :: Num a => a -> a |||||
121 | not :: Bool -> Bool |||||
122 | notElem :: Eq a => a -> [a] -> Bool |||||
123 | null :: [a] -> Bool |||||
124 | odd :: Integral a => a -> Bool |||||
125 | or :: [Bool] -> Bool |||||
126 | otherwise :: Bool |||||
127 | pi :: Floating a => a |||||
128 | pred :: Enum a => a -> a ||||| pred True = False
129 | print :: Show a => IO () ||||| adds a newline
130 | product :: Num a => [a] -> a |||||
131 | properFraction :: (RealFrac a, Integral b) => a -> (b, a) |||||
132 | putChar :: Char -> IO () |||||
133 | putStr :: String -> IO () |||||
134 | putStrLn :: String -> IO () ||||| adds a newline
135 | quot :: Integral a => a -> a -> a |||||
136 | quotRem :: Integral a => a -> a -> (a, a) |||||
137 | read :: Read a => String -> a |||||
138 | readFile :: FilePath -> IO String |||||
139 | readIO :: Read a => String -> IO a ||||| fails with IOError
140 | readList :: Read a => ReadS [a] |||||
141 | readLn :: Read a => IO a |||||
142 | readParen :: Bool -> ReadS a -> ReadS a |||||
143 | reads :: Read a => ReadS a ||||| reads "1 2" :: [(Int,String)] = [(1," 2")]
144 | readsPrec :: Read a => Int -> ReadS a |||||
145 | realToFrac :: (Real a, Fractional b) => a -> b |||||
146 | recip :: Fractional a => a -> a |||||
147 | rem :: Integral a => a -> a -> a |||||
148 | repeat :: a -> [a] ||||| repeat \'a\' = "aaaaaaaaa..."
149 | replicate :: Int -> a -> [a] ||||| replicate 4 \'a\' = "aaaa"
150 | return :: Monad m => a -> m a |||||
151 | reverse :: [a] -> [a] ||||| reverse "abc" = "cba"
152 | round :: (RealFrac a, Integral b) => a -> b |||||
153 | scaleFloat :: RealFloat a => Int -> a -> a |||||
154 | scanl :: (a -> b -> a) -> a -> [b] -> [a] ||||| scanl (+) 0 [1,2,3] = [0,1,3,6]
155 | scanl1 :: (a -> a -> a) -> [a] -> [a] ||||| scanl1 (+) [1,2,3] = [1,3,6]
156 | scanr :: (a -> b -> b) -> b -> [a] -> [b] ||||| scanr (+) 0 [1,2,3] = [6,5,3,0]
157 | scanr1 :: (a -> a -> a) -> [a] -> [a] ||||| scanr1 (+) [1,2,3] = [6,5,3]
158 | seq :: a -> b -> b |||||
159 | sequence :: Monad m => [m a] -> m [a] |||||
160 | sequence_ :: Monad m => [m a] -> m () ||||| do operations in sequence
161 | show :: Show a => a -> String |||||
162 | showChar :: Char -> ShowS |||||
163 | showList :: Show a => [a] -> ShowS |||||
164 | showParen :: Bool -> ShowS -> ShowS |||||
165 | showString :: String -> ShowS |||||
166 | shows :: Show a => a -> ShowS |||||
167 | showsPrec :: Show a => Int -> a -> ShowS |||||
168 | significand :: RealFloat a => a -> a |||||
169 | signum :: Num a => a -> a |||||
170 | sin :: Floating a => a -> a |||||
171 | sinh :: Floating a => a -> a |||||
172 | snd :: (a, b) -> b |||||
173 | span :: (a -> Bool) -> [a] -> ([a], [a]) ||||| span isAlpha "ab cd" = ("ab"," cd")
174 | splitAt :: Int -> [a] -> ([a], [a]) ||||| splitAt 2 "abcdef" = ("ab","cdef")
175 | sqrt :: Floating a => a -> a |||||
176 | subtract :: Num a => a -> a -> a |||||
177 | succ :: Enum a => a -> a ||||| succ False = True
178 | sum :: Num a => [a] -> a ||||| sum [1,2,3] = 6
179 | tail :: [a] -> [a] ||||| tail "abc" = "bc"
180 | take :: Int -> [a] -> [a] ||||| take 3 "abcde" = "abc"
181 | takeWhile :: (a -> Bool) -> [a] -> [a] ||||| takeWhile (> 2) [3,2,1] = [3]
182 | tan :: Floating a => a -> a |||||
183 | tanh :: Floating a => a -> a |||||
184 | toEnum :: Enum a => Int -> a ||||| toEnum 0 :: Bool = False
185 | toInteger :: Integral a => a -> Integer |||||
186 | toRational :: Real a => a -> Rational |||||
187 | truncate :: (RealFrac a, Integral b) => a -> b |||||
188 | uncurry :: (a -> b -> c) -> ((a, b) -> c) |||||
189 | undefined :: a |||||
190 | unlines :: [String] -> String |||||
191 | until :: (a -> Bool) -> (a -> a) -> a -> a ||||| until (> 3) (+ 2) 0 = 4
192 | unwords :: [String] -> String |||||
193 | unzip :: [(a, b)] -> ([a], [b]) ||||| unzip [(\'a\',\'b\'),(\'c\',\'d\')] = ("ac",bd")
194 | unzip3 :: [(a, b, c)] -> ([a], [b], [c]) |||||
195 | userError :: String -> IOError |||||
196 | words :: String -> [String] ||||| words "ab d as+3" = ["ab","d","as+3"]
197 | writeFile :: FilePath -> String -> IO () |||||
198 | zip :: [a] -> [b] -> [(a, b)] ||||| zip "abc" "de" = [(\'a\',\'d\'), (\'b\',e\')]
199 | zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] |||||
200 | zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] ||||| zipWith (+) [1,2] [3,4] = [4,6]
201 | zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] |||||'
202 |
203 | lookup = prelude.strip.split("\n").inject(Hash.new) { |h,l|
204 | name, desc = l.split("::")
205 | h[name.strip] = desc.split("|||||").map {|a| a.strip}
206 | h
207 | }
208 |
209 | if lookup[word]
210 | puts lookup[word]
211 | else
212 | STDIN.each do |line|
213 | name, desc = line.strip.split("::")
214 | if name and desc
215 | if name.split(",").map{|s| s.strip}.include?(word)
216 | puts desc.strip
217 | exit
218 | end
219 | end
220 | end
221 | puts "☿ It is a mystery ☿"
222 | end
223 |
--------------------------------------------------------------------------------
/Syntaxes/Haskell.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | fileTypes
6 |
7 | hs
8 |
9 | keyEquivalent
10 | ^~H
11 | name
12 | Haskell
13 | patterns
14 |
15 |
16 | captures
17 |
18 | 1
19 |
20 | name
21 | punctuation.definition.entity.haskell
22 |
23 | 2
24 |
25 | name
26 | punctuation.definition.entity.haskell
27 |
28 |
29 | comment
30 | In case this regex seems unusual for an infix operator, note that Haskell allows any ordinary function application (elem 4 [1..10]) to be rewritten as an infix expression (4 `elem` [1..10]).
31 | match
32 | (`)[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(`)
33 | name
34 | keyword.operator.function.infix.haskell
35 |
36 |
37 | match
38 | \(\)
39 | name
40 | constant.language.unit.haskell
41 |
42 |
43 | match
44 | \[\]
45 | name
46 | constant.language.empty-list.haskell
47 |
48 |
49 | begin
50 | \b(module)\b
51 | beginCaptures
52 |
53 | 1
54 |
55 | name
56 | keyword.other.haskell
57 |
58 |
59 | end
60 | \b(where)\b
61 | endCaptures
62 |
63 | 1
64 |
65 | name
66 | keyword.other.haskell
67 |
68 |
69 | name
70 | meta.declaration.module.haskell
71 | patterns
72 |
73 |
74 | include
75 | #module_name
76 |
77 |
78 | include
79 | #module_exports
80 |
81 |
82 | match
83 | [a-z]+
84 | name
85 | invalid
86 |
87 |
88 |
89 |
90 | begin
91 | \b(class)\b
92 | beginCaptures
93 |
94 | 1
95 |
96 | name
97 | keyword.other.haskell
98 |
99 |
100 | end
101 | \b(where)\b
102 | endCaptures
103 |
104 | 1
105 |
106 | name
107 | keyword.other.haskell
108 |
109 |
110 | name
111 | meta.declaration.class.haskell
112 | patterns
113 |
114 |
115 | match
116 | \b(Monad|Functor|Eq|Ord|Read|Show|Num|(Frac|Ra)tional|Enum|Bounded|Real(Frac|Float)?|Integral|Floating)\b
117 | name
118 | support.class.prelude.haskell
119 |
120 |
121 | match
122 | [\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
123 | name
124 | entity.other.inherited-class.haskell
125 |
126 |
127 | match
128 | \b[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
129 | name
130 | variable.other.generic-type.haskell
131 |
132 |
133 |
134 |
135 | begin
136 | \b(instance)\b
137 | beginCaptures
138 |
139 | 1
140 |
141 | name
142 | keyword.other.haskell
143 |
144 |
145 | end
146 | \b(where)\b|$
147 | endCaptures
148 |
149 | 1
150 |
151 | name
152 | keyword.other.haskell
153 |
154 |
155 | name
156 | meta.declaration.instance.haskell
157 | patterns
158 |
159 |
160 | include
161 | #type_signature
162 |
163 |
164 |
165 |
166 | begin
167 | \b(import)\b
168 | beginCaptures
169 |
170 | 1
171 |
172 | name
173 | keyword.other.haskell
174 |
175 |
176 | end
177 | ($|;|(?=--))
178 | name
179 | meta.import.haskell
180 | patterns
181 |
182 |
183 | match
184 | \b(qualified|as|hiding)\b
185 | name
186 | keyword.other.haskell
187 |
188 |
189 | include
190 | #module_name
191 |
192 |
193 | include
194 | #module_exports
195 |
196 |
197 | include
198 | #strings
199 |
200 |
201 |
202 |
203 | begin
204 | (deriving)\s*\(
205 | beginCaptures
206 |
207 | 1
208 |
209 | name
210 | keyword.other.haskell
211 |
212 |
213 | end
214 | \)
215 | name
216 | meta.deriving.haskell
217 | patterns
218 |
219 |
220 | match
221 | \b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
222 | name
223 | entity.other.inherited-class.haskell
224 |
225 |
226 |
227 |
228 | match
229 | \b(deriving|where|data|type|case|of|let|in|newtype|default)\b
230 | name
231 | keyword.other.haskell
232 |
233 |
234 | match
235 | \binfix[lr]?\b
236 | name
237 | keyword.operator.haskell
238 |
239 |
240 | match
241 | \b(do|if|then|else)\b
242 | name
243 | keyword.control.haskell
244 |
245 |
246 | comment
247 | Floats are always decimal
248 | match
249 | \b([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\b
250 | name
251 | constant.numeric.float.haskell
252 |
253 |
254 | match
255 | \b([0-9]+|0([xX][0-9a-fA-F]+|[oO][0-7]+))\b
256 | name
257 | constant.numeric.haskell
258 |
259 |
260 | captures
261 |
262 | 1
263 |
264 | name
265 | punctuation.definition.preprocessor.c
266 |
267 |
268 | comment
269 | In addition to Haskell's "native" syntax, GHC permits the C preprocessor to be run on a source file.
270 | match
271 | ^\s*(#)\s*\w+
272 | name
273 | meta.preprocessor.c
274 |
275 |
276 | include
277 | #pragma
278 |
279 |
280 | include
281 | #strings
282 |
283 |
284 | begin
285 | (?x)^(\s*)
286 | (?<fn>
287 | (?:
288 | [\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']* |
289 | \(
290 | (?!--+\))
291 | (?:
292 | (?![(),;\[\]`{}_"'])[\p{S}\p{P}]
293 | )+
294 | \)
295 | )
296 | (?:\s*,\s*\g<fn>)?
297 | )
298 | \s*(::)
299 | beginCaptures
300 |
301 | 2
302 |
303 | patterns
304 |
305 |
306 | match
307 | [\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
308 | name
309 | entity.name.function.haskell
310 |
311 |
312 | include
313 | #infix_op
314 |
315 |
316 |
317 | 3
318 |
319 | name
320 | keyword.other.double-colon.haskell
321 |
322 |
323 | name
324 | meta.function.type-declaration.haskell
325 | patterns
326 |
327 |
328 | include
329 | #type_signature
330 |
331 |
332 | while
333 | ^\1\s+
334 |
335 |
336 | match
337 | \b(Just|Nothing|Left|Right|True|False|LT|EQ|GT|\(\)|\[\])\b
338 | name
339 | support.constant.haskell
340 |
341 |
342 | match
343 | \b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
344 | name
345 | constant.other.haskell
346 |
347 |
348 | include
349 | #comments
350 |
351 |
352 | match
353 | \b(abs|acos|acosh|all|and|any|appendFile|applyM|asTypeOf|asin|asinh|atan|atan2|atanh|break|catch|ceiling|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|div|divMod|drop|dropWhile|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromEnum|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|head|id|init|interact|ioError|isDenormalized|isIEEE|isInfinite|isNaN|isNegativeZero|iterate|last|lcm|length|lex|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|odd|or|otherwise|pi|pred|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|read|readFile|readIO|readList|readLn|readParen|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showList|showParen|showString|shows|showsPrec|significand|signum|sin|sinh|snd|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|toEnum|toInteger|toRational|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b(?!')
354 | name
355 | support.function.prelude.haskell
356 |
357 |
358 | include
359 | #infix_op
360 |
361 |
362 | comment
363 | In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.
364 | match
365 | ((?![(),;\[\]`{}_"'])[\p{S}\p{P}])+
366 | name
367 | keyword.operator.haskell
368 |
369 |
370 | match
371 | ,
372 | name
373 | punctuation.separator.comma.haskell
374 |
375 |
376 | repository
377 |
378 | block_comment
379 |
380 | applyEndPatternLast
381 | 1
382 | begin
383 | \{-(?!#)
384 | captures
385 |
386 | 0
387 |
388 | name
389 | punctuation.definition.comment.haskell
390 |
391 |
392 | end
393 | -\}
394 | name
395 | comment.block.haskell
396 | patterns
397 |
398 |
399 | include
400 | #block_comment
401 |
402 |
403 |
404 | comments
405 |
406 | patterns
407 |
408 |
409 | begin
410 | (^[ \t]+)?(?=--+((?![\p{S}\p{P}])|[(),;\[\]`{}_"']))
411 | beginCaptures
412 |
413 | 1
414 |
415 | name
416 | punctuation.whitespace.comment.leading.haskell
417 |
418 |
419 | comment
420 | Operators may begin with '--' as long as they are not entirely composed of '-' characters. This means comments can't be immediately followed by an allowable operator character.
421 | end
422 | (?!\G)
423 | patterns
424 |
425 |
426 | begin
427 | --
428 | beginCaptures
429 |
430 | 0
431 |
432 | name
433 | punctuation.definition.comment.haskell
434 |
435 |
436 | end
437 | \n
438 | name
439 | comment.line.double-dash.haskell
440 |
441 |
442 |
443 |
444 | include
445 | #block_comment
446 |
447 |
448 |
449 | infix_op
450 |
451 | comment
452 | An operator cannot be composed entirely of '-' characters; instead, it should be matched as a comment.
453 | match
454 | (\((?!--+\))((?![(),;\[\]`{}_"'])[\p{S}\p{P}])+\)|\(,+\))
455 | name
456 | entity.name.function.infix.haskell
457 |
458 | module_exports
459 |
460 | begin
461 | \(
462 | end
463 | \)
464 | name
465 | meta.declaration.exports.haskell
466 | patterns
467 |
468 |
469 | match
470 | \b[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
471 | name
472 | entity.name.function.haskell
473 |
474 |
475 | match
476 | \b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
477 | name
478 | storage.type.haskell
479 |
480 |
481 | match
482 | ,
483 | name
484 | punctuation.separator.comma.haskell
485 |
486 |
487 | include
488 | #infix_op
489 |
490 |
491 | comment
492 | So named because I don't know what to call this.
493 | match
494 | \(.*?\)
495 | name
496 | meta.other.unknown.haskell
497 |
498 |
499 | include
500 | #comments
501 |
502 |
503 |
504 | module_name
505 |
506 | match
507 | (?<conid>[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*(\.\g<conid>)?)
508 | name
509 | support.other.module.haskell
510 |
511 | pragma
512 |
513 | begin
514 | \{-#
515 | end
516 | #-\}
517 | name
518 | meta.preprocessor.haskell
519 | patterns
520 |
521 |
522 | comment
523 | Taken from https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#pragmas
524 | match
525 | \b(LANGUAGE|OPTIONS_GHC|INCLUDE|WARNING|DEPRECATED|MINIMAL|UNPACK|NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|OVERLAPS|INCOHERENT|INLINE|NOINLINE|INLINABLE|CONLIKE|LINE|RULES|SPECIALIZE|SPECIALISE)\b
526 | name
527 | keyword.other.preprocessor.haskell
528 |
529 |
530 |
531 | strings
532 |
533 | patterns
534 |
535 |
536 | begin
537 | "
538 | beginCaptures
539 |
540 | 0
541 |
542 | name
543 | punctuation.definition.string.begin.haskell
544 |
545 |
546 | end
547 | "
548 | endCaptures
549 |
550 | 0
551 |
552 | name
553 | punctuation.definition.string.end.haskell
554 |
555 |
556 | name
557 | string.quoted.double.haskell
558 | patterns
559 |
560 |
561 | match
562 | \\(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\\\"'\&])
563 | name
564 | constant.character.escape.haskell
565 |
566 |
567 | match
568 | \\o[0-7]+|\\x[0-9A-Fa-f]+|\\[0-9]+
569 | name
570 | constant.character.escape.octal.haskell
571 |
572 |
573 | match
574 | \\\^[A-Z@\[\]\\\^_]
575 | name
576 | constant.character.escape.control.haskell
577 |
578 |
579 | begin
580 | \\\s
581 | beginCaptures
582 |
583 | 0
584 |
585 | name
586 | constant.character.escape.begin.haskell
587 |
588 |
589 | end
590 | \\
591 | endCaptures
592 |
593 | 0
594 |
595 | name
596 | constant.character.escape.end.haskell
597 |
598 |
599 | patterns
600 |
601 |
602 | match
603 | \S+
604 | name
605 | invalid.illegal.character-not-allowed-here.haskell
606 |
607 |
608 |
609 |
610 |
611 |
612 | captures
613 |
614 | 1
615 |
616 | name
617 | punctuation.definition.string.begin.haskell
618 |
619 | 2
620 |
621 | name
622 | constant.character.escape.haskell
623 |
624 | 3
625 |
626 | name
627 | constant.character.escape.octal.haskell
628 |
629 | 4
630 |
631 | name
632 | constant.character.escape.hexadecimal.haskell
633 |
634 | 5
635 |
636 | name
637 | constant.character.escape.control.haskell
638 |
639 | 6
640 |
641 | name
642 | punctuation.definition.string.end.haskell
643 |
644 |
645 | match
646 | (?x)
647 | (')
648 | (?:
649 | [\ -\[\]-~] # Basic Char
650 | | (\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE
651 | |DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS
652 | |US|SP|DEL|[abfnrtv\\\"'\&])) # Escapes
653 | | (\\o[0-7]+) # Octal Escapes
654 | | (\\x[0-9A-Fa-f]+) # Hexadecimal Escapes
655 | | (\\\^[A-Z@\[\]\\\^_]) # Control Chars
656 | )
657 | (')
658 |
659 | name
660 | string.quoted.single.haskell
661 |
662 |
663 |
664 | type_signature
665 |
666 | patterns
667 |
668 |
669 | captures
670 |
671 | 1
672 |
673 | name
674 | entity.other.inherited-class.haskell
675 |
676 | 2
677 |
678 | name
679 | variable.other.generic-type.haskell
680 |
681 | 3
682 |
683 | name
684 | keyword.other.big-arrow.haskell
685 |
686 |
687 | match
688 | \(\s*([\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*)\s+([\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*)\)\s*(=>)
689 | name
690 | meta.class-constraint.haskell
691 |
692 |
693 | include
694 | #pragma
695 |
696 |
697 | match
698 | ->
699 | name
700 | keyword.other.arrow.haskell
701 |
702 |
703 | match
704 | =>
705 | name
706 | keyword.other.big-arrow.haskell
707 |
708 |
709 | match
710 | \b(Int(eger)?|Maybe|Either|Bool|Float|Double|Char|String|Ordering|ShowS|ReadS|FilePath|IO(Error)?)\b
711 | name
712 | support.type.prelude.haskell
713 |
714 |
715 | match
716 | \b[\p{Ll}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
717 | name
718 | variable.other.generic-type.haskell
719 |
720 |
721 | match
722 | \b[\p{Lu}\p{Lt}][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}']*
723 | name
724 | storage.type.haskell
725 |
726 |
727 | match
728 | \(\)
729 | name
730 | support.constant.unit.haskell
731 |
732 |
733 | include
734 | #comments
735 |
736 |
737 |
738 |
739 | scopeName
740 | source.haskell
741 | uuid
742 | 5C034675-1F6D-497E-8073-369D37E2FD7D
743 |
744 |
745 |
--------------------------------------------------------------------------------