-
Notifications
You must be signed in to change notification settings - Fork 157
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
Capitalize first letter of a string #409
Comments
I don’t have a strong opinion. How often do you need such routine in practice (excluding educational purposes)? |
Could you say more about what is bad about the docs for |
Not often at all, honestly. I needed that function when I wrote small console program that prints sentences (error messages/progress statuses) with dynamically-generated parts and that sentences should begin with the capital letter. But I often encountered the situations when I needed the function for educational purposes (doing exercises and so on). Yes, it's niche and may be not so important, but I remember that I thought "Hm... other languages have such a simple function, sad." If we'll be able to ease learning process for newcomers it will be the main value of that contribution. Haskell ecosystem is rather foreign for newcomers, making it more similar to other ecosystems (if it doesn't compromise on basic Haskell principles) is worth it.
Docs for |
I think it would be better to extend documentation, explaining how to implement some version of |
I am quite surprised by the absence of the common function to capitalize the first letter of a string. Yes, we have
toTitle
but its behaviour is different to what we have in other languages. Moreover, docs haven't any hints on that topic. Should a library user implement such method himself? If it is not implemented yet then what problems have this approach?For example, Scala implements the method as following:
Kotlin developers decided that method has non-reliable behaviour in different circumstances, so they deprecated similar method and instead introduced more flexible alternative
replaceFirstChar
that delegates choosing the type of conversion to user:We could have something like that in
text
library. It will help Haskell learners with the knowledge of other languages to adapt to Haskell more quickly.The text was updated successfully, but these errors were encountered: