[Haskell-cafe] Data types and field labels and "Show"

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Sep 27 14:17:36 EDT 2007


On Sep 27, 2007, at 14:14 , bbrown wrote:

> instance Show SimplePlayer where
> 	show a = "<Simple> posX [" ++ show a{posX} ++ "]"

instance Show SimplePlayer where
   show a = "<Simple> posX [" ++ show (posX a) ++ "]"

You might also want to consider deriving(Show).

-- 
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