[snip]
Not a hack, a solution. A consistent one. Look:
(`foldl` 0)
(`-` 2)
Don't they look exactly the same?
[snip]
These look the same too (and *are* consistent):
(f a b)
(+ a b)
But it's not Haskell..
IMO conflating binary minus and unary minus is not consistent.
Something I wonder
Something I wonder from time to time if it would be a good thing or
not is to allow
a `f g` b
to mean
f g a b
You don't have to wonder:
http://www.haskell.org/haskellwiki/Infix_expressions
Granted, you have to use different characters rather than the
backquote. On the other
Jason Dagit dagit at codersbase.com writes:
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness will_n48 at yahoo.com wrote:
You think of functions, where domain matters (for purists?). In syntax
only the result matter, does it read? Does it have an intended meaning?
How is it a mistake if it
It's worth remembering that APL and SML, amongst others,
distinguish between the sign used for a negative literal
(¯1 in APL, ~1 in SML) and the sign used for subtraction
(the hyphen/minus in both of them). It doesn't seem to
be a hard thing to get your head around in practice.
From having
minh thu wrote:
Something I wonder from time to time if it would be a good thing or
not is to allow
a `f g` b
to mean
f g a b
This comes up from time to time, though it is often met with stern
disapproval because it can easily lead to loss of clarity. There is a
valid alternative, though
wren ng thornton wren at freegeek.org writes:
Will Ness wrote:
(`foldl`2) works.
(`-`2) should too.
The `` syntax is for converting lexical identifiers into infix
operators. Symbolic identifiers are already infix, which is why ``
So it would be a no-op then. Why make it
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_...@yahoo.com wrote:
This syntax already exists. The '`' symbol is non-collating already, so using
it for symbol chars doesn't change anything (it's not that it can be a part of
some name, right?). To turn an infix op into an infix op is an id
Tom Tobin korpios at korpios.com writes:
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com wrote:
This syntax already exists. The '`' symbol is non-collating already, so
using it for symbol chars doesn't change anything (it's not that it
can be a part of some name,
Will Ness wrote:
wren ng thornton writes:
Attack the underlying problem, don't introduce hacks to cover up broken
hacks. This isn't C++.
The underlying problem is a broken scanner where it can't distinguish between a
binary op and a number read syntax.
The underlying problem is that (1)
On Mon, Oct 19, 2009 at 5:53 PM, Will Ness will_...@yahoo.com wrote:
Tom Tobin korpios at korpios.com writes:
On Mon, Oct 19, 2009 at 5:34 PM, Will Ness will_n48 at yahoo.com
wrote:
This syntax already exists. The '`' symbol is non-collating already, so
using it for symbol chars
On Sun, Oct 18, 2009 at 5:31 PM, Will Ness will_...@yahoo.com wrote:
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I think at about this point, this stopped being an intellectual
discussion.
Gregory Propf gregorypropf at yahoo.com writes:
I actually meant it as sort of a joke but maybe it's not after all.
Seriously though, using anything non-ASCII in source code is a bad idea,
because there are lots of fonts and editors in the world.
It seems natural to me to have (`-`2)
On Sun, Oct 18, 2009 at 4:47 PM, Will Ness will_...@yahoo.com wrote:
Gregory Propf gregorypropf at yahoo.com writes:
I actually meant it as sort of a joke but maybe it's not after all.
Seriously though, using anything non-ASCII in source code is a bad idea,
because there are lots of fonts
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I don't think syntax sugar is worth it in this case.
I do. Operators are great because they make our intent visible, immediately
apparent. Long
Will Ness wrote:
Luke Palmer lrpalmer at gmail.com writes:
Or you could use the subtract function.
map (subtract 2) [3,4,5]
[1,2,3]
I don't want to.
I don't think syntax sugar is worth it in this case.
I do. Operators are great because they make our intent visible, immediately
Gregory Propf gregorypr...@yahoo.com writes:
Heh, perhaps we should petition to have a new computer key and symbol
added to the world's way of writing maths, something like maybe a
downward angled slash to mean prefix (-)
Or just use 'negate' and 'subtract'?
-k
--
If I haven't seen
Ketil Malde ke...@malde.org writes:
Gregory Propf gregorypr...@yahoo.com writes:
Heh, perhaps we should petition to have a new computer key and symbol
added to the world's way of writing maths, something like maybe a
downward angled slash to mean prefix (-)
Or just use 'negate' and
On 18 Sep 2009, at 04:32, Gregory Propf wrote:
Heh, perhaps we should petition to have a new computer key and
symbol added to the world's way of writing maths, something like
maybe a downward angled slash to mean prefix (-)
Such a symbol already exists, but isn't in the ASCII set:
(-)
:
From: Jon Fairbairn jon.fairba...@cl.cam.ac.uk
Subject: [Haskell-cafe] Re: [Haskell-beginners] map question
To: haskell-cafe@haskell.org
Date: Friday, September 18, 2009, 2:09 AM
Ketil Malde ke...@malde.org writes:
Gregory Propf gregorypr...@yahoo.com writes:
Heh, perhaps we should petition
Remember that there is asymmetry between (+) and (-). The former has the
commutative property and the latter does not so:
(+) 3 4 = 7
and
(+) 4 3 = 7
but
(-) 3 4 = -1
and
(-) 4 3 = 1
--- On Thu, 9/17/09, Tom Doris tomdo...@gmail.com wrote:
From: Tom Doris tomdo...@gmail.com
Subject:
(-) happens to be the only prefix operator in haskell, it also an infix
operator.
so:
4 - 2
2
-3
-3
((-) 5) 3 -- note that in this case (-) is treated like any regular
function so 5 is the first parameter
2
(5 - ) 3
2
(-5 )
-5
(flip (-) 5) 3
-2
It's a little wart brought about by the
2009/9/17 Joost Kremers joostkrem...@fastmail.fm
Hi all,
I've just started learning Haskell and while experimenting with map a bit, I
ran
into something I don't understand. The following commands do what I'd expect:
Prelude map (+ 1) [1,2,3,4]
[2,3,4,5]
Prelude map (* 2) [1,2,3,4]
: [Haskell-cafe] Re: [Haskell-beginners] map question
To: Gregory Propf gregorypr...@yahoo.com
Cc: Tom Doris tomdo...@gmail.com, Haskell-Cafe
haskell-cafe@haskell.org, joostkrem...@fastmail.fm
Date: Thursday, September 17, 2009, 9:04 AM
(-) happens to be the only prefix operator in haskell, it also
23 matches
Mail list logo