<div class="gmail_quote">On 24 December 2010 23:58, Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Saturday 25 December 2010 00:32:38, Aaron Gray wrote:<br>
> Okay great, works this end too, but what does the 'flip' do ???<br>
<br>
</div>It flips the order of arguments to calc. You could also write<br>
<br>
main = getContents >>= print . (`calc` []) . lexer<br>
<br>
Generally,<br>
<br>
flip f = \x y -> f y x<br>
<br>
or<br>
<br>
flip f x = \y -> f y x<br>
<br>
flip f x y = f y x<br>
</blockquote></div><br><div>Or :-</div><div><br></div><div><div> calcExpr :: [Token] -> Int</div><div> calcExpr tokens = calc tokens []</div><div><br></div><div> process = print . calcExpr . lexer</div><div><br>
</div></div><div>makes things clearer.</div><div><br></div><div>Aaron</div><div><br></div>