Skip to content

ghci :info should show fixity of operator that is lacking a fixity declaration

While discussing a syntax question, I wanted to say "you first look up all the fixity information" but then I got:

Prelude> :i ($)
($) :: (a -> b) -> a -> b 	-- Defined in ‘GHC.Base’
infixr 0 $

Prelude> foo # bar = undefined
Prelude> :i (#)
(#) :: p1 -> p2 -> a 	-- Defined at <interactive>:1:5

So what fixity does # have? Of course, every-one knows it's infixl 9 (https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-820004.4.2) (NB: and it's easy to find, too - just scroll down to the very end of https://www.haskell.org/documentation/ because that's obviously where the most important documents are)

Well anyway, could ghci perhaps print a line

-- lacking a fixity declaration, assumed to be infixl 9 

or

infixl 9 #  -- assumed, since a fixity declaration is lacking

where I'm trying to use language of the standard verbally.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information