text/x-haskell
*.hs
[!#$%&*+./>=<?@:\\^|~-]
\{-#
#-\}
\b[a-z_][0-9a-zA-Z_'#]*
\b[A-Z][0-9a-zA-Z._'#]*
\%{symbolchar}+
(?<!\%{symbolchar})
(?!\%{symbolchar})
\.\.
::
=
\|
\
->
<-
@
~
=>
\\( # leading backslash
[abfnrtv\\"\'&] | # escaped character
[0-9]+ | # decimal digits
o[0-7]+ | # 'o' followed by octal digits
x[0-9A-Fa-f]+ | # 'x' followed by hex digits
\^[A-Z@\[\\\]^_] | # control character codes
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 # control char names
)
"
"
\%{escaped-character}
'
'
\%{escaped-character}
.
.
[0-9]+ \. [0-9]+ ([eE][+-]?[0-9]+)?
| [0-9]+ [eE][+-]?[0-9]+
0[xX][0-9a-fA-F]+
0[oO][0-7]+
[0-9]+
case
class
data
default
deriving
do
mdo
else
forall
foreign
hiding
if
import
in
infix
infixl
infixr
instance
let
module
newtype
of
qualified
then
where
type