-
Notifications
You must be signed in to change notification settings - Fork 15
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
Strange type rigidity in unlines and unwords #111
Comments
I don't see a problem with this approach, though, in classy-prelude style, it might be more idiomatic as:
@gregwebs thoughts? |
looks good |
Actually, looking at the code, there are two downsides to making this change:
So I'm less enthusiastic about making the change based on this. |
I can understand this reasoning, but I don't think that they should preclude these changes from being made. The fact that this will be a breaking change is not in-and-of-itself a reason not to do it. Maybe this means it should be delayed to the next major release, but an API break is not a good justification for not doing something IMO. As far as the performance hit goes, I'm not sure if this will even be visible. We can't really guess at the performance characteristics of code without measuring it first - and even then, it might not matter in most use cases (which we also can't necessarily know for sure). |
IME, breaking changes are a reason to not do something. Getting a tiny improvement to an API at the cost of forcing people to check for compatibility with an API, and possibly breaking some people's code, is not a good trade-off. The change here is nice, but not vital: using |
Well, could it be incorporated into a future breaking change for something less trivial? Given that neither classy-prelude nor mono-traversable are at 1.0 yet, such a change could potentially happen - would you still be opposed in such a case? |
I'm not ruling anything out, I'm simply pointing out that there's a cost to On Mon, Jan 25, 2016 at 1:06 PM, Koz Ross [email protected] wrote:
|
I guess I should make a PR to mono-traversable then? You can merge it (if you decide to do so) whenever it suits you best. |
Sounds good! On Mon, Jan 25, 2016, 5:17 PM Koz Ross [email protected] wrote:
|
I don't know if this should be in mono-traversable or not, but I figured I should report it. The type of
unlines
is reported by GHCi as:unlines :: Textual t => [t] -> t
Is there a reason for such rigidity in the collection type? Near as I can tell,
unlines
is a special fold, and thus, surely anythingFoldable
should be game for it? The same goes forunwords
- this is also basically a special fold, and thus, surely anythingFoldable
should be game?I am very new to Haskell, and don't always understand the motivations behind certain choices, so I could be completely wrong, but this type rigidity strikes me as strange, given the focus on typeclass-level behaviour of classy-prelude.
The text was updated successfully, but these errors were encountered: