Infix expressions

2002-07-29 Thread Ken Shan
backquotes is accidentally omitted? In any case, perhaps some people on this mailing list would appreciate the following implementation of "infix expressions" that Dylan Thurston and I came up with -- as algebraic and perverse as we could manage: infixr 0 -:, :- data Infix f y = f

Re: Infix expressions

2002-07-29 Thread Hal Daume III
> Is there any reason other than potential confusion when one of the two > backquotes is accidentally omitted? I thought about this a while ago and I think it probably simply has to do with complexity of expressions. If you allow arbitrary expressions to appear within the ticks, you have a probl

Re: Infix expressions

2002-07-29 Thread Jon Fairbairn
can't be the same because you can't nest them. Using a matched pair of quotation marks would work, but then you have the possibility of writing really horrid expressions. > In any case, perhaps some people on this mailing list would appreciate > the following implementation of "infi

Re: Infix expressions

2002-07-30 Thread Yoann Padioleau
? > > In any case, perhaps some people on this mailing list would appreciate > the following implementation of "infix expressions" that Dylan Thurston > and I came up with -- as algebraic and perverse as we could manage: > > infixr 0 -:, :- > data In

[Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Alfonso Acosta
Hi all, I have to prettyprint infix expressions writing the least possible parenthesis (taking in account precedence and associativity). A simplified expression type could be: data Expr = Val String | -- Binary operators (using infix constructors) Expr :+: Expr

Re: [Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Stefan O'Rear
On Tue, Apr 10, 2007 at 09:20:52AM +0200, Alfonso Acosta wrote: > I have to prettyprint infix expressions writing the least possible > parenthesis (taking in account precedence and associativity). A > simplified expression type could be: Your use of 'have' is slightly suspicio

Re: [Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Alfonso Acosta
On 4/11/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: Your use of 'have' is slightly suspicious here. That said, the rest of your problem looks very un-homework-y, so I'll look at it. It's for my masters thesis (big piece of badly-specified homework if you want to think about it like that :)).

Re: [Haskell-cafe] Prettyprinting infix expressions with HughesPJ

2007-04-10 Thread Stefan O'Rear
On Wed, Apr 11, 2007 at 01:53:49AM +0200, Alfonso Acosta wrote: > On 4/11/07, Stefan O'Rear <[EMAIL PROTECTED]> wrote: > >Your use of 'have' is slightly suspicious here. That said, the rest > >of your problem looks very un-homework-y, so I'll look at it. > > It's for my masters thesis (big piece

[Haskell-cafe] Infix expressions (Was: Monads aren't evil)

2009-01-10 Thread Henning Thielemann
Peter Verswyvelen schrieb: > Now, for binary operators, Thomas Davie made a nice pair of combinators > on Hackage (InfixApplicative) that would allow this to become: > > h3 x = f x <^(+)^> g x http://www.haskell.org/haskellwiki/Infix_expressions ___ H