[Haskell-cafe] how to see operators precedence in GHCi

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Jul 25 11:36:17 EDT 2007


Hello ,

from http://community.livejournal.com/ru_declarative/54566.html

Q: how to see operators precedence in GHCi?
A:
Prelude> let showParen = (undefined::[[[[()]]]]->())
Prelude> showParen $ 2+3*4
<interactive>:1:12:
    No instance for (Num [[[[()]]]])
      arising from use of `+' at <interactive>:1:12
    Probable fix: add an instance declaration for (Num [[[[()]]]])
    In the second argument of `($)', namely `2 + (3 * 4)'
    In the definition of `it': it = showParen $ (2 + (3 * 4))
Prelude>

-- 
Best regards,
 Bulat                          mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list