wiki:InfixTypeConstructors

Version 1 (modified by ross@…, 8 years ago) (diff)

--

Infix Type Constructors

Brief Explanation

GHC allows type constructors to be infix operators (conops, beginning with :, but not including : itself).

Changes to the syntax may depend on whether CompositionAsDot is adopted, but roughly speaking we add

 qtycon   -> qconid  | ( qconsym )
 qtyconop -> qconsym | ` qconid `

And type gets an extra production:

 type    -> btype qtyconop type

(modulo FixityResolution). Also, there are obvious changes to the grammar for type, data, and newtype declarations.

References

Tickets

#78
Add infix type constructors

Pros

  • This is a straightforward generalisation, doesn't break any existing code, and improves the consistency of the syntax.

Cons