[Haskell-cafe] Re: Ignorant begginer question

Tomasz Zielonka tomasz.zielonka at gmail.com
Fri Dec 24 11:08:05 EST 2004


On Fri, Dec 24, 2004 at 03:14:34PM +0000, Jules Bean wrote:
> It's a data constructor, written infix. Infix constructors all begin 
> with ':', I think.

Yes, but you can also use prefix, alphanumeric constructors as infix
by placing them in backticks. This can be nice sometimes:

    data Expr = ...
              | Expr `In` [Expr]
              | Expr `And` Expr
              | Expr `Or` Expr
              ...

    case e of
        e1 `In` es -> ...

Best regards,
Tomasz


More information about the Haskell-Cafe mailing list