Re-re-starting my adventures in Haskell, for no particularly good reason.
Try the first Project Euler problem: https://projecteuler.net/problem=1
GitHub repo is here: https://github.com/JohnL4/ProjectEuler
...aaaaand, now I have a blank editor in front of me. Now what?
Output#
putStr and putStrLn for printing to stdout. NOTE: This only prints strings. Use print as a more general-purpose output.
See this page: 2015-09-27-writing-a-simple-haskell-script-from-scratch
So... the first problem is adding ghc to your path in emacs (if you use that editor).
Stack#
Actually, a better choice is to install stack, which managed the entire toolchain for you, kind of like npm does for Node.
See https://docs.haskellstack.org/en/stable/install_and_upgrade/, and http://haskell.github.io/haskell-mode/manual/latest/Compilation.html
. After that, you should be off to the races.
Done#
Ok, yay, me. I wrote a Haskell program in an afternoon, after a long break of not writing Haskell. I'm getting better at this!
(See https://github.com/JohnL4/ProjectEuler/blob/master/Haskell/Problem001/app/Main.hs.)