Skip to content

Print operator types as infix

Consider the type

{-# OPTIONS -fglasgow-exts #-}
data a :-> b = a :-> b deriving (Show)

Load that file into GHCi and print the type of a simple expression with it.

*Main> :t True :-> False

The actual output will be

True :-> False :: (:->) Bool Bool

Notice that the type constructor has been printed in prefix form. It would be nice if these infix type constructors printed in infix form just like infix data constructors do. For example the desired output would be:

True :-> False :: Bool :-> Bool
Trac metadata
Trac field Value
Version 6.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information