[Haskell-cafe] Getting some funny brackets in Haddock docs

Johannes Waldmann johannes.waldmann at htwk-leipzig.de
Wed Jan 10 10:55:01 UTC 2018


OverloadedLists solves this, in a way?

Prelude> :set -XOverloadedLists
Prelude> import qualified Data.Map.Strict as M
Prelude M> M.size [(2,3)]
1

because of the IsList instance
https://hackage.haskell.org/package/containers-0.5.10.2/docs/src/Data.Map.Internal.html#line-3233

Do we want to use this in code examples in the docs?
Equivalently, is it recommended to use this notation in actual code?
The problem I see is that this (and similar) extensions
will be active for all literals in a module -
while we only want it for literals of some specific type.
I know this is handled in the parser, and we don't know the types
at this point.

- J


More information about the Haskell-Cafe mailing list