
Fri, 7 Dec 2001 11:38:14 -0800, Mark P Jones
There's no solid technical reason for this, but Haskell doesn't allow it at the moment because there isn't an easy way to name an instance declaration.
There is another problem: even if we created a syntax to name them, if they would not be exported by default then current programs would have to be changed. An instance is usually meant to be exported, so even not considering compatibility it would be tedious to list all those instances in the export list (unless you want to export every named thing as well and omit the export list). It's easy to overlook some and the point when somebody tries to use a particular instance might be far in the future. Each instance is often a "small" part of an interface. I agree that the ability to selectively export instances would be good. Only it's hard to combine with the current policy of exporting all instances by default. Perhaps in the future it will be possible to specify the interface of a Haskell module more formally, with types of exported values for example. Then we should remember about instances and solve both problems simultaneously. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ QRCZAK

Marcin 'Qrczak' Kowalczyk wrote:
There is another problem: even if we created a syntax to name them, if they would not be exported by default then current programs would have to be changed.
Well, the default could be to export, unless explicitly hidden. If it _is_ exported, you could have the option to write it explicitly, or just have it go by default.
Perhaps in the future it will be possible to specify the interface of a Haskell module more formally, with types of exported values for example. Then we should remember about instances and solve both problems simultaneously.
I guess that may be true... It could be really useful to have a tool to take a source file and automagically make an approximate header for it... -- /Times-Bold 40 selectfont/n{moveto}def/m{gsave true charpath clip 72 400 n 300 -4 1{dup 160 300 3 -1 roll 0 360 arc 300 div 1 1 sethsbcolor fill}for grestore 0 -60 rmoveto}def 72 500 n(This message has been)m (brought to you by the)m(letter alpha and the number pi.)m(David Feuer) m(David_Feuer@brown.edu)m showpage

Hi Marcin, | > There's no solid technical reason for this, but Haskell doesn't allow | > it at the moment because there isn't an easy way to name an instance | > declaration. | | There is another problem: even if we created a syntax to name them, | if they would not be exported by default then current programs would | have to be changed. You're right of course, although I consider this a pragmatic issue rather than a technical problem: I'm thinking of future languages that are inspired by current Haskell standards but not constrained by details of the current definition or existing codebase. All the best, Mark
participants (3)
-
David Feuer
-
Marcin 'Qrczak' Kowalczyk
-
Mark P Jones