``Orphan instances'' should be avoided anyway.

Jonathan Cast jonathanccast at fastmail.fm
Wed Aug 13 12:08:36 EDT 2008


On Wed, 2008-08-13 at 09:29 +0100, Malcolm Wallace wrote:
> >  We already have named instances:
> >
> > data ShowDict alpha = ShowDict alpha {
> >    namedShows :: alpha -> String -> String
> >    }
> 
> This is not valid Haskell. 

I must have been distracted.  I meant:

data ShowDict alpha = ShowDict {
  namedShows :: alpha -> String -> String
  }

obviously.

>  Either all components of the data  
> structure are named fields, or none.  It is not possible to have a  
> mixture of the two, as here.
> 
> In addition, there are many classes it is not currently possible to  
> simulate using this technique, because the types go significantly  
> beyond Haskell'98.

My proposal already required implicit parameters...

jcc




More information about the Libraries mailing list