Encountered absent arg
Simon Peyton-Jones
simonpj at microsoft.com
Mon Apr 19 08:55:55 EDT 2010
| >> I compiled my code with -fdicts-strict.
| >
| > What is this actually supposed to do? It seems the documentation is
| missing:
| > http://www.haskell.org/ghc/docs/latest/html/users_guide/options-
| optimise.html#options-f
|
| >From reading the source code, it appears to make any dictionary fields
| of GADTs strict. So the dictionary for Eq in:
|
| data EqDict a where
| EqDict :: Eq a => EqDict a
|
| Will be a strict field.
dicts-strict is supposed to make any function that takes a dictionary argument strict in that argument. In principle this is a useful optimization, since dictionaries never diverge, but I have never really followed through on it. One reason is that the picture is more cloudy with recursive dictionaries. In any case, I have no looked at it for ages so it might have bit-rotted.
If anyone wants to give it a whirl, do have a go, and look at the Core you get.
Simon
More information about the Glasgow-haskell-users
mailing list