Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Marshall  
View profile  
 More options Feb 15, 11:26 am
From: Chris Marshall <oxbowla...@gmail.com>
Date: Wed, 15 Feb 2012 16:26:12 +0000
Local: Wed, Feb 15 2012 11:26 am
Subject: Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

The documentation of these methods on Zipper is at odds with the
implementations. For example:

  /**
   * Deletes the element at focus and moves the focus to the right. If
there is no element on the right,
   * focus is moved to the left.
   */
  def deleteRight: Option[Zipper[A]]

OK, excellent!

scala> zipper[Int](Stream.empty, 0, Stream(1, 2, 3 ,4)) findNext (_ == 4)
res25: Option[scalaz.Zipper[Int]] = Some(<zipper>)

scala> .flatMap(_.deleteRight)
res27: Option[scalaz.Zipper[Int]] = None

Errr, what? I would expect to now be looking at this:

zipper(Stream(2, 1, 0), 3, Stream.empty)

The same holds true for deleteLeft and deleteC.

deleteRight looks like this

rights match {
    case Stream.Empty => None
    case r #:: rs     => Some(lefts match {
      case Stream.Empty => zipper(Stream.Empty, r, rs)
      case l #:: ls     => zipper(ls, l, rights)
    })
  }

But should look like this (if it is to match the docs).

rights *match {*
*        case r #:: rs     => Some(zipper(lefts, r, rs))
        case Stream.Empty => lefts match {
          case l #:: ls     => some(zipper(ls, l, Stream.empty))
          case Stream.Empty => None
        }
      }*

This seems broken in the scalaz-seven branch also

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Runar Bjarnason  
View profile  
 More options Feb 15, 12:51 pm
From: Runar Bjarnason <runaror...@gmail.com>
Date: Wed, 15 Feb 2012 12:51:43 -0500
Local: Wed, Feb 15 2012 12:51 pm
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)
That does indeed look inconsistent. Can you send a pull request?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 15, 12:57 pm
From: Chris Marshall <oxbowla...@gmail.com>
Date: Wed, 15 Feb 2012 17:57:41 +0000
Local: Wed, Feb 15 2012 12:57 pm
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I'll see what I can get done this weekend; I'm a complete beginner to SBT
and GIT though, so it will be fun!

Chris

On Wed, Feb 15, 2012 at 5:51 PM, Runar Bjarnason <runaror...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 25, 11:14 am
From: Chris Marshall <oxbowla...@gmail.com>
Date: Sat, 25 Feb 2012 16:14:56 +0000
Local: Sat, Feb 25 2012 11:14 am
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I'm a bit stuck. I've made the code changes locally and I'm trying to
initiate a pull-request. Except git tells me "Oops, there's already a pull
request from "oxbowlakes:master", which indeed there is [1]. It asks me if
I want to update the commit range, which presumably I do, but offers no
help on what range I might wish to choose or even what a commit range is.

Can I "park" the original pull-request and create a new one with just the
latest changes? If so, how?

Chris

[1] https://github.com/scalaz/scalaz/pull/29

On Wed, Feb 15, 2012 at 5:57 PM, Chris Marshall <oxbowla...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Zaugg  
View profile  
 More options Feb 25, 11:29 am
From: Jason Zaugg <jza...@gmail.com>
Date: Sat, 25 Feb 2012 17:29:25 +0100
Local: Sat, Feb 25 2012 11:29 am
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

On Sat, Feb 25, 2012 at 5:14 PM, Chris Marshall <oxbowla...@gmail.com> wrote:
> I'm a bit stuck. I've made the code changes locally and I'm trying to
> initiate a pull-request. Except git tells me "Oops, there's already a pull
> request from "oxbowlakes:master", which indeed there is [1]. It asks me if I
> want to update the commit range, which presumably I do, but offers no help
> on what range I might wish to choose or even what a commit range is.

> Can I "park" the original pull-request and create a new one with just the
> latest changes? If so, how?

Make a branch dedicated to each pull request.

-jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 25, 11:36 am
From: Chris Marshall <oxbowla...@gmail.com>
Date: Sat, 25 Feb 2012 16:36:55 +0000
Local: Sat, Feb 25 2012 11:36 am
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I'd appreciate if you could walk me through this as it's exactly what I
tried to do. I created a branch called fixzipper and committed my changes
to it. But then I couldn't navigate to this branch on the website; so I had
to merge back into master and push the changes in order to try and get a
pull request.

So, if I create a new branch fixzipper2:

git checkout -b fixzipper

What do I do now?

Chris

These suggestions (
http://stackoverflow.com/questions/5256021/submitting-github-pull-req...)
just leave me with errors as well.

Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 25, 11:41 am
From: Chris Marshall <oxbowla...@gmail.com>
Date: Sat, 25 Feb 2012 16:41:34 +0000
Local: Sat, Feb 25 2012 11:41 am
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I guess I want to understand *exactly* how I do this:

  "pushed three commits to a topic branch in his fork"

What does this mean? I have a local branch (on my machine) with the
relevant changes. How do I get this branch pushed to the origin?

Chris

On Sat, Feb 25, 2012 at 4:36 PM, Chris Marshall <oxbowla...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 25, 11:49 am
From: Chris Marshall <oxbowla...@gmail.com>
Date: Sat, 25 Feb 2012 16:49:23 +0000
Local: Sat, Feb 25 2012 11:49 am
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I've probably ballsed this up massively. I now have a pull request here (
https://github.com/scalaz/scalaz/pull/76) and it contains 4 commits. Only
the last two are applicable to the fix at hand (they are clearly labelled).
Is it possible for you guys to selectively pull in only the pertinent
commits?

Apologies for cretinousness

Chris

On Sat, Feb 25, 2012 at 4:41 PM, Chris Marshall <oxbowla...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Marshall  
View profile  
 More options Feb 25, 12:17 pm
From: Chris Marshall <oxbowla...@gmail.com>
Date: Sat, 25 Feb 2012 17:17:34 +0000
Local: Sat, Feb 25 2012 12:17 pm
Subject: Re: [scalaz] Zipper deleteLeft, deleteRight and deleteC do not do what the docs say they do (and look broken)

I've added an extra commit which adds a bunch of tests to ZipperSpec
covering this functionality

Chris

On Sat, Feb 25, 2012 at 4:49 PM, Chris Marshall <oxbowla...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »