23

I can see the type of an infix operator in GHCi with :t like so:

>:t (.)
(.) :: (b -> c) -> (a -> b) -> a -> c

How can i see the operator precedence in GHCi? is that possible?

Also, bonus question, is there a way to see the source of these prelude functions through ghci?

gereeter
  • 4,731
  • 1
  • 28
  • 28
Adam Gordon Bell
  • 3,083
  • 2
  • 26
  • 53

1 Answers1

33

:i (:info).

[Prelude]
> :i (+)
class Num a where
  (+) :: a -> a -> a
  ...
        -- Defined in `GHC.Num'
infixl 6 +
Cat Plus Plus
  • 125,936
  • 27
  • 200
  • 224