Merijn Verstraaten | 10 Oct 18:04 2012
Picon

Foldable & Traversable instances for ((,) a)

I noticed (to my great dismay!) that ((,) a) doesn't appear to have Foldable or Traversable instance
anywhere, even though it is an (almost trivial) instance of both:

instance Foldable ((,) a) where
    foldMap f (_, x) = f x

instance Traversable ((,) a) where
    traverse f (a, x) = (,) a <$> f x

I guess the most appropriate place for either would be Data.Tuple of Data.Foldable and Data.Traversable respectively.

Kind regards,
Merijn Verstraaten
Edward Kmett | 10 Oct 20:32 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

This came up last year, and again recently. The consensus came through to add them, and recently I believe I was nominated to put together a patch. 


I've just not been able to abrogate my other responsibilities long enough to break my build environment and set up a copy of HEAD and concoct a patch. ;)

The instances really have to live in Data.Foldable and Data.Traversable with the Foldable and Traversable classes otherwise you get messy orphan issues.

-Edward

On Wed, Oct 10, 2012 at 12:04 PM, Merijn Verstraaten <merijn <at> inconsistent.nl> wrote:
I noticed (to my great dismay!) that ((,) a) doesn't appear to have Foldable or Traversable instance anywhere, even though it is an (almost trivial) instance of both:

instance Foldable ((,) a) where
    foldMap f (_, x) = f x

instance Traversable ((,) a) where
    traverse f (a, x) = (,) a <$> f x

I guess the most appropriate place for either would be Data.Tuple of Data.Foldable and Data.Traversable respectively.

Kind regards,
Merijn Verstraaten
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Ben Millwood | 10 Oct 22:54 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

On Wed, Oct 10, 2012 at 7:32 PM, Edward Kmett <ekmett <at> gmail.com> wrote:
> I've just not been able to abrogate my other responsibilities long enough to
> break my build environment and set up a copy of HEAD and concoct a patch. ;)

I just tried to clone a copy of the base repo to see if I could be of
any help, but it doesn't work for me:

[ben <at> euler ~/haskell/upstreams/emptydir]$ git clone
http://darcs.haskell.org/packages/base.git
Cloning into 'base'...

[ben <at> euler ~/haskell/upstreams/emptydir]$ ls -l
total 0

I had a chat with the guys in #git , excerpts from
http://colabti.org/irclogger/irclogger_log/git?date=2012-10-10#l3186 :

21:40:43 < cmn> it looks like it only supports the dumb protocol
21:41:01 < cmn> so that should get fixed, it could be that it's broken in
                newer git versions, because nobody sensible sets that up
                anymore
21:44:11 < benmachine> cmn: ah. so there's a bug but no-one notices because
                       no-one uses it these days?
21:44:56 < cmn> benmachine: that's what I'm thinking, yeah
21:45:19 < benmachine> cmn: ok. out of interest, how did you check which
                       protocol it was using?
21:45:29 < cmn> benmachine: wireshark
21:49:39 < benmachine> cmn: one more thing, is "the dumb protocol" literally
                       its name, or is it just a protocol that's dumb?
21:50:04 < cmn> its full name is dumb http transport

Looks like someone at darcs.haskell.org needs to change how things are set up?
Tyson Whitehead | 10 Oct 23:29 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

On October 10, 2012 16:54:03 Ben Millwood wrote:
> I just tried to clone a copy of the base repo to see if I could be of
> any help, but it doesn't work for me:
> 
> [ben <at> euler ~/haskell/upstreams/emptydir]$ git clone
> http://darcs.haskell.org/packages/base.git
> Cloning into 'base'...
> 
> [ben <at> euler ~/haskell/upstreams/emptydir]$ ls -l
> total 0

Perhaps someone has already fixed it, but it seems to be working for me.

$ git clone http://darcs.haskell.org/packages/base.git
Cloning into 'base'...
$ ls base/
aclocal.m4         base.cabal  codepages     config.sub    Control  Debug    
Foreign.hs  include     LICENSE         NHC         Prelude.hs    Setup.hs  
tests  Unsafe
base.buildinfo.in  cbits       config.guess  configure.ac  Data     Foreign  GHC         
install-sh  Makefile.nhc98  Numeric.hs  prologue.txt  System    Text

Might it also just be that your aren't getting a default branch checked out.

Is there a '.git' subdirectory?  Is there a bunch files under '.git/objects'?  
What do you get if you switch into the directory and run 'git branch -r'?

$ cd base
$ git branch -r
  origin/HEAD -> origin/master
  origin/encoding
  origin/ghc-7.2
  origin/ghc-7.4
  origin/ghc-7.6
  origin/imp-param-class
  origin/master
  origin/monad-comp
  origin/new-typeable

Cheers!  -Tyson
Roman Cheplyaka | 10 Oct 23:43 2012

git problems

Works here as well. Could it be a bug in Ben's version of git?
FWIW, mine is 1.7.10.4, packaged by Debian.

