In the Haskell 98 report, I found this:
The syntax for Haskell type expressions is given above. Just as data values are built using data constructors,
It's not part of the Haskell standard, but as jamshidh mentions it is still possible in GHC. The caveat is that data constructors (not type constructors) must start with a colon:
{-# LANGUAGE TypeOperators #-}
data a + b = a :+ b
f :: a + b -> a
f (a :+ b) = a
g :: a + b -> b
g (a :+ b) = b
Just to be completely clear: Haskell 98 and Haskell 2000 both allow infix value constructors such as
data Complex r = r :+ r
Here the value constructor (:+)
is infix, as in 5 :+ 7
.
You only need the TypeOperators
extension to have type constructors which are infix. For example,
data x ??! y = Left x | Right y
Here the type constructor (??!)
is infix, as in Int ??! Bool
.