r/haskell • u/drewolson • Feb 24 '21
blog PureScript and Haskell
https://blog.drewolson.org/purescript-and-haskell11
u/metaconcept Feb 25 '21
People complain about compilation speed, but as a newbie I havn't experienced this, except for the first time you start stuff up. I live in ghci and use haskell-language-server, so I only compile when I change stack dependencies or need to deploy.
Otherwise everything is nearly real-time.
7
u/zzantares Feb 25 '21
Maybe for small projects, but on big codebases (and even not so big) it is slow, of course, while developing this is alleviated by ghcid and the REPL, but for production builds it's another thing.
3
u/Imaginary-Nerve-820 Feb 26 '21
A Big Rebuild (50+ modules from scratch) is a perfect time to take a break and grab a coffee
5
u/D7x7w9pHnT Feb 25 '21
Thank you for writing this up!
I enjoyed seeing how you learned PureScript and then Haskell.
My progression was JavaScript -> Elm -> Haskell -> PureScript and it's fun seeing a reverse perspective. I really like the laziness of Haskell, but I can see why strict is used more.
For PureScript, if you don't mind me preaching the wonders of Nix, I've created a shell.nix that gives you a whole development environment in two three eight, uh, commands.
# Install Nix as a $ non-root user with sudo privileges
curl -L https://nixos.org/nix/install | sh
# $ in the directory with the shell.nix file
nix-shell
# Opens up a VSCode environment with PureScript plugins installed
code .
# Then either one of two, or both with split windows
# The spago route
spago --help
spago init
spago test
spago docs
#etc. etc.
# OR
# Automate compiler and test runner
pscid # after a spago initAdd an .envrc with use_nix in it, install direnv and zsh for the greatest, laziest way of installing code. You know, once you spent all that work getting to know it
https://gist.github.com/D7x7w9pHnT-cmd/3ceb432336d9fb4c5ef7d3b1ac47269c
1
u/backtickbot Feb 25 '21
3
0
10
u/ephrion Feb 25 '21
These paragraphs are stunning to me. If you reorder them slightly, it seems crazy to generally prefer PureScript's strict-by-default:
Also,
I wish we'd stop recommending
scotty.