Skip to content

Uppercase/lowercase on Char, tests, and more#41

Merged
garyb merged 2 commits intopurescript:masterfrom
LiamGoodacre:master
Aug 2, 2015
Merged

Uppercase/lowercase on Char, tests, and more#41
garyb merged 2 commits intopurescript:masterfrom
LiamGoodacre:master

Conversation

@LiamGoodacre
Copy link
Copy Markdown
Member

Added

  • Data.Char.toUpperChar :: Char -> Char
  • Data.Char.toLowerChar :: Char -> Char

Removed

  • Data.Char.showChar :: Show Char
    • collided with showChar defined in the prelude?

Is this okay?

docs/Data.String.md changed when I generated the docs, someone didn't regenerate them last time I guess?

Added

* `Data.Char.toUpperChar :: Char -> Char`
* `Data.Char.toLowerChar :: Char -> Char`

Removed

* `Data.Char.showChar :: Show Char`
  - collided with `showChar` defined in the prelude?
@LiamGoodacre
Copy link
Copy Markdown
Member Author

Removing showChar seemed to be the only way I could get it to run in psci.

@garyb
Copy link
Copy Markdown
Member

garyb commented Jul 16, 2015

How about just toUpper/toLower for these?

@LiamGoodacre
Copy link
Copy Markdown
Member Author

Originally I went with toUpper and toLower, however those names are also defined in Data.String. I thought that would be a bit strange to export things with the same name from different parts of the same module.

However, I am happy to rename if you're okay with that 😃

Testing
--

* Added `test/` directory.
* Added `pulp test` to the `build` script.
* New dev dependencies `purescript-assert` and `purescript-console`

Breaking changes
--

* `Data.String.Regex.search` now gives back `Maybe Int`.
    * `Nothing` for no match instead of `-1`.
* `Data.Char.toUpperChar` is now `Data.Char.toUpper`.
* `Data.Char.toLowerChar` is now `Data.Char.toLower`.

Bug fixes
--

* `Data.String.indexOf'` wrong for index out of bounds.
* `Data.String.lastIndexOf'` wrong for index out of bounds.
* `Data.String.localeCompare` off by 1.

Notes
--

The vast majority of functions have at least one test case.

Lots of room for more though, especially in `Data.String.Regex`!

Tests could also be added for checking that the unsafe functions throw in the documented ways.
@LiamGoodacre LiamGoodacre changed the title Uppercase/lowercase on Char Uppercase/lowercase on Char, tests, and more Jul 18, 2015
@LiamGoodacre
Copy link
Copy Markdown
Member Author

@paf31, @garyb; Does this all look okay?

@garyb
Copy link
Copy Markdown
Member

garyb commented Jul 18, 2015

Looks great to me 👍

@garyb
Copy link
Copy Markdown
Member

garyb commented Jul 22, 2015

I've not merged this yet, as doing so will potentially unleash chaos when we bump the version 😄

I have a tool that I need to finish up that will allow us to bump all the dependencies together, once that's working I'll merge/release this. And thanks!

@garyb
Copy link
Copy Markdown
Member

garyb commented Jul 22, 2015

It's not too heavily depended-on actually, but even still, I'd rather use the tool to do it:

  • purescript-enums
  • purescript-strongcheck
  • purescript-base
  • purescript-datetime
  • purescript-quickcheck
  • purescript-maps
  • purescript-argonaut-core
  • purescript-argonaut-codecs
  • purescript-argonaut-traversals
  • purescript-argonaut
  • purescript-sets
  • purescript-graphs

garyb added a commit that referenced this pull request Aug 2, 2015
Uppercase/lowercase on Char, tests, and more
@garyb garyb merged commit 24a912f into purescript:master Aug 2, 2015
@garyb
Copy link
Copy Markdown
Member

garyb commented Aug 2, 2015

Thanks for your work on this, sorry it took so long to get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants