[Haskell-cafe] Those damned parentheses

Brandon S Allbery KF8NH allbery.b at gmail.com
Sat May 7 21:19:05 CEST 2011


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

On 5/7/11 15:10 , Eitan Goldshtrom wrote:
> I get the error "Couldn't match expected type `[Char]' with actual type `a0
> -> c0'". The only way it seems to work is
> f p = putStrLn $ (show (Main.id p)) ++ " - message received"

Interestingly enough, you have the correct answer in there as well:  "$"

> f p = putStrLn $ (show $ Main.id p) ++ " = message received"

You may also want to look into Control.Applicative.

- -- 
brandon s. allbery     [linux,solaris,freebsd,perl]    allbery.b at gmail.com
system administrator  [openafs,heimdal,too many hats]                kf8nh
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3FmykACgkQIn7hlCsL25X9cQCeM2leHUslCJWW1GIFKtt5Dw9P
gFoAn1DbWu9QO89062Dx6hMIPRNq6siU
=P2Zz
-----END PGP SIGNATURE-----



More information about the Haskell-Cafe mailing list