From f79de31fdedf72492a9b531c83e2ad53ee37b18d Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Tue, 9 Feb 2021 22:23:17 +0200 Subject: [PATCH 1/9] feat: update to purs 0.14 --- src/Database/PostgreSQL.purs | 2 +- src/Database/PostgreSQL/RowList.purs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Database/PostgreSQL.purs b/src/Database/PostgreSQL.purs index 57cb5cd..3e85446 100644 --- a/src/Database/PostgreSQL.purs +++ b/src/Database/PostgreSQL.purs @@ -23,7 +23,7 @@ import Data.Array (head) import Data.Bifunctor (lmap) import Data.Either (Either(..), either, hush) import Data.Generic.Rep (class Generic) -import Data.Generic.Rep.Show (genericShow) +import Data.Show.Generic (genericShow) import Data.Maybe (Maybe(..), maybe) import Data.Newtype (class Newtype) import Data.Nullable (Nullable, toMaybe, toNullable) diff --git a/src/Database/PostgreSQL/RowList.purs b/src/Database/PostgreSQL/RowList.purs index 83805a9..63fd41e 100644 --- a/src/Database/PostgreSQL/RowList.purs +++ b/src/Database/PostgreSQL/RowList.purs @@ -5,7 +5,7 @@ module Data.PostgreSQL.RowList where -- -- infixl 10 type RowList.Cons as : -- --- type Apply (f :: RowList -> RowList) (a ∷ RowList) = f a +-- type Apply (f :: RowList Type -> RowList Type) (a ∷ RowList Type) = f a -- -- infixr 0 type Apply as $ -- From 5ba18264c785dcc3fcd04d2a62ad4ffdb17221c9 Mon Sep 17 00:00:00 2001 From: Serhii Khoma Date: Thu, 11 Feb 2021 21:31:17 +0200 Subject: [PATCH 2/9] feat: Could not match type NonEmptyList with type Array --- src/Database/PostgreSQL/Value.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Database/PostgreSQL/Value.purs b/src/Database/PostgreSQL/Value.purs index 6056f12..8b73bed 100644 --- a/src/Database/PostgreSQL/Value.purs +++ b/src/Database/PostgreSQL/Value.purs @@ -10,7 +10,7 @@ import Control.Monad.Error.Class (throwError) import Control.Monad.Except (ExceptT, except, runExcept, runExceptT) import Data.Argonaut (Json) import Data.Argonaut (stringify) as Argonaut -import Data.Array (foldl) +import Data.Foldable (foldl) import Data.Array as Array import Data.Bifunctor (lmap) import Data.ByteString (ByteString) From 9841e95dd2115df5ce162f27639b4454e8545bf9 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 03:12:14 -0700 Subject: [PATCH 3/9] Update package set to latest version and use newer syntax for additions --- packages.dhall | 170 ++++++++----------------------------------------- 1 file changed, 26 insertions(+), 144 deletions(-) diff --git a/packages.dhall b/packages.dhall index 68500ca..bbecad0 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,146 +1,28 @@ -{- -Welcome to your new Dhall package-set! - -Below are instructions for how to edit this file for most use -cases, so that you don't need to know Dhall to use it. - -## Warning: Don't Move This Top-Level Comment! - -Due to how `dhall format` currently works, this comment's -instructions cannot appear near corresponding sections below -because `dhall format` will delete the comment. However, -it will not delete a top-level comment like this one. - -## Use Cases - -Most will want to do one or both of these options: -1. Override/Patch a package's dependency -2. Add a package not already in the default package set - -This file will continue to work whether you use one or both options. -Instructions for each option are explained below. - -### Overriding/Patching a package - -Purpose: -- Change a package's dependency to a newer/older release than the - default package set's release -- Use your own modified version of some dependency that may - include new API, changed API, removed API by - using your custom git repo of the library rather than - the package set's repo - -Syntax: -Replace the overrides' "{=}" (an empty record) with the following idea -The "//" or "⫽" means "merge these two records and - when they have the same value, use the one on the right:" -------------------------------- -let override = - { packageName = - upstream.packageName // { updateEntity1 = "new value", updateEntity2 = "new value" } - , packageName = - upstream.packageName // { version = "v4.0.0" } - , packageName = - upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" } - } -------------------------------- - -Example: -------------------------------- -let overrides = - { halogen = - upstream.halogen // { version = "master" } - , halogen-vdom = - upstream.halogen-vdom // { version = "v4.0.0" } - } -------------------------------- - -### Additions - -Purpose: -- Add packages that aren't already included in the default package set - -Syntax: -Replace the additions' "{=}" (an empty record) with the following idea: -------------------------------- -let additions = - { "package-name" = - mkPackage - [ "dependency1" - , "dependency2" - ] - "https://example.com/path/to/git/repo.git" - "tag ('v4.0.0') or branch ('master')" - , "package-name" = - mkPackage - [ "dependency1" - , "dependency2" - ] - "https://example.com/path/to/git/repo.git" - "tag ('v4.0.0') or branch ('master')" - , etc. - } -------------------------------- - -Example: -------------------------------- -let additions = - { benchotron = - mkPackage - [ "arrays" - , "exists" - , "profunctor" - , "strings" - , "quickcheck" - , "lcg" - , "transformers" - , "foldable-traversable" - , "exceptions" - , "node-fs" - , "node-buffer" - , "node-readline" - , "datetime" - , "now" - ] - "https://github.com/hdgarrood/purescript-benchotron.git" - "v7.0.0" - } -------------------------------- --} - -let mkPackage = - https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.2-20190725/src/mkPackage.dhall sha256:0b197efa1d397ace6eb46b243ff2d73a3da5638d8d0ac8473e8e4a8fc528cf57 - let upstream = - https://raw.githubusercontent.com/purescript/package-sets/psc-0.13.2-20190725/src/packages.dhall sha256:60cc03d2c3a99a0e5eeebb16a22aac219fa76fe6a1686e8c2bd7a11872527ea3 + https://github.com/purescript/package-sets/releases/download/psc-0.14.1-20210506/packages.dhall sha256:d199e142515f9cc15838d8e6d724a98cd0ca776ceb426b7b36e841311643e3ef -let overrides = {=} - -let polyform = mkPackage - [ "debug", "foreign", "foreign-object", "generics-rep", "invariant", "newtype" - , "ordered-collections", "parsing", "psci-support", "profunctor", "quickcheck-laws" - , "run", "test-unit", "transformers", "validation", "variant" - ] - "https://github.com/purescript-polyform/polyform.git" - "master" - -let polyform-batteries = mkPackage - [ "affjax", "argonaut", "debug", "decimals", "filterable" - , "numbers", "polyform", "prelude", "record-extra" - , "test-unit" - ] - "https://github.com/purescript-polyform/batteries.git" - "master" - -let polyform-batteries-env = mkPackage - [ "polyform-batteries" ] - "https://github.com/purescript-polyform/batteries-env.git" - "master" - -let additions = - { polyform = polyform - , polyform-batteries = polyform-batteries - , polyform-batteries-env = polyform-batteries-env - } - -in upstream // overrides // additions +in upstream + with polyform = + { dependencies = + [ "debug", "foreign", "foreign-object", "invariant", "newtype" + , "ordered-collections", "parsing", "psci-support", "profunctor", "quickcheck-laws" + , "run", "test-unit", "transformers", "validation", "variant" + ] + , repo = "https://github.com/purescript-polyform/polyform.git" + , version = "master" + } + with polyform-batteries = + { dependencies = + [ "affjax", "argonaut", "debug", "decimals", "filterable" + , "numbers", "polyform", "prelude", "record-extra" + , "test-unit" + ] + , repo = "https://github.com/purescript-polyform/batteries.git" + , version = "master" + } + with polyform-batteries-env = + { dependencies = + [ "polyform-batteries" ] + , repo = "https://github.com/purescript-polyform/batteries-env.git" + , version = "master" + } From 15ea34f6590954608f32e6737dfe9b8a54dcffcd Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:36:27 -0700 Subject: [PATCH 4/9] Use polyform deps that have been updated to v0.14.1 PS --- packages.dhall | 95 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 24 deletions(-) diff --git a/packages.dhall b/packages.dhall index bbecad0..5f99d03 100644 --- a/packages.dhall +++ b/packages.dhall @@ -2,27 +2,74 @@ let upstream = https://github.com/purescript/package-sets/releases/download/psc-0.14.1-20210506/packages.dhall sha256:d199e142515f9cc15838d8e6d724a98cd0ca776ceb426b7b36e841311643e3ef in upstream - with polyform = - { dependencies = - [ "debug", "foreign", "foreign-object", "invariant", "newtype" - , "ordered-collections", "parsing", "psci-support", "profunctor", "quickcheck-laws" - , "run", "test-unit", "transformers", "validation", "variant" - ] - , repo = "https://github.com/purescript-polyform/polyform.git" - , version = "master" - } - with polyform-batteries = - { dependencies = - [ "affjax", "argonaut", "debug", "decimals", "filterable" - , "numbers", "polyform", "prelude", "record-extra" - , "test-unit" - ] - , repo = "https://github.com/purescript-polyform/batteries.git" - , version = "master" - } - with polyform-batteries-env = - { dependencies = - [ "polyform-batteries" ] - , repo = "https://github.com/purescript-polyform/batteries-env.git" - , version = "master" - } + with polyform = + { dependencies = + [ "arrays" + , "bifunctors" + , "control" + , "effect" + , "either" + , "enums" + , "functors" + , "identity" + , "invariant" + , "lists" + , "maybe" + , "newtype" + , "parallel" + , "partial" + , "prelude" + , "profunctor" + , "psci-support" + , "quickcheck" + , "quickcheck-laws" + , "record" + , "transformers" + , "tuples" + , "typelevel-prelude" + , "unsafe-coerce" + , "validation" + , "variant" + ] + , repo = "https://github.com/jordanmartinez/purescript-polyform.git" + , version = "updateTov0.14.1" + } + with polyform-batteries-core = + { dependencies = + [ "arrays" + , "decimals" + , "effect" + , "enums" + , "integers" + , "lazy" + , "maybe" + , "numbers" + , "partial" + , "polyform" + , "prelude" + , "psci-support" + , "quickcheck" + , "strings" + , "test-unit" + , "typelevel-prelude" + , "validation" + , "variant" + ] + , repo = "https://github.com/jordanmartinez/purescript-polyform-validators.git" + , version = "updateTov0.14.1" + } + with polyform-batteries-env = + { dependencies = + [ "arrays" + , "identity" + , "maybe" + , "ordered-collections" + , "polyform" + , "polyform-batteries-core" + , "prelude" + , "psci-support" + , "typelevel-prelude" + ] + , repo = "https://github.com/jordanmartinez/batteries-env.git" + , version = "updateTov0.14.1" + } From 7e34a2a59ad38cea5a891b54315b66f9e5c4cb31 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:36:49 -0700 Subject: [PATCH 5/9] Replace removed unsafeStringify with local version --- test/Main.js | 5 +++++ test/Main.purs | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/Main.js diff --git a/test/Main.js b/test/Main.js new file mode 100644 index 0000000..6e01d94 --- /dev/null +++ b/test/Main.js @@ -0,0 +1,5 @@ +"use strict"; + +exports.unsafeStringify = function (x) { + return JSON.stringify(x); +} diff --git a/test/Main.purs b/test/Main.purs index 9bad2ac..2d48512 100644 --- a/test/Main.purs +++ b/test/Main.purs @@ -31,7 +31,6 @@ import Effect.Class (liftEffect) import Effect.Exception (message) import Foreign.Object (Object) import Foreign.Object (fromFoldable) as Object -import Global.Unsafe (unsafeStringify) import Math ((%)) import Partial.Unsafe (unsafePartial) import Test.Assert (assert) @@ -389,3 +388,5 @@ validUriToPoolConfigs = { uri: "postgres://urllgqrivcyako:c52275a95b7f177e2850c4 notValidConnUri :: PGConnectionURI notValidConnUri = "postgres://urllgqrivcyakoc52275a95b7f177e2850c49de9bfa8bedc457ce860ccca664cb15db973554969@ec2-79-124-25-231.eu-west-1.compute.amazonaws.com:5432/e7cecg4nirunpo" + +foreign import unsafeStringify :: forall a. a -> String From fcc2dfef85ccc779d4d66136aaec695c0fb6560d Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:36:58 -0700 Subject: [PATCH 6/9] Update pulp to v15.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c2470dc..bcad961 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "devDependencies": { "github-release-notes": "^0.17.1", "paluh-litps": "^0.1.4", - "pulp": "^13.0.0" + "pulp": "^15.0.0" }, "scripts": { "pretest": "paluh-litps compile --file README.md; mv README.purs test/README.purs", From 3cfe9ffa3dbdc6a9cb5e9c65dc10ee8d9f0b522e Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:37:29 -0700 Subject: [PATCH 7/9] Fix Spago error; add missing dependencies used in source code --- spago.dhall | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spago.dhall b/spago.dhall index 3c71eaa..92ec1de 100644 --- a/spago.dhall +++ b/spago.dhall @@ -17,25 +17,36 @@ You can edit this file as you like. , "dotenv" , "effect" , "either" + , "enums" , "exceptions" , "foldable-traversable" , "foreign" , "foreign-generic" , "foreign-object" + , "identity" + , "integers" , "js-date" , "lists" + , "math" , "maybe" , "newtype" , "node-fs" , "node-process" , "nullable" + , "ordered-collections" + , "partial" + , "polyform" + , "polyform-batteries-core" , "polyform-batteries-env" , "prelude" , "psci-support" , "string-parsers" + , "strings" , "test-unit" , "transformers" , "tuples" + , "typelevel-prelude" + , "validation" ] , packages = ./packages.dhall , repository = "https://github.com/rightfold/purescript-postgresql-client.git" From 68b1887fd13987c391d229cd70df0f0c062c35de Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:37:46 -0700 Subject: [PATCH 8/9] Remove unused dependencies --- spago.dhall | 2 -- 1 file changed, 2 deletions(-) diff --git a/spago.dhall b/spago.dhall index 92ec1de..f783476 100644 --- a/spago.dhall +++ b/spago.dhall @@ -11,7 +11,6 @@ You can edit this file as you like. , "assert" , "bifunctors" , "bytestrings" - , "console" , "datetime" , "decimals" , "dotenv" @@ -30,7 +29,6 @@ You can edit this file as you like. , "math" , "maybe" , "newtype" - , "node-fs" , "node-process" , "nullable" , "ordered-collections" From 3ac9c1eace4fc707c274d065f01c5ec81d201757 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Wed, 12 May 2021 04:45:48 -0700 Subject: [PATCH 9/9] Update bower file deps to match package set versions --- bower.json | 65 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/bower.json b/bower.json index 96b4a0a..ce99fb0 100644 --- a/bower.json +++ b/bower.json @@ -14,31 +14,46 @@ "output" ], "dependencies": { - "purescript-aff": "^v5.1.1", - "purescript-argonaut": "^v6.0.0", - "purescript-arrays": "^v5.3.0", - "purescript-assert": "^v4.1.0", - "purescript-bifunctors": "^v4.0.0", + "purescript-aff": "^v6.0.0", + "purescript-argonaut": "^v8.0.0", + "purescript-arrays": "^v6.0.1", + "purescript-assert": "^v5.0.0", + "purescript-bifunctors": "^v5.0.0", "purescript-bytestrings": "^v8.0.0", - "purescript-console": "^v4.2.0", - "purescript-datetime": "^v4.1.1", - "purescript-decimals": "^v5.0.0", - "purescript-effect": "^v2.0.1", - "purescript-either": "^v4.1.1", - "purescript-exceptions": "^v4.0.0", - "purescript-foldable-traversable": "^v4.1.1", - "purescript-foreign": "^v5.0.0", - "purescript-foreign-generic": "^v10.0.0", - "purescript-foreign-object": "^v2.0.3", - "purescript-js-date": "^v6.0.0", - "purescript-lists": "^v5.4.1", - "purescript-maybe": "^v4.0.1", - "purescript-newtype": "^v3.0.0", - "purescript-nullable": "^v4.1.1", - "purescript-prelude": "^v4.1.1", - "purescript-psci-support": "^v4.0.0", - "purescript-test-unit": "^v15.0.0", - "purescript-transformers": "^v4.2.0", - "purescript-tuples": "^v5.1.0" + "purescript-datetime": "^v5.0.2", + "purescript-decimals": "^v6.0.0", + "purescript-dotenv": "^v2.0.0", + "purescript-effect": "^v3.0.0", + "purescript-either": "^v5.0.0", + "purescript-enums": "^v5.0.0", + "purescript-exceptions": "^v5.0.0", + "purescript-foldable-traversable": "^v5.0.1", + "purescript-foreign": "^v6.0.1", + "purescript-foreign-generic": "^v11.0.0", + "purescript-foreign-object": "^v3.0.0", + "purescript-identity": "^v5.0.0", + "purescript-integers": "^v5.0.0", + "purescript-js-date": "^v7.0.0", + "purescript-lists": "^v6.0.1", + "purescript-math": "^v3.0.0", + "purescript-maybe": "^v5.0.0", + "purescript-newtype": "^v4.0.0", + "purescript-node-process": "^v8.2.0", + "purescript-nullable": "^v5.0.0", + "purescript-ordered-collections": "^v2.0.1", + "purescript-partial": "^v3.0.0", + "purescript-polyform": "updateTov0.14.1", + "purescript-polyform-batteries-core": "updateTov0.14.1", + "purescript-polyform-batteries-env": "updateTov0.14.1", + "purescript-prelude": "^v5.0.0", + "purescript-string-parsers": "^v6.0.0", + "purescript-transformers": "^v5.1.0", + "purescript-tuples": "^v6.0.1", + "purescript-typelevel-prelude": "^v6.0.0", + "purescript-validation": "^v5.0.0" + }, + "devDependencies": { + "purescript-psci-support": "^v5.0.0", + "purescript-test-unit": "^v16.0.0" } }