0

I saw this question and have the same question as commenter Erik: why does <!-- language: lang-haskell --> highlighting:

{-# a pragma #-}
{- a comment -}
-- a comment
import Data.Vector.Unboxed as U
import Foo

main =
    let y = Bar $ Qux $ U.replicate 11221184 0 :: Foo (Qux Int)
        (Bar (Qux ans)) = iterate (plus y) y !! 100
    in putStr $ show $ foldl1' (*) ans

differ from <!-- language: lang-hs --> or <!-- language: haskell --> highlighting:

{-# a pragma #-}
{- a comment -}
-- a comment
import Data.Vector.Unboxed as U
import Foo

main =
    let y = Bar $ Qux $ U.replicate 11221184 0 :: Foo (Qux Int)
        (Bar (Qux ans)) = iterate (plus y) y !! 100
    in putStr $ show $ foldl1' (*) ans

I'm trying to figure out how the styles are differentiated so I can send bug reports to the right ones, as recommended in this answer. It would also be nice to know, as a commenter on the answer suggested, if google-code-prettify is dead.

Why are there multiple Haskell styles? Are there simply multiple highlighters in google-code-prettify, or is there some other reason? How does SO choose which highlighter to use by default (when the question is tagged, for example)?

4

The highlighting you get with lang-haskell is the same as you get with, for example, lang-unicorns:

{-# a pragma #-}
{- a comment -}
-- a comment
import Data.Vector.Unboxed as U
import Foo

main =
    let y = Bar $ Qux $ U.replicate 11221184 0 :: Foo (Qux Int)
        (Bar (Qux ans)) = iterate (plus y) y !! 100
    in putStr $ show $ foldl1' (*) ans

It's the default highlighting you get when the language key you used isn't in fact defined. lang-hs is defined and gives you Haskell-specific highlighting.

When you use language: tagname (rather than lang-foo), the highlighter used is the one that is associated with the tag (lang-hs here).

Yes, the highlighter settings are derived from the question's tags.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .