Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread David Menendez
On Sat, Jan 17, 2009 at 9:13 PM, wrote: > On Sat, 17 Jan 2009, David Menendez wrote: > >> instance Applicative f => Applicative (Backwards f) where >> pure = B . pure >> f <*> x = B (unB f <**> unB x) > > probably should be f <*> x = B (unB x <**> unB f) I always get that backwards. > anyho

[Haskell] HaskellWiki Update

2009-01-17 Thread Ashley Yakeley
There has been a lot of spam on HaskellWiki. Since anonymous edits have been switched off, a spammer tactic has been to create hundreds of accounts to evade individual account blocks. To combat this, I have 1. deleted all user accounts that have made no edits; 2. switched off account creation;

[Haskell] Hackage about to reach 1000 releases

2009-01-17 Thread Don Stewart
Hackage is about to reach the 1000 release mark, 2 years after it went live. That's right: in 2 years we've gone from having only a handful of released projects, to one thousand! Well done everyone! I did some quick visualisation of the rate of new releses, diversity of packages, and community g

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread roconnor
On Sat, 17 Jan 2009, David Menendez wrote: instance Applicative f => Applicative (Backwards f) where pure = B . pure f <*> x = B (unB f <**> unB x) probably should be f <*> x = B (unB x <**> unB f) anyhow, this should be part of Control.Applicative. This may be terminological confusio

Re: [Haskell] Re: Teach theory then Haskell as example

2009-01-17 Thread ajb
G'day all. Quoting Max Rabkin : Good to have a recommendation -- my future CT lecturer has a hard time recommending anything not written by Mac Lane. One more suggestion: "Conceptual Mathematics" by Lawvere and Schanuel is the gentlest introduction that you're going to find. Cheers, Andrew B

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread David Menendez
On Sat, Jan 17, 2009 at 7:49 PM, Jeff Wheeler wrote: > On Sat, 2009-01-17 at 17:41 -0500, David Menendez wrote: >> That's correct, but I think you'd be better off defining OpApplicative >> (or Backward, as I call it) locally and avoiding the two reverses. > > I'll have to look into this more; I do

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread Jeff Wheeler
On Sat, 2009-01-17 at 17:41 -0500, David Menendez wrote: > That's correct, but I think you'd be better off defining OpApplicative > (or Backward, as I call it) locally and avoiding the two reverses. I'll have to look into this more; I don't really understand applicatives right now, so I can't use

[Haskell] Re: [Haskell-cafe] ANNOUNCE: Coadjute 0.0.1, generic build tool

2009-01-17 Thread Don Stewart
matti.niemenmaa+news: > Announcing the release of Coadjute, version 0.0.1! > > Web site: http://iki.fi/matti.niemenmaa/coadjute/ > Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Coadjute > Here's an Arch Linux package for it, http://aur.archlinux.org/packages.php?ID=232

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread David Menendez
On Sat, Jan 17, 2009 at 4:32 PM, Jeff Wheeler wrote: > On Sat, 2009-01-17 at 21:55 +0100, Jean-Philippe Bernardy wrote: > >> I think it should admit empty, and the traversable instance should >> traverse the first list in reverse. > > I fixed the latter issue so that the behavior is correct (I thi

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread Jeff Wheeler
On Sat, 2009-01-17 at 21:55 +0100, Jean-Philippe Bernardy wrote: > I think it should admit empty, and the traversable instance should > traverse the first list in reverse. I fixed the latter issue so that the behavior is correct (I think). I tested it like this: > forM (next $ next $ fromList [

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread Jeff Wheeler
On Sat, 2009-01-17 at 10:44 -0800, Max Rabkin wrote: > This traverses the list three times (reverse, init and last are each > linear time): > fromListEnd xs = Zipper (reverse $ init xs) (last xs) [] > > But we only need to do it once: > fromListEnd xs = let x:xs' = reverse xs in Zipper xs' x [] >

Re: [Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread Max Rabkin
This traverses the list three times (reverse, init and last are each linear time): fromListEnd xs = Zipper (reverse $ init xs) (last xs) [] But we only need to do it once: fromListEnd xs = let x:xs' = reverse xs in Zipper xs' x [] I don't *think* this has an effect on strictness/laziness, since b

[Haskell] An Alternative Data.List.Zipper

2009-01-17 Thread Jeff Wheeler
Hi, (I also sent this to libraries@, but without response; I'm posting here for a wider audience.) I'm somewhat of a beginner in Haskell, so take what I say with a grain of salt, please. The ListZipper implementation seems very odd to me, and #haskell seemed to agree with me. The current package