[Haskell-cafe] Re: map (-2) [1..5]
Jón Fairbairn
jon.fairbairn at cl.cam.ac.uk
Sat Sep 9 10:28:01 EDT 2006
Aaron Denney <wnoise at ofb.net> writes:
> We already have this great syntax, parsing semanticsi for precedence,
> and so forth for declaring infix operators. Couldn't we add to that
> slightly by declaring postfix operators as well? Actually, declaring a
> unary operator infix yielding a postfix operator doesn't seem like too
> much abuse.
Possibly not, provided they're always used as sections.
(e #) already always means "supply e as the first argument
to (#)").
> (I haven't thought this through to any great extent. How much would it
> complicate parsing? Not much, I would assume, as this fails in ghc at
> the type-checking stage.)
I don't think it would complicate mechanical parsing
unreasonably. I do think (if done without the parentheses)
it might complicate /human/ parsing unreasonably.
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html (updated 2006-09-07)
More information about the Haskell-Cafe
mailing list