[Haskell] Question about Infix/Postfix Operators in Haskell

Georg Martius mai99dgf at studserv.uni-leipzig.de
Mon Oct 18 03:51:52 EDT 2004


Hi,

On Mon, 18 Oct 2004 09:43:26 +0200, Peter Theissen <peter at tsunamis.de> wrote:

> Hi,
> is there any possibility of defining Infix-/Postfixoperators
> in Haskell?
>
> Example:
> Plus :: Int, Int -> Int

Plus :: Int -> Int -> Int

> Plus x y = x + y
>
> an now I´m want to use Plus in another function as an infix:
>
> Times2:: x = x Plus x

Times2:: x = x `Plus` x

Best regards!
  Georg

-- 

---- Georg Martius,  Tel: (+49 34297) 89434 ----
------- http://www.flexman.homeip.net ---------


More information about the Haskell mailing list