#1497: Rebinding (:) -- built-in syntax, or just another constructor?
--------------------------------+-------------------------------------------
  Reporter:  dons               |          Owner:          
      Type:  bug                |         Status:  new     
  Priority:  low                |      Milestone:          
 Component:  Compiler (Parser)  |        Version:  6.6     
  Severity:  normal             |       Keywords:          
Difficulty:  Easy (1 hr)        |             Os:  Unknown 
  Testcase:                     |   Architecture:  Multiple
--------------------------------+-------------------------------------------
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?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1497>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to