diff --git a/lexers/embedded/haskell.xml b/lexers/embedded/haskell.xml
index 5f805d6da..1fad08231 100644
--- a/lexers/embedded/haskell.xml
+++ b/lexers/embedded/haskell.xml
@@ -95,19 +95,22 @@
-
+
-
+
-
+
-
+
-
+
+
+
+
diff --git a/lexers/testdata/haskell.actual b/lexers/testdata/haskell.actual
new file mode 100644
index 000000000..dc7a2f450
--- /dev/null
+++ b/lexers/testdata/haskell.actual
@@ -0,0 +1,43 @@
+1_000_000
+1__000000
+1000000_
+_1000000
+
+0.0001
+0.000_1
+0_.0001
+_0.0001
+0._0001
+0.0001_
+
+1e+23
+1_e+23
+1__e+23
+1e_+23
+
+1e+23
+1e+_23
+1e+23_
+
+0x
+0xffff
+0xff_ff
+0x_ffff
+0x__ffff
+_0xffff
+
+0b
+0b01_0000__0000
+0b01_
+0b_01
+0b__01
+
+3.141_592_653_589_793
+96_485.332_89
+6.022_140_857e+23
+
+0o
+0o7_77
+0o700_
+0o_700
+0o__700
diff --git a/lexers/testdata/haskell.expected b/lexers/testdata/haskell.expected
new file mode 100644
index 000000000..9073bfee4
--- /dev/null
+++ b/lexers/testdata/haskell.expected
@@ -0,0 +1,95 @@
+[
+ {"type":"LiteralNumberInteger","value":"1_000_000"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"1__000000"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"1000000"},
+ {"type":"Name","value":"_"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameFunction","value":"_1000000"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberFloat","value":"0.0001"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"0.000_1"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"0"},
+ {"type":"Name","value":"_"},
+ {"type":"Operator","value":"."},
+ {"type":"LiteralNumberInteger","value":"0001"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameFunction","value":"_0"},
+ {"type":"Operator","value":"."},
+ {"type":"LiteralNumberInteger","value":"0001"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"0"},
+ {"type":"Operator","value":"."},
+ {"type":"Name","value":"_0001"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"0.0001"},
+ {"type":"Name","value":"_"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberFloat","value":"1e+23"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"1_e+23"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"1__e+23"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"1"},
+ {"type":"Name","value":"e_"},
+ {"type":"Operator","value":"+"},
+ {"type":"LiteralNumberInteger","value":"23"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberFloat","value":"1e+23"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberInteger","value":"1"},
+ {"type":"Name","value":"e"},
+ {"type":"Operator","value":"+"},
+ {"type":"Name","value":"_23"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"1e+23"},
+ {"type":"Name","value":"_"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberInteger","value":"0"},
+ {"type":"Name","value":"x"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberHex","value":"0xffff"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberHex","value":"0xff_ff"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberHex","value":"0x_ffff"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberHex","value":"0x__ffff"},
+ {"type":"Text","value":"\n"},
+ {"type":"NameFunction","value":"_0xffff"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberInteger","value":"0"},
+ {"type":"Name","value":"b"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberBin","value":"0b01_0000__0000"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberBin","value":"0b01"},
+ {"type":"Name","value":"_"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberBin","value":"0b_01"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberBin","value":"0b__01"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberFloat","value":"3.141_592_653_589_793"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"96_485.332_89"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberFloat","value":"6.022_140_857e+23"},
+ {"type":"Text","value":"\n\n"},
+ {"type":"LiteralNumberInteger","value":"0"},
+ {"type":"Name","value":"o"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberOct","value":"0o7_77"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberOct","value":"0o700"},
+ {"type":"Name","value":"_"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberOct","value":"0o_700"},
+ {"type":"Text","value":"\n"},
+ {"type":"LiteralNumberOct","value":"0o__700"},
+ {"type":"Text","value":"\n"}
+]