Skip to content

fix some export problems from Data.String #42

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

Closed

Conversation

CarstenKoenig
Copy link
Contributor

Data.String don't export singleton : Char -> ... and charAt anymore but it's in Data.String.CodeUnits

using these changes the package builds for me

@michaelficarra
Copy link

The usage of charAt here is actually a bug. JSON is defined in terms of Unicode code points. Fixing this should be as easy as replacing the call to charAt with a call to codePointAt.

@CarstenKoenig
Copy link
Contributor Author

@michaelficarra like this (see the last commit bda7979)?

test are all passing (see next comment) but I'm not sure if you want to drop the DecodeJson Char instance - or if you want to keep the EncodeJson Char one

@CarstenKoenig
Copy link
Contributor Author

CarstenKoenig commented May 29, 2018

remark right now when I try this, I get an error from purescript-strongcheck at this point: https://github.com/purescript-contrib/purescript-strongcheck/blob/compiler/0.12/src/Test/StrongCheck.purs#L80

(filed an issue here: purescript-deprecated/purescript-strongcheck#51)


also travis seem to fail because it's not using purs 0.12

@CarstenKoenig
Copy link
Contributor Author

latest commit should make travis use purs 0.12 - of course it still fails because of the issues with purescript-strongcheck

Copy link

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

@@ -12,7 +12,8 @@ import Data.Int (fromNumber)
import Data.List (List(..), (:), fromFoldable)
import Data.Map as M
import Data.Maybe (maybe, Maybe(..))
import Data.String (charAt)
import Data.String (CodePoint)
import Data.String.CodePoints (codePointAt)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not exported by Data.String?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that's possible - I recheck and change (my tooling got broken, so I don't see the warnings right now)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just changed this one minute ago :D

install:
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume this is just temporary until we can bump the dependency in package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - I'm not sure if I should include this at all - but it should fix the travis build/test for now (once the strongcheck issue got fixed upstream)

encodeJson = encodeJson <<< singleton

instance encodeJsonChar :: EncodeJson Char where
encodeJson = encodeJson <<< codePointFromChar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use the CodeUnit singleton here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks - gonna change this

@kritzcreek kritzcreek mentioned this pull request Jun 4, 2018
@kritzcreek
Copy link
Contributor

Thanks! I cherry picked your changes in #43

@CarstenKoenig
Copy link
Contributor Author

Thank you - glad if I could help out a bit

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

Successfully merging this pull request may close these issues.

3 participants