How to fix DatatypeContexts?

harry voldermort at hotmail.com
Thu Jul 18 16:46:32 CEST 2013


Brandon Allbery wrote
> No. The point is, it's not simply a type annotation; it's a *value* (a
> dictionary) that must be carried along with the rest of the value somehow.
> The compiler can't always work out statically which instances need to be
> used with the affected value, so it has to be available at run time; the
> context is effectively declaring that the run-time dictionary is a
> required
> extra parameter. And it wouldn't really be workable for some types to
> secretly imply that extra parameter and others not.

Why not let all types carry the dictionary automatically, or at least every
time that it's used, if that would incur a memory/performance penalty? GHC
tells me which context to add when it's missing, so it clearly knows.



--
View this message in context: http://haskell.1045720.n5.nabble.com/How-to-fix-DatatypeContexts-tp5733103p5733119.html
Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.




More information about the Glasgow-haskell-users mailing list