Roman

* Tyson Whitehead <twhitehead <at> gmail.com> [2012-10-10 17:29:17-0400]
> On October 10, 2012 16:54:03 Ben Millwood wrote:
> > I just tried to clone a copy of the base repo to see if I could be of
> > any help, but it doesn't work for me:
> > 
> > [ben <at> euler ~/haskell/upstreams/emptydir]$ git clone
> > http://darcs.haskell.org/packages/base.git
> > Cloning into 'base'...
> > 
> > [ben <at> euler ~/haskell/upstreams/emptydir]$ ls -l
> > total 0
> 
> Perhaps someone has already fixed it, but it seems to be working for me.
> 
> $ git clone http://darcs.haskell.org/packages/base.git
> Cloning into 'base'...
> $ ls base/
> aclocal.m4         base.cabal  codepages     config.sub    Control  Debug    
> Foreign.hs  include     LICENSE         NHC         Prelude.hs    Setup.hs  
> tests  Unsafe
> base.buildinfo.in  cbits       config.guess  configure.ac  Data     Foreign  GHC         
> install-sh  Makefile.nhc98  Numeric.hs  prologue.txt  System    Text
> 
> Might it also just be that your aren't getting a default branch checked out.
> 
> Is there a '.git' subdirectory?  Is there a bunch files under '.git/objects'?  
> What do you get if you switch into the directory and run 'git branch -r'?
> 
> $ cd base
> $ git branch -r
>   origin/HEAD -> origin/master
>   origin/encoding
>   origin/ghc-7.2
>   origin/ghc-7.4
>   origin/ghc-7.6
>   origin/imp-param-class
>   origin/master
>   origin/monad-comp
>   origin/new-typeable
> 
> Cheers!  -Tyson
> 
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
Ben Millwood | 11 Oct 18:00 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

On Wed, Oct 10, 2012 at 10:29 PM, Tyson Whitehead <twhitehead <at> gmail.com> wrote:
> Is there a '.git' subdirectory?  Is there a bunch files under '.git/objects'?
> What do you get if you switch into the directory and run 'git branch -r'?

No and no - ls -al reports nothing. No 'base' directory is ever
created, so I can't apply any git commands to it. Curiously, git
ls-remote does seem to work, but git clone fetches nothing and does
nothing.

I think whether or not it works may depend on your git version. Mine's 1.7.12.2.
Brandon Allbery | 11 Oct 18:07 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

On Thu, Oct 11, 2012 at 12:00 PM, Ben Millwood <haskell <at> benmachine.co.uk> wrote:
On Wed, Oct 10, 2012 at 10:29 PM, Tyson Whitehead <twhitehead <at> gmail.com> wrote:
> Is there a '.git' subdirectory?  Is there a bunch files under '.git/objects'?
> What do you get if you switch into the directory and run 'git branch -r'?

No and no - ls -al reports nothing. No 'base' directory is ever
created, so I can't apply any git commands to it. Curiously, git
ls-remote does seem to work, but git clone fetches nothing and does
nothing.

I think whether or not it works may depend on your git version. Mine's 1.7.12.2.

For what its worth, I'm using git 1.7.12.3 from MacPorts, and I get an empty directory and a system popup indicating that git-http-remote has crashed.  My shell then reports exit status 128 from git. 

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix/linux, openafs, kerberos, infrastructure          http://sinenomine.net

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Tyson Whitehead | 16 Oct 04:10 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

On Thu, 2012-10-11 at 12:07 -0400, Brandon Allbery wrote:
> On Thu, Oct 11, 2012 at 12:00 PM, Ben Millwood
> <haskell <at> benmachine.co.uk> wrote:
>
>         I think whether or not it works may depend on your git
>         version. Mine's 1.7.12.2.
> 
> 
> For what its worth, I'm using git 1.7.12.3 from MacPorts, and I get an
> empty directory and a system popup indicating that git-http-remote has
> crashed.  My shell then reports exit status 128 from git. 

To add another works for me data point here -- git 1.7.10 under Debian.

From the reports so far, it does sounds very much like a version thing.

Cheers!  -Tyson
Herbert Valerio Riedel | 13 Oct 12:10 2012
Picon

Re: Foldable & Traversable instances for ((,) a)

Ben Millwood <haskell <at> benmachine.co.uk> writes:

> On Wed, Oct 10, 2012 at 10:29 PM, Tyson Whitehead <twhitehead <at> gmail.com> wrote:
>> Is there a '.git' subdirectory?  Is there a bunch files under '.git/objects'?
>> What do you get if you switch into the directory and run 'git branch -r'?
>
> No and no - ls -al reports nothing. No 'base' directory is ever
> created, so I can't apply any git commands to it.

actually, it might have been created and got removed again when 'git
clone' failed... this happens for instance when the 'git-remote-http'
process dies abruptly (maybe some network error occured during the HTTP
transfer which confused git-remote-http and caused it to bailout?)

Gmane