Chimeric syntax

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Apr 28 15:50:25 EDT 2009


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

On Apr 28, 2009, at 01:24 , Scott Michel wrote:
> I've been hacking along on a NetBeans Haskell plugin (*) Looking at
> Parser.y.pp, because both Eclipse and NetBeans work with antlr, it
> seems like there are interesting cases in which chimeric constructions
> parse correctly. Here's an example:
>
> class ParsedModule m where
>  let { a = 1; b = 2; } in a + b :: Int :: Int
>
> This is mostly accepted by ghc, which complains with an invalid type  
> signature.

Looking at the Online Report, my guess is it parses as:

exp^0 = "let {a = 1; b = 2; } in a + b"
type  = "Int :: Int"

and of course "Int :: Int" is an invalid type signature.  (::) parses  
as if it were a very low precedence operator.

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


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAkn3Xg4ACgkQIn7hlCsL25XQpgCdFnKgoxE8DlJWMpLTabR6gkIW
tZIAnjnR8HheL8RtO87Z3ZteRqfHewUo
=eptK
-----END PGP SIGNATURE-----


More information about the Glasgow-haskell-users mailing list