Ticket #1497 (closed bug: invalid)
Rebinding (:) -- built-in syntax, or just another constructor?
Description
This program is valid in Hugs 2005, but not in GHC:
import Prelude (print,(<),Bool(..)) data Cond a = a : a infixl 0 ? infixl 1 : (?) :: Bool -> Cond a -> a True ? (x : _) = x False ? (_ : y) = y main = print (1 < 2 ? "yeah" : "no!")
Hugs responds with:
Main> main "yeah"
GHCi says:
$ ghci A.hs A.hs:4:16: Illegal binding of built-in syntax: :
Which one is right?
Change History
Note: See
TracTickets for help on using
tickets.
