Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set is not a Functor #276

Merged
merged 1 commit into from Feb 16, 2013

Conversation

Projects
None yet
3 participants
@larsrh
Copy link
Contributor

commented Feb 2, 2013

This commit removes the Functor instance for Set (which implies removal of MonadPlus, Traversable, ... instances).

I am not actually sure whether Set is also a reasonable Foldable, since it doesn't even have a sensible order. In Haskell, only Data.Set.Set (corresponds to immutable.TreeSet) is a Foldable. Maybe we should do the same thing.

@puffnfresh

This comment has been minimized.

Copy link
Member

commented Feb 2, 2013

👍

@larsrh

This comment has been minimized.

Copy link
Contributor Author

commented Feb 2, 2013

Is this 👍 for "instances only for TreeSet", too?

@puffnfresh

This comment has been minimized.

Copy link
Member

commented Feb 2, 2013

👎 to removing Foldable from Set. Foldable doesn't need to have a useful ordering, even if that'd be useful ;)

@S11001001

This comment has been minimized.

Copy link
Member

commented Feb 2, 2013

👍 for keeping Foldable. I think all that is required is

  1. foldMap is consistent with Foldable.FromFoldr#foldMap, and
  2. foldLeft is consistent with its default definition.
@larsrh

This comment has been minimized.

Copy link
Contributor Author

commented Feb 4, 2013

@S11001001 Sounds reasonable. I need to verify that this is the case here.

@larsrh

This comment has been minimized.

Copy link
Contributor Author

commented Feb 16, 2013

I updated the pull request to use the default implementation of foldMap. Should be all clear now.

larsrh added a commit that referenced this pull request Feb 16, 2013

@larsrh larsrh merged commit e98e06a into scalaz:scalaz-seven Feb 16, 2013

1 check passed

default The Travis build passed
Details

@larsrh larsrh deleted the larsrh:topic/set-functor branch Feb 16, 2013

@xuwei-k xuwei-k referenced this pull request Aug 28, 2013

Closed

Made MonadPlus for Set #496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.