Picon
Favicon

Re: Chimeric syntax


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


Gmane