[Haskell-cafe] Infix tuple comma query (,)

Daniel Fischer daniel.is.fischer at web.de
Mon Apr 6 12:08:17 EDT 2009


Am Montag 06 April 2009 17:53:24 schrieb Paul Keir:
> module Main where
>
>
>
> data (:%^&) a b = a :%^& b    deriving (Show)
>
>
>
> main = do
>
>   print $ 18 :%^& (Just 99)
>
>   print $ (,) 9 10
>
>   print $ 9 , 10
>
>
>
> The last line in the code above causes a compile error.
>
> Why does infix use of the comma (tuple constructor?) function fail
> without brackets?
>

Tuples are special baked-in syntax. The parentheses are part of the tuple 
constructor(s).
It may be confusing you that you can use it prefix as well as "aroundfix".

>
>
> Thanks,
>
> Paul



More information about the Haskell-Cafe mailing list