From 8b51898bb525a34badf2c643d42877b28c234b63 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sun, 12 Mar 2017 14:42:49 +0000 Subject: [PATCH 1/2] Update for PureScript 0.11 --- .travis.yml | 2 +- bower.json | 8 ++++---- package.json | 8 ++++---- src/Data/NonEmpty.purs | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index c33fb6f..a9f23ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js dist: trusty sudo: required -node_js: 6 +node_js: stable env: - PATH=$HOME/purescript:$PATH install: diff --git a/bower.json b/bower.json index 2d7fe91..a04d6fd 100644 --- a/bower.json +++ b/bower.json @@ -17,11 +17,11 @@ "package.json" ], "dependencies": { - "purescript-foldable-traversable": "^2.2.0", - "purescript-prelude": "^2.4.0" + "purescript-foldable-traversable": "^3.0.0", + "purescript-prelude": "^3.0.0" }, "devDependencies": { - "purescript-assert": "^2.0.0", - "purescript-console": "^2.0.0" + "purescript-assert": "^3.0.0", + "purescript-console": "^3.0.0" } } diff --git a/package.json b/package.json index 5054554..bf77170 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,12 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build --censor-lib --strict", + "build": "pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": { - "pulp": "^9.0.1", - "purescript-psa": "^0.3.9", - "rimraf": "^2.5.0" + "pulp": "^10.0.4", + "purescript-psa": "^0.5.0-rc.1", + "rimraf": "^2.6.1" } } diff --git a/src/Data/NonEmpty.purs b/src/Data/NonEmpty.purs index d91d00d..3015ccc 100644 --- a/src/Data/NonEmpty.purs +++ b/src/Data/NonEmpty.purs @@ -46,11 +46,11 @@ foldl1 :: forall f a. Foldable f => (a -> a -> a) -> NonEmpty f a -> a foldl1 f (a :| fa) = foldl f a fa -- | Fold a non-empty structure, collecting results in a `Semigroup`. -foldMap1 :: forall f a s. (Semigroup s, Foldable f) => (a -> s) -> NonEmpty f a -> s +foldMap1 :: forall f a s. Semigroup s => Foldable f => (a -> s) -> NonEmpty f a -> s foldMap1 f (a :| fa) = foldl (\s a1 -> s <> f a1) (f a) fa -- | Fold a non-empty structure. -fold1 :: forall f s. (Semigroup s, Foldable f) => NonEmpty f s -> s +fold1 :: forall f s. Semigroup s => Foldable f => NonEmpty f s -> s fold1 = foldMap1 id fromNonEmpty :: forall f a r. (a -> f a -> r) -> NonEmpty f a -> r From 76ff0b0fa04d23f4c9f46786156ad0f4f6528e1e Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sun, 26 Mar 2017 02:58:33 +0100 Subject: [PATCH 2/2] Use Eq1 and Ord1 constraints consistently --- src/Data/NonEmpty.purs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Data/NonEmpty.purs b/src/Data/NonEmpty.purs index 3015ccc..dad163c 100644 --- a/src/Data/NonEmpty.purs +++ b/src/Data/NonEmpty.purs @@ -70,12 +70,14 @@ tail (_ :| xs) = xs instance showNonEmpty :: (Show a, Show (f a)) => Show (NonEmpty f a) where show (a :| fa) = "(NonEmpty " <> show a <> " " <> show fa <> ")" -derive instance eqNonEmpty :: (Eq a, Eq (f a)) => Eq (NonEmpty f a) +instance eqNonEmpty :: (Eq1 f, Eq a) => Eq (NonEmpty f a) where + eq = eq1 instance eq1NonEmpty :: Eq1 f => Eq1 (NonEmpty f) where eq1 (NonEmpty a fa) (NonEmpty b fb) = a == b && fa `eq1` fb -derive instance ordNonEmpty :: (Ord a, Ord (f a)) => Ord (NonEmpty f a) +instance ordNonEmpty :: (Ord1 f, Ord a) => Ord (NonEmpty f a) where + compare = compare1 instance ord1NonEmpty :: Ord1 f => Ord1 (NonEmpty f) where compare1 (NonEmpty a fa) (NonEmpty b fb) =