On Tue, Jul 31, 2007 at 03:31:54PM -0700, David Roundy wrote:
> On Mon, Jul 30, 2007 at 11:47:46AM +0100, Jon Fairbairn wrote:
> > ChrisK <[EMAIL PROTECTED]> writes:
> > 
> > > And the readability is destroyed because you cannot do any type inference 
> > > in
> > > your head.
> > > 
> > > If you see
> > > 
> > > {
> > >  Matrix m = ....;
> > >  Matrix x = m * y;
> > >  ...;
> > > }
> > > 
> > > Then you know very little about the possible types of y
> > > since can only conclude that:
> > 
> > [snippage] This is all very horrid, but as far as I can tell
> > what I was proposing wouldn't lead to such a mess, except
> > possibly via defaulting, which, as the least important
> > aspect of the idea could easily be abandoned.
> 
> What your suggestion would do would be to make the type inferred for every
> pattern-matched function polymorphic, which means that in order to
> determine the correctness of a function you'd need to examine all other
> modules.  Similarly, if you fail to include a type signature in some simple
> pattern-matched function in a where clause, adding an import of another
> module could make that function fail to compile (with an undeterminable
> type error).

Excuse me?  One of the most critical properties of type classes is that
adding new instances can never make old code that uses old instances
stop compiling; the worst you could get is a definition conflict.

Stefan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to