Bloody beginner question: How to install module `math`?

Hi, I installed purescript according to the book, but I struggle to setup a new project and to install the math module.

Example:

[/tmp]  mkdir bla
[/tmp]  cd bla/
[/t/bla]  spago init
[info] Initializing a sample project or migrating an existing one..
[info] Updating package-set tag to "psc-0.15.2-20220531"
Fetching the new one and generating hashes.. (this might take some time)
[info] Generating new hashes for the package set file so it will be cached.. (this might take some time)
[info] Set up a local Spago project.
[info] Try running `spago build`
[/t/bla]  spago build
[info] Installing 3 dependencies.
[info] Searching for packages cache metadata..
[info] Recent packages cache metadata found, using it..
[info] Installing "prelude"
[info] Installing "console"
[info] Installing "effect"
[info] Installation complete.
[ 1 of 58] Compiling Type.Proxy
...
[58 of 58] Compiling Test.Main
[info] Build succeeded.
[/t/bla]  spago install math
[error] The following packages do not exist in your package set:
[error]   - math

That also does not work:

[/t/bla]  spago install purescript-math
[error] The following packages do not exist in your package set:
[error]   - purescript-math

What I am missing here?

1 Like

Hello and welcome here!

This module got deprecated by the recently released 0.15 version - the functions in there got moved into numbers and integers - see here

The book is currently not updated to the new release so I guess you might run into other small problems - feel free to ask if you encounter anything.

3 Likes

You may want to consider using the 0.14 series of the compiler until the book has been updated. The differences will be fairly trivial once you are more familiar with the language, so it ought not be too difficult for you to switch to 0.15 once you’ve finished with the book.

3 Likes

The WIP PR that updates the book to 0.15 is here: Upgrade book to v0.15 by eikooc · Pull Request #419 · purescript-contrib/purescript-book · GitHub

3 Likes