Possible issue with isBuiltInOcc_maybe
Alan & Kim Zimmerman
alan.zimm at gmail.com
Thu Jan 1 20:16:50 UTC 2015
Never mind, I see it gets the required RdrName, e.g.listTyCon_RDR
Alan
On Thu, Jan 1, 2015 at 1:03 PM, Alan & Kim Zimmerman <alan.zimm at gmail.com>
wrote:
> I am busy checking that I can exactprint all the RdrNames produced by the
> parser, and came across this
>
> isBuiltInOcc_maybe occ
> = case occNameString occ of
> "[]" -> choose_ns listTyCon nilDataCon
> ":" -> Just consDataConName
> "[::]" -> Just parrTyConName
> "(##)" -> choose_ns unboxedUnitTyCon unboxedUnitDataCon
> "()" -> choose_ns unitTyCon unitDataCon
> '(':'#':',':rest -> parse_tuple UnboxedTuple 2 rest
> '(':',':rest -> parse_tuple BoxedTuple 2 rest
> _other -> Nothing
>
> The above code does not allow any spaces between '[' and ']', or '[:' and
> ':]' (for example)
>
> However, the parse rules DO allow spaces
>
> | '[' ']' {% ams (sLL $1 $> $ listTyCon_RDR) [mos
> $1,mcs $2] }
> | '[:' ':]' {% ams (sLL $1 $> $ parrTyCon_RDR) [mo
> $1,mc $2] }
>
> Is this a problem?
>
> Alan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20150101/de100fe3/attachment.html>
More information about the ghc-devs
mailing list