Excerpts from Albert Y.C.Lai's message of Mon Jun 28 15:44:34 -0400 2010:
I propose that at each minor version of base, someone picks an implementation
randomly.
This has actually been done, in a legitimate language implementation.
Check out:
On Mon, Jun 28, 2010 at 07:44:34PM +, Albert Y.C.Lai wrote:
I propose that at each minor version of base, someone picks an implementation
randomly.
Here is a more radical, less labour-intensive solution, if you don't mind a
judicious, correctness-preserving use of unsafePerformIO: at the
Maybe it is because deleteBy is defined wrongly? i.e. it is not logical,
doesn't follow the common sense user might expect. It accepts any predicate
but narrows requirements only in docs.
Maybe best could be to just take a value for comparison and use == against
it? (overloaded or built-in (I'm
On Tuesday 29 June 2010 10:47:40, Zura_ wrote:
Maybe it is because deleteBy is defined wrongly? i.e. it is not logical,
doesn't follow the common sense user might expect. It accepts any
predicate but narrows requirements only in docs.
Unfortunately, you can't easily encode the requirement that
Daniel Fischer daniel.is.fisc...@web.de writes:
Maybe it is because deleteBy is defined wrongly? i.e. it is not logical,
doesn't follow the common sense user might expect. It accepts any
predicate but narrows requirements only in docs.
Unfortunately, you can't easily encode the requirement
On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde ke...@malde.org wrote:
deleteBy :: (a - Bool) - [a] - [a]
I don't think there would be any doubt what 'deleteBy (= 5) [1..10]'
would do. And I just don't see what the requirement for an equivalence
relation buys you.
Your deleteBy is (filter .
On Tuesday 29 June 2010 11:46:47, Ketil Malde wrote:
An important point of a powerful type system is to model your program so
that only sensible code is legal.
That would be an awesomely powerful type system :)
This makes me wonder why deleteBy is
defined so loosely, instead of e.g.
Max Rabkin max.rab...@gmail.com writes:
On Tue, Jun 29, 2010 at 11:46 AM, Ketil Malde ke...@malde.org wrote:
deleteBy :: (a - Bool) - [a] - [a]
I don't think there would be any doubt what 'deleteBy (= 5) [1..10]'
would do. And I just don't see what the requirement for an equivalence
Max Rabkin max.rab...@gmail.com writes:
Your deleteBy is (filter . not), isn't it?
With the caveat that I haven't actually used it, my impression is that
delete only removes one element, while filter removes all of them.
-k
--
If I haven't seen further, it is by standing in the footprints of
Ketil Malde ke...@malde.org writes:
Max Rabkin max.rab...@gmail.com writes:
Your deleteBy is (filter . not), isn't it?
With the caveat that I haven't actually used it, my impression is that
delete only removes one element, while filter removes all of them.
At most one element, yes; I
Daniel Fischer daniel.is.fisc...@web.de writes:
An important point of a powerful type system is to model your program so
that only sensible code is legal.
That would be an awesomely powerful type system :)
Heh. But while we're waiting for it, we can try to use what we got to
eliminate as
On Tuesday 29 June 2010 12:46:21, Ivan Lazar Miljenovic wrote:
At most one element, yes; I question why that design decision was made
as I'm more likely to want to delete all values rather than just the
first one
That's more common, yes (I don't remember ever having used delete(By)
Daniel Fischer daniel.is.fisc...@web.de writes:
That's more common, yes (I don't remember ever having used delete(By)
intentionally). But we've filter for that, so it wouldn't make sense to
give delete(By) the same semantics. Hence, if you provide both names, what
else could deleteBy do?
On Tuesday 29 June 2010 12:50:34, Ketil Malde wrote:
Daniel Fischer daniel.is.fisc...@web.de writes:
An important point of a powerful type system is to model your program
so that only sensible code is legal.
That would be an awesomely powerful type system :)
Heh. But while we're
On Tuesday 29 June 2010 13:02:20, Ivan Lazar Miljenovic wrote:
That's like asking why we have mapM and forM, etc.
Yes, why?
(okay, I use forM too, it's so much more readable with a short list and a
long action)
___
Haskell-Cafe mailing list
Daniel Fischer daniel.is.fisc...@web.de writes:
On Tuesday 29 June 2010 13:02:20, Ivan Lazar Miljenovic wrote:
That's like asking why we have mapM and forM, etc.
Yes, why?
(okay, I use forM too, it's so much more readable with a short list and a
long action)
Exactly; using deleteBy p
Some docs are in a miserable state of being incomplete.
And then some programmers are in a miserable state of not respecting docs
when the docs are complete.
Why should anyone expect
deleteBy (=) 5 [0..10]
to accomplish anything meaningful, if he/she respects the written docs?
Today someone
On Mon, Jun 28, 2010 at 1:44 PM, Albert Y.C.Lai tre...@vex.net wrote:
Why should anyone expect
deleteBy (=) 5 [0..10]
to accomplish anything meaningful, if he/she respects the written docs?
I proposed the following solution:
http://lukepalmer.wordpress.com/2009/07/01/on-the-by-functions/
In the case of 'deleteBy' we can improve an API.
deleteBy eq x xs == deletePred (eq x) xs
@deletePred pred xs@ removes the first element of @xs@ which satisfies a
predicate @p...@.
Your solution is more general. :)
On 28.06.10 22:44, Albert Y.C.Lai wrote:
And then some programmers are in a
On Jun 28, 2010, at 2:29 PM, Luke Palmer wrote:
I proposed the following solution:
http://lukepalmer.wordpress.com/2009/07/01/on-the-by-functions/
Seconded! I always want xxxOn and I almost never (perhaps never*) want xxxBy
for xxx in sort, maximum, group and nub.
- Mark
(*) A
Albert Y.C.Lai tre...@vex.net writes:
The doc of deleteBy states: The deleteBy function behaves like delete, but
takes a user-supplied equality predicate. A precondition is that the
user-supplied predicate is an equality predicate. (=) is not an equality
predicate, be it in the layperson
21 matches
Mail list logo