With Haskell I can run an arbitrary file not necessary in a
src folder with the command
runhaskell. I would like to do so with Purescript. I am trying to set up a Purescript dev environment using Nix to do some Advent of Code, and I would like to run a single file, not a whole project. Is it possible? If it is, It would be nice if you could provide me a flake doing that.
spago script --help! I think that should have what you need.
Thank you. I will go with that.
Hi @ntwilson, I have two problems with
spago script. First, it requires each script to have the module name of
Main, and because there are multiple
spago build fails. So, I cannot use PureScript language server.
spago script requires each module to be standalone, that is, I cannot import my other helper modules.
Please help me with that.
I looked at the book https://github.com/purescript-contrib/purescript-book and see that the author creates a new project for each exercise. I guess it is the way to do, so I will follow it. Thank you for your support.
People on discord suggest using
spago run -m, and it is what I am looking for.