What version of bat are you using?
$ bat --version
bat 0.15.3
$
Describe the bug you encountered:

Lines in Haskell source file highlighted incorrectly and inconsistently.
Describe what you expected to happen?
Lines 21 and 23 in the given file should be highlighted the same way.
Here's the file itself or your convenience:
data DayOfWeek = Mon | Tues | Wed | Thur | Fri | Sat | Sun deriving Show
data Date = Date DayOfWeek Int deriving Show
instance Eq DayOfWeek where
(==) Mon Mon = True
(==) Tues Tues = True
(==) Wed Wed = True
(==) Thur Thur = True
(==) Fri Fri = True
(==) Sat Sat = True
(==) Sun Sun = True
(==) _ _ = False
instance Eq Date where
(==) (Date weekday dayOfMonth) (Date weekday' dayOfMonth') =
weekday == weekday' && dayOfMonth == dayOfMonth'
main :: IO()
main = do
putStrLn "Data types test"
putStr "Wed 14 == Wed 14 ? "
print (Date Wed 14 == Date Wed 14)
putStr "Wed 14 == Tue 14 ? "
print (Date Wed 14 == Date Tues 14)
How did you install bat?
$ cargo install bat
system
------
**$ uname -srm**
Darwin 19.4.0 x86_64
**$ sw_vers**
ProductName: Mac OS X
ProductVersion: 10.15.4
BuildVersion: 19E287
bat
---
**$ bat --version**
bat 0.15.3
**$ env**
bat_config
----------
bat_wrapper
-----------
No wrapper script for 'bat'.
bat_wrapper_function
--------------------
No wrapper function for 'bat'.
No wrapper function for 'cat'.
tool
----
**$ less --version**
less 487 (POSIX regular expressions)
Thank you for reporting this.
I have reduced the size of the example to this:

main = do
print 2
print 3
We have two syntaxes in bat which provide highlighting for Haskell files:
โฏ bat -L | rg Haskell
Haskell:hs
Haskell (improved):hs,hsc
Literate Haskell:lhs
The "Haskell (improved)" syntax is only there because we wanted to add support for Cabal files, and those two were only available as a package (I believe). The normal Haskell syntax seems to highlight everything differently, but without any obvious issues:

Until this has been fixed properly (I think we need to report this upstream), you can add this line to bats config file to use the normal Haskell syntax for *.hs files:
--map-syntax='*.hs:Haskell'
The normal Haskell syntax seems to highlight everything differently, but without any obvious issues
Offhand, I like it better - and it seems both more consistent and more reliable. Perhaps, we can keep this highlighting style for Haskell? Especially since it doesn't seem to Cabal only?
Until this has been fixed properly
:-)
(I think we need to report this upstream),
Probably...
you can add this line to
bat's config file ...
I don't think I saw any reference to that file in the man bat output. What's it's exact name? And the format of the lines comprising this file matches the command line parameters exactly? Including the preceding double-dash prefix?
Also, my workaround for this problem (before I saw your reply) was to copy https://github.com/sublimehq/Packages/blob/master/Haskell/Haskell.sublime-syntax to $(bat --config-dir)/syntaxes and rebuilding the cache. Perhaps, you can use that one instead...?
Besides, it seems to highlight Cabal project files just fine:


closed via #1030
I don't think I saw any reference to that file in the
man batoutput. What's it's _exact_ name? And the format of the lines comprising this file matches the command line parameters _exactly_? Including the preceding double-dash prefix?
Fix released in v0.15.4
Most helpful comment
Thank you for reporting this.
I have reduced the size of the example to this:
