Rebinding (:) -- built-in syntax, or just another constructor?
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?
Trac metadata
Trac field | Value |
---|---|
Version | 6.6 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | low |
Resolution | Unresolved |
Component | Compiler (Parser) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | Unknown |
Architecture | Multiple |