diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce27ea06f..20776a5cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,8 @@ name: CI on: push: - branches: [latestRelease, development] + branches: [latestRelease] pull_request: - branches: [latestRelease, development] jobs: build: diff --git a/01-Getting-Started/04-Install-Guide.md b/01-Getting-Started/04-Install-Guide.md index 989803427..2d079437f 100644 --- a/01-Getting-Started/04-Install-Guide.md +++ b/01-Getting-Started/04-Install-Guide.md @@ -44,7 +44,7 @@ Unlike the manual install, `nvm` properly handles the npm prefix for you. So, yo Once you have installed `npm`, we can use it to install everything in one command: ```bash -npm i -g purescript@0.14.0 spago@0.19.1 parcel +npm i -g purescript@0.14.0 spago@0.20.0 parcel ``` ### Versions Used in this Project diff --git a/21-Hello-World/02-Effect-and-Aff/spago.dhall b/21-Hello-World/02-Effect-and-Aff/spago.dhall index a339e0d8a..f18731efe 100644 --- a/21-Hello-World/02-Effect-and-Aff/spago.dhall +++ b/21-Hello-World/02-Effect-and-Aff/spago.dhall @@ -10,12 +10,15 @@ You can edit this file as you like. [ "aff" , "console" , "effect" + , "either" , "js-timers" , "node-readline" , "now" , "prelude" , "psci-support" , "random" + , "refs" + , "st" ] , packages = ../../packages.dhall diff --git a/21-Hello-World/03-Debugging/spago.dhall b/21-Hello-World/03-Debugging/spago.dhall index e3800887a..15de3c697 100644 --- a/21-Hello-World/03-Debugging/spago.dhall +++ b/21-Hello-World/03-Debugging/spago.dhall @@ -7,19 +7,12 @@ You can edit this file as you like. , name = "untitled" , dependencies = - [ "aff" - , "console" + [ "console" , "debug" , "effect" - , "either" - , "node-readline" - , "partial" , "prelude" , "psci-support" - , "random" - , "refs" , "st" - , "typelevel-prelude" ] , packages = ../../packages.dhall diff --git a/21-Hello-World/03-Debugging/src/03-Debug-Trace/01-Debug-Trace.purs b/21-Hello-World/03-Debugging/src/03-Debug/01-Debug.purs similarity index 96% rename from 21-Hello-World/03-Debugging/src/03-Debug-Trace/01-Debug-Trace.purs rename to 21-Hello-World/03-Debugging/src/03-Debug/01-Debug.purs index beea4afb5..4d741b7cd 100644 --- a/21-Hello-World/03-Debugging/src/03-Debug-Trace/01-Debug-Trace.purs +++ b/21-Hello-World/03-Debugging/src/03-Debug/01-Debug.purs @@ -1,7 +1,7 @@ -- When you compile this file, it will output compiler warnings. -- If you wish to remove that noise, comment out everything below -- the "module" declaration. -module Debugging.DebugTrace where +module Debugging.Debug where -- Comment out everything below this line to prevent compiler warning. ---------------------------------------------------------------------- @@ -9,7 +9,7 @@ module Debugging.DebugTrace where import Prelude import Effect (Effect) import Effect.Console (log) -import Debug.Trace (spy, trace, traceM) +import Debug (spy, trace, traceM) -- Given a simple Box Monad data Box a = Box a diff --git a/21-Hello-World/03-Debugging/src/03-Debug-Trace/02-DebugWarning.md b/21-Hello-World/03-Debugging/src/03-Debug/02-DebugWarning.md similarity index 76% rename from 21-Hello-World/03-Debugging/src/03-Debug-Trace/02-DebugWarning.md rename to 21-Hello-World/03-Debugging/src/03-Debug/02-DebugWarning.md index 9483722dd..b9a97d045 100644 --- a/21-Hello-World/03-Debugging/src/03-Debug-Trace/02-DebugWarning.md +++ b/21-Hello-World/03-Debugging/src/03-Debug/02-DebugWarning.md @@ -1,22 +1,22 @@ # DebugWarning -`Debug.Trace` uses Custom Type Errors to warn the developer when it is being used. +`Debug` uses Custom Type Errors to warn the developer when it is being used. -Let's examine it further since it provides an example for us to follow should we wish to do something similar in the future. The source code is [here](https://github.com/garyb/purescript-debug/blob/v4.0.0/src/Debug/Trace.purs#L8-L8), but we'll provide type signatures for the parts we need below and explain their usage: +Let's examine it further since it provides an example for us to follow should we wish to do something similar in the future. The source code is [here](https://github.com/garyb/purescript-debug/blob/v5.0.0/src/Debug.purs), but we'll provide type signatures for the parts we need below and explain their usage: ```haskell -- See the copyright notice at the bottom of this file for this code: -- | Nullary type class used to raise a custom warning for the debug functions. class DebugWarning -instance warn :: Warn (Text "Debug.Trace usage") => DebugWarning +instance warn :: Warn (Text "Debug usage") => DebugWarning foreign import trace :: forall a b. DebugWarning => a -> (Unit -> b) -> b -- same idea as 'trace' for all the other functions ``` -In short, rather than writing `function :: Warn (Text "Debug.Trace usage") => [function's type signature]` on every function, they use an empty type class whose sole instance adds this for every usage of that type class. +In short, rather than writing `function :: Warn (Text "Debug usage") => [function's type signature]` on every function, they use an empty type class whose sole instance adds this for every usage of that type class.
Copyright notice for the above code: diff --git a/21-Hello-World/03-Debugging/src/03-Debug-Trace/03-Local-State.purs b/21-Hello-World/03-Debugging/src/03-Debug/03-Local-State.purs similarity index 98% rename from 21-Hello-World/03-Debugging/src/03-Debug-Trace/03-Local-State.purs rename to 21-Hello-World/03-Debugging/src/03-Debug/03-Local-State.purs index 1b08215ed..5eec47bd9 100644 --- a/21-Hello-World/03-Debugging/src/03-Debug-Trace/03-Local-State.purs +++ b/21-Hello-World/03-Debugging/src/03-Debug/03-Local-State.purs @@ -10,7 +10,7 @@ import Prelude import Control.Monad.ST as ST import Control.Monad.ST.Ref as STRef -import Debug.Trace (traceM) +import Debug (traceM) import Effect (Effect) import Effect.Console (log) diff --git a/21-Hello-World/03-Debugging/src/03-Debug-Trace/Readme.md b/21-Hello-World/03-Debugging/src/03-Debug/Readme.md similarity index 63% rename from 21-Hello-World/03-Debugging/src/03-Debug-Trace/Readme.md rename to 21-Hello-World/03-Debugging/src/03-Debug/Readme.md index 23ff3544d..1e4c72e7c 100644 --- a/21-Hello-World/03-Debugging/src/03-Debug-Trace/Readme.md +++ b/21-Hello-World/03-Debugging/src/03-Debug/Readme.md @@ -2,9 +2,9 @@ Previously, we got around the "`bind` outputs the same box-like type it receives" restriction by using `MonadEffect`. However, we also explained that `ST`, the monad used to run a computation that uses local mutable state, did not have an instance for `MonadEffect`. This decision is intentional. -When we run production code, we want to uphold this restriction. However, when we are debugging code, this restriction can be very annoying. Fortunately, the [Debug.Trace](https://pursuit.purescript.org/packages/purescript-debug/4.0.0/docs/Debug.Trace) package exists to help you use print debugging in any monadic context. You should use it when initially prototyping things. It should never appear in production code, nor as a solution for production-level logging. (We'll show how to do that in the `Application Structure` folder). +When we run production code, we want to uphold this restriction. However, when we are debugging code, this restriction can be very annoying. Fortunately, the [Debug](https://pursuit.purescript.org/packages/purescript-debug/docs/Debug) package exists to help you use print debugging in any monadic context. You should use it when initially prototyping things. It should never appear in production code, nor as a solution for production-level logging. (We'll show how to do that in the `Application Structure` folder). -**WARNING**: `Debug.Trace`'s functions are not always reliable when running concurrent code (i.e. `Aff`-based computations). +**WARNING**: `Debug`'s functions are not always reliable when running concurrent code (i.e. `Aff`-based computations). ## Compilation Instructions @@ -23,6 +23,6 @@ spago build Use these commands ```bash -spago run -m Debugging.DebugTrace +spago run -m Debugging.Debug spago run -m Debugging.LocalState ``` diff --git a/21-Hello-World/05-Application-Structure/spago.dhall b/21-Hello-World/05-Application-Structure/spago.dhall index 080444e41..deabf8df6 100644 --- a/21-Hello-World/05-Application-Structure/spago.dhall +++ b/21-Hello-World/05-Application-Structure/spago.dhall @@ -8,18 +8,21 @@ You can edit this file as you like. "untitled" , dependencies = [ "console" - , "debug" , "effect" + , "either" , "free" + , "functors" + , "identity" + , "maybe" , "prelude" , "psci-support" , "random" - , "refs" , "run" - , "st" , "strings" , "transformers" + , "tuples" , "typelevel-prelude" + , "type-equality" , "variant" ] , packages = diff --git a/21-Hello-World/07-Testing/spago.dhall b/21-Hello-World/07-Testing/spago.dhall index 0dbc7c069..1a8a59e32 100644 --- a/21-Hello-World/07-Testing/spago.dhall +++ b/21-Hello-World/07-Testing/spago.dhall @@ -7,15 +7,24 @@ You can edit this file as you like. , name = "untitled" , dependencies = - [ "console" + [ "aff" + , "arrays" + , "console" , "effect" - , "newtype" + , "enums" + , "exceptions" + , "foldable-traversable" + , "integers" + , "lists" + , "maybe" + , "partial" , "prelude" , "psci-support" , "quickcheck" , "quickcheck-laws" , "spec" , "strings" + , "tuples" ] , packages = ../../packages.dhall diff --git a/21-Hello-World/08-Benchmarking/spago.dhall b/21-Hello-World/08-Benchmarking/spago.dhall index 71c1ce144..0083ea5c4 100644 --- a/21-Hello-World/08-Benchmarking/spago.dhall +++ b/21-Hello-World/08-Benchmarking/spago.dhall @@ -7,9 +7,10 @@ You can edit this file as you like. , name = "ignore" , dependencies = - [ "console" - , "prelude" + [ "prelude" , "effect" + , "foldable-traversable" + , "newtype" , "psci-support" , "quickcheck" , "benchotron" diff --git a/packages.dhall b/packages.dhall index 3fd7cec34..045f1d7c9 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,5 +1,5 @@ let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210304/packages.dhall sha256:c88151fe7c05f05290224c9c1ae4a22905060424fb01071b691d3fe2e5bad4ca + https://github.com/purescript/package-sets/releases/download/psc-0.14.0-20210406/packages.dhall sha256:7b6af643c2f61d936878f58b613fade6f3cb39f2b4a310f6095784c7b5285879 let additions = { benchotron =