Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd Char.toInt with tests #413
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Sep 28, 2015
Contributor
About getting from Char to Int: Isn't that what Char.toCode is for? (Or at the very least, you could implement your Char.toInt in Elm by using the existing Char.toCode without doing any native stuff as you do in your pull request.)
About getting from a Char to a String: It seems you have overlooked the existence of String.fromChar.
|
About getting from About getting from a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jvoigtlaender
Sep 29, 2015
Contributor
I'm closing this issue.
@bradurani, if you want to propose addition of Char.toInt, please:
- Do so via a pull request to https://github.com/zeckalpha/char-extra. This is the current standard practice of suggesting completely new stuff (rather than fixing existing stuff) for
core: collecting it into*-extralibraries first. - Try doing it without using native stuff. The existing
Char.toCodeshould enable you to implementChar.toIntin pure Elm.
Concerning "Char.toString", see my previous comment.
|
I'm closing this issue. @bradurani, if you want to propose addition of
Concerning " |
jvoigtlaender
closed this
Sep 29, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bradurani
Sep 29, 2015
Makes since. I'm getting the hang of all this. Thanks for explaining @jvoigtlaender
bradurani
commented
Sep 29, 2015
|
Makes since. I'm getting the hang of all this. Thanks for explaining @jvoigtlaender |
bradurani commentedSep 28, 2015
Adds
Char.toIntwhich seems like it should be there based on what's in the other classes. I discovered there's no easy way to map aCharsuch as'1'to theInt1. You'd think'1' |> toString |> String.toIntwould do it buttoString '1'returns"'1'"!I can't find an easy way to convert a
Charto aStringat all. I thought about adding a method for that, but I wouldn't know what to call it, sincetoStringis taken.