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
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@

language: node_js
dist: trusty
sudo: required
node_js: stable
dist: trusty
node_js: 8
env:
- PATH=$HOME/purescript:$PATH
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)

- tar -xvf $HOME/purescript.tar.gz -C $HOME/
- chmod a+x $HOME/purescript
- npm install -g bower
- npm install
script:
- bower install --production
- npm run -s build
- bower install
- npm -s test
- pulp test
after_success:
- >-
test $TRAVIS_TAG &&
echo $GITHUB_TOKEN | pulp login &&
echo y | pulp publish --no-push
echo y | pulp publish --no-push
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
},
"license": "MIT",
"dependencies": {
"purescript-argonaut-core": "#compiler/0.12",
"purescript-integers": "#compiler/0.12",
"purescript-maybe": "#compiler/0.12",
"purescript-foreign-object": "#compiler/0.12"
"purescript-argonaut-core": "^4.0.0",
"purescript-integers": "^4.0.0",
"purescript-maybe": "^4.0.0",
"purescript-foreign-object": "^1.0.0"
},
"devDependencies": {
"purescript-strongcheck": "#compiler/0.12"
}
}
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"test": "pulp test"
},
"devDependencies": {
"pulp": "^12.0.1",
"pulp": "^12.2.0",
"purescript-psa": "^0.6.0",
"purescript": "^0.11.1",
"rimraf": "^2.6.1"
}
}
}
6 changes: 3 additions & 3 deletions src/Data/Argonaut/Decode/Class.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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, codePointAt)
import Data.Traversable (traverse)
import Data.Tuple (Tuple(..))
import Foreign.Object as FO
Expand Down Expand Up @@ -63,10 +63,10 @@ instance decodeJsonString :: DecodeJson String where
instance decodeJsonJson :: DecodeJson Json where
decodeJson = Right

instance decodeJsonChar :: DecodeJson Char where
instance decodeJsonChar :: DecodeJson CodePoint where
decodeJson j =
maybe (Left $ "Expected character but found: " <> stringify j) Right
=<< charAt 0 <$> decodeJson j
=<< codePointAt 0 <$> decodeJson j

instance decodeForeignObject :: DecodeJson a => DecodeJson (FO.Object a) where
decodeJson
Expand Down
9 changes: 7 additions & 2 deletions src/Data/Argonaut/Encode/Class.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import Data.Int (toNumber)
import Data.List (List(..), (:), toUnfoldable)
import Data.Map as M
import Data.Maybe (Maybe(..))
import Data.String (singleton)
import Data.String (CodePoint)
import Data.String.CodePoints as CP
import Data.String.CodeUnits as CU
import Data.Tuple (Tuple(..))
import Foreign.Object as FO

Expand Down Expand Up @@ -48,8 +50,11 @@ instance encodeJsonJString :: EncodeJson String where
instance encodeJsonJson :: EncodeJson Json where
encodeJson = identity

instance encodeJsonCodePoint :: EncodeJson CodePoint where
encodeJson = encodeJson <<< CP.singleton

instance encodeJsonChar :: EncodeJson Char where
encodeJson = encodeJson <<< singleton
encodeJson = encodeJson <<< CU.singleton

instance encodeJsonArray :: EncodeJson a => EncodeJson (Array a) where
encodeJson json = fromArray (encodeJson <$> json)
Expand Down