Re: Unary operators [was: Re: ~ patterns]
Hello Benjamin, Friday, February 03, 2006, 2:29:47 AM, you wrote: (+ x) --- (? + x) i like this idea! but i tink that it's too late for such incompatible change :( really, unary operators can be added to language without any troubles. we need only to prohibit using of the same symbol for unary and binary operators: unary 9 # #n = n-1 f = #1-1 we can even allow prefix and postfix operators as long as they all have different names -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-prime mailing list Haskell-prime@haskell.org http://haskell.org/mailman/listinfo/haskell-prime
Re: Unary operators [was: Re: ~ patterns]
On Feb 3, 2006, at 9:34 AM, Bulat Ziganshin wrote: Hello Benjamin, Friday, February 03, 2006, 2:29:47 AM, you wrote: (+ x) --- (? + x) i like this idea! but i tink that it's too late for such incompatible change :( really, unary operators can be added to language without any troubles. we need only to prohibit using of the same symbol for unary and binary operators: unary 9 # #n = n-1 f = #1-1 we can even allow prefix and postfix operators as long as they all have different names The notable exception in this case, '-' (or anything starting with -), which breaks block comment syntax (see my earlier example). Bob ___ Haskell-prime mailing list Haskell-prime@haskell.org http://haskell.org/mailman/listinfo/haskell-prime
Re: Unary operators [was: Re: ~ patterns]
On 2/2/06, Benjamin Franksen [EMAIL PROTECTED] wrote: This would open the possibility to allow unary (prefix) operators in general which I find rather more useful than sections. Down that road lies APL. -- Taral [EMAIL PROTECTED] Computer science is no more about computers than astronomy is about telescopes. -- Edsger Dijkstra ___ Haskell-prime mailing list Haskell-prime@haskell.org http://haskell.org/mailman/listinfo/haskell-prime
Unary Operators
Hi All, How to define a new unary operator. E.g: I want to use /\ for intersection over a list of sets and similarly \/ for union over a list of sets. I searched haskell98 report but couldn't find any pointers. Please let me know if it's allowed in the first place, if yes then how Regards, -- Arun Kumar S Jadhav Masters Student, SIC-309, KReSIT, IIT-Bombay, Ph: 022-25764967 http://www.it.iitb.ac.in/~arunk * Never negotiate out of fear Never fear to negotiate * ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell
Re: Unary Operators
On Monday, 2003-07-07, 09:46, CEST, Arun Kumar S Jadhav wrote: Hi All, How to define a new unary operator. The only unary operator in Haskell is unary minus for negating numbers. There are no other predefined unary operators and it is not possible to define any. So unary minus is rather an exception in the Haskell language. But note that because of the way, function application is written, one can have notations similar to unary operators. For instance, there is not :: Bool - Bool and not expression looks like applying an unary not operator. [...] Wolfgang ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell