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
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
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 :)).
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
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
?
>
> 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
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
> 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
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