Foldable1 instance#27
Conversation
|
I think this is a breaking change unfortunately, so will have to wait a little bit (as it imposes |
b66f2da to
81571f6
Compare
|
I've amended the PR to be non-breaking, by simply reusing the previous implementations. It's nicer to have the looser constraint anyway, no? |
| traverseWithIndex f (a :| fa) = | ||
| NonEmpty <$> f Nothing a <*> traverseWithIndex (f <<< Just) fa | ||
|
|
||
| instance foldable1NonEmpty :: Foldable f => SF.Foldable1 (NonEmpty f) where |
There was a problem hiding this comment.
San Francisco?
I was thinking _S_emigroup._F_oldable. But yeah, it's crappy. I changed it to F1.
81571f6 to
551a7eb
Compare
|
Looks good, but this is still potentially breaking if you were relying on the monomorphic signatures for type inference. |
Good point. Perhaps the right solution is to export monomorphic versions of the instance functions? |
|
That sounds good to me. |
551a7eb to
651d3b4
Compare
|
Done. This is now non-breaking. Ready for review. |
convert fold1 and foldMap1 to instance methods
Solves #26