From c030301f494c49b7e18a324c4020030b341419f6 Mon Sep 17 00:00:00 2001 From: Bohdan Yavorskyi Date: Fri, 3 Aug 2018 11:11:01 +0300 Subject: [PATCH 1/2] Updated for PureScript 0.12 --- bower.json | 12 ++++++------ src/Text/Parsing/CSV.purs | 4 ++-- test/Main.purs | 10 ++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/bower.json b/bower.json index 092d303..10681e2 100644 --- a/bower.json +++ b/bower.json @@ -15,13 +15,13 @@ "url": "https://github.com/nwolverson/purescript-csv.git" }, "dependencies": { - "purescript-parsing": "^4.0.0", - "purescript-arrays": "^4.0.1", - "purescript-maps": "^3.0.0" + "purescript-arrays": "^5.0.0", + "purescript-ordered-collections": "^1.0.0", + "purescript-parsing": "^5.0.1" }, "devDependencies": { - "purescript-console": "^3.0.0", - "purescript-quickcheck": "^4.0.0", - "purescript-test-unit": "^11.0.0" + "purescript-console": "^4.1.0", + "purescript-quickcheck": "^5.0.0", + "purescript-test-unit": "^14.0.0" } } diff --git a/src/Text/Parsing/CSV.purs b/src/Text/Parsing/CSV.purs index 3f5b250..e0b1100 100644 --- a/src/Text/Parsing/CSV.purs +++ b/src/Text/Parsing/CSV.purs @@ -6,7 +6,7 @@ import Control.Alt ((<|>)) import Data.Array (some) import Data.Foldable (all) import Data.List (List(..), zip) -import Data.String (fromCharArray, toCharArray, singleton) +import Data.String.CodeUnits (fromCharArray, toCharArray, singleton) import Text.Parsing.Parser (Parser) import Text.Parsing.Parser.Combinators (sepEndBy, sepBy1, between) import Text.Parsing.Parser.String (eof, satisfy, string) @@ -32,7 +32,7 @@ makeChars xs = do fromCharArray <$> some char where char = satisfy $ excluded xs - excluded ys = \x -> all id $ terms ys <*> [x] + excluded ys = \x -> all identity $ terms ys <*> [x] terms ys = map (/=) $ toCharArray ys makeQchars :: Char -> P String diff --git a/test/Main.purs b/test/Main.purs index a7f1046..899effa 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -1,16 +1,14 @@ module Test.Main where import Prelude -import Data.Map as M -import Control.Monad.Aff.AVar (AVAR) -import Control.Monad.Eff (Eff) -import Control.Monad.Eff.Console (CONSOLE) + import Data.Either (Either(Left, Right)) import Data.List (fromFoldable, List, head) +import Data.Map as M import Data.Maybe (fromMaybe) +import Effect (Effect) import Test.Unit (test) import Test.Unit.Assert (assert) -import Test.Unit.Console (TESTOUTPUT) import Test.Unit.Main (runTest) import Text.Parsing.CSV (P, Parsers, defaultParsers, makeParsers) import Text.Parsing.Parser (runParser) @@ -45,7 +43,7 @@ testFileResult = fromFoldable $ fromFoldable <$> testData testFileEmptyEndLineResult :: List (List String) testFileEmptyEndLineResult = fromFoldable $ fromFoldable <$> testData <> [[""]] -main :: ∀ e. Eff (avar :: AVAR, testOutput :: TESTOUTPUT, console ∷ CONSOLE | e) Unit +main :: Effect Unit main = runTest do test "chars" do assert "parses chars" $ parses defaultParsers.chars "abc" "abc" From cff460217f9ac4b82359693c3bebeb4bd3ea6e6b Mon Sep 17 00:00:00 2001 From: Bohdan Yavorskyi Date: Fri, 3 Aug 2018 11:24:14 +0300 Subject: [PATCH 2/2] update travis --- .travis.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index afd76c4..f0b84ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,11 @@ language: node_js dist: trusty sudo: required -node_js: 6 -env: - - PATH=$HOME/purescript:$PATH +node_js: 10 install: - - wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/v0.11.3/linux64.tar.gz - - tar -xvf $HOME/purescript.tar.gz -C $HOME/ - - chmod a+x $HOME/purescript - - npm install -g bower pulp + - npm install -g bower pulp purescript@0.12.0 script: - - npm install && bower install && pulp test + - bower install && pulp test after_success: - >- test $TRAVIS_TAG &&