[Haskell-cafe] Confused by instances

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Mon Apr 28 18:58:25 EDT 2008


On Apr 28, 2008, at 17:47 , Fraser Wilson wrote:
> Perhaps hack was a strong word.  I'm not referring to type  
> synonyms, but to the fact that Prelude's show class happens to have  
> a special show function for lists, which happens to be handy when  
> writing an instance for Show Char.  I find the coupling here  
> (between Show and a particular instance of Show, namely Show Char)  
> to be disturbing -- Show should not (if you ask me) contain special  
> machinery for specific instances.  Not that I'll lose sleep over  
> it, and of course the benefit (having pretty strings) far outweighs  
> the philosophical cost.


This is what comes of overloading lists as strings.  (And what goes  
along with it, namely slowness.  See Data.ByteString for a solution  
that solves both problems but sadly is unlikely to replace String)

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list