Add newtype Salign#104
Closed
chris-martin wants to merge 1 commit intohaskellari:masterfrom
Closed
Conversation
Collaborator
|
Note that it's a Monoid too.
I'd also like those instances http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Monoid.html#t:Ap
…Sent from my iPhone
On 12 Feb 2019, at 2.39, Chris Martin ***@***.***> wrote:
I've always been frustrated that base has ZipList in Control.Applicative that can give you a list-zipping Applicative, but no corresponding newtype in Data.Semigroup that would give you a list-zipping Semigroup.
This seems like it could be a nice place to put (a more general version of) such a thing -- a Salign type right next to the salign function. I think it'd be very nice to use in conjunction with DerivingVia to define types with aligning semigroups.
You can view, comment on, or merge this pull request online at:
#104
Commit Summary
Add newtype Salign
File Changes
M Data/Align.hs (8)
M test/Tests.hs (7)
Patch Links:
https://github.com/isomorphism/these/pull/104.patch
https://github.com/isomorphism/these/pull/104.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Contributor
Author
|
Added the You want |
Collaborator
|
I'd leave Applicative and subclasses, but have everything else Functor/Foldable/Traversable
…Sent from my iPhone
On 12 Feb 2019, at 3.05, Chris Martin ***@***.***> wrote:
Added the Monoid instance.
You want Salign to have instances of all these? Alternative, Applicative, Enum, Eq, Functor, Generic, Generic1, Monad, MonadFail, MonadPlus, Ord, Read, Show
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've always been frustrated that
basehasZipListinControl.Applicativethat can give you a list-zippingApplicative, but no corresponding newtype inData.Semigroupthat would give you a list-zippingSemigroup.This seems like it could be a nice place to put (a more general version of) such a thing -- a
Saligntype right next to thesalignfunction. I think it'd be very nice to use in conjunction withDerivingViato define types with aligning semigroups.