« Return to Thread: how to see operators precedence in GHCi

Re: Re: how to see operators precedence in GHCi

by Stefan O'Rear :: Rate this Message:

Reply to Author | View in Thread

On Wed, Jul 25, 2007 at 09:35:38PM +0400, Bulat Ziganshin wrote:

> Hello Jon,
>
> Wednesday, July 25, 2007, 8:07:57 PM, you wrote:
> >> Q: how to see operators precedence in GHCi?
> >>     In the definition of `it': it = showParen $ (2 + (3 * 4))
>
> > Hmm, OK, but not that much quicker than going
> >    Prelude> :info (*)
>
> it just my poor english :)  i mean - "how to see how Haskell will
> parse some expression?". it will be too slow to look up each
> precedence and parse expression by hand :)
Much easier:

stefan@stefans:~$ ghci
GHCi, version 6.7.20070712: http://www.haskell.org/ghc/  :? for help
Loading package base ... linking ... done.
Prelude> :set -ddump-parsed
Prelude> 2 + 3 * 4

==================== Parser ====================
Just (2 + 3) * 4


14
Prelude>

Stefan


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (196 bytes) Download Attachment

 « Return to Thread: how to see operators precedence in GHCi