[arch-haskell] Flag setting for json package

Xyne xyne at archlinux.ca
Mon Jun 3 02:27:40 CEST 2013


Hi,

The json/haskell-json package has a cabal flag named "mapdict" which is disabled
by default. I find this completely counter-intuitive as the default behavior
will convert Data.Map values to JSON *list* values. With the flag enabled,
Data.Map values will be converted to JSON  map values as expected.

Just to give a concrete example:

Default behavior:
> import Data.Map
> import Text.JSON
> putStrLn $ encode $ insert "foo" "bar" empty
["foo","bar]

With mapdict enabled:
> import Data.Map
> import Text.JSON
> putStrLn $ encode $ insert "foo" "bar" empty
{"foo":"bar"}


The only possible reason that I can think of for this default behavior would be
some sort of performance metric, but I doubt that it would be significant,
especially not for such improper behavior.

Would it be possible (i.e. technically trivial and not against policy) to add
"--flags mapdict" to the configure command in the haskell-json PKGBUILD?

I'll send an email to the json maintainer as well to see if I can get the
default changed.

Thanks!

Regards,
Xyne





More information about the arch-haskell mailing list