[Haskell-cafe] Why does (++ "!") "bla" return "bla!" and not "!bla"?
Brandon Allbery
allbery.b at gmail.com
Fri Jun 22 07:10:15 CEST 2012
On Fri, Jun 22, 2012 at 12:54 AM, Hilco Wijbenga
<hilco.wijbenga at gmail.com>wrote:
> I think I'm close to understanding why (++ "!") "bla" returns "bla!
> instead of "!bla" but I seem to be missing the last step. :-) I
> noticed that ((++) "!") "bla" does indeed return "!bla". So it seems
> to be related to the infix property of ++? The types of (++) "!",
>
Correct; it is related to (++) being infix. Specifically, think about how
partial application would work with an *infix*, as opposed to a *prefix*,
expression. It might also help to know that the syntax there is called a
"section".
--
brandon s allbery allbery.b at gmail.com
wandering unix systems administrator (available) (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120622/db408f09/attachment.htm>
More information about the Haskell-Cafe
mailing list