-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The following code generates some unexpected behavior (at least to me) in 
hugs (Feburary 2001: hugs 98 compatibility)

- -----------------------------------
main = print(show test)

newtype Out a = MkOut (String, a)

instance (Show a) => Show (Out a) where
  show (MkOut (x,y)) = x ++ " value: " ++ show y

test = MkOut("Blah\nBlah", 4)
- --------------------------------------

Hugs Output:

Main> test
("Blah\nBlah",4)
(20 reductions, 55 cells)
Main> 

- ------------------------------

GHCi (and expected output):

Main> test
Blah
Blah value: 4
Main> 

- -- 
You're in a maze of twisty little statements, all alike.
Public Key available from http://www.garbett.org/public-key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8WVcaDtpPjAQxZ6ARAlk0AJ9j2BELdtnJctQhn4vypDb/6PLXsgCcCYe3
ChhJJuXN8nBdIeRm6lrKNFE=
=0T16
-----END PGP SIGNATURE-----

_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to