snoyberg / mono-traversable

Type classes for mapping, folding, and traversing monomorphic containers
153 stars 64 forks source link

Modifying unwords and unlines to be more type-generic #87

Closed kozross closed 8 years ago

kozross commented 8 years ago

Pull request relating to this issue on classy-prelude. I went for a less generic solution than I would have preferred, but IsSequence as a constraint is both general and typesafe.

snoyberg commented 8 years ago

I don't follow, why use IsSequence instead of MonoFoldable?

kozross commented 8 years ago

I wasn't sure how to denote the type properly - I wanted to say 'a MonoFoldable full of t -> t', but wasn't sure how.

snoyberg commented 8 years ago

Just s/IsSequence/MonoFoldable, you have the right type signature AFAICT

kozross commented 8 years ago

OK, I will make a new PR momentarily.

kozross commented 8 years ago

OK, that should do it.

snoyberg commented 8 years ago

Cool, thanks!

Note for the future: this PR is a breaking change, and requires a major version bump. We should consider merging it next time we're already doing a major version bump.