Haskell can be installed through Homebrew pretty easily.
brew install ghc cabal-installExtra steps that I needed to perform post install
cabal update
cabal install ghc-modHaskell can be used by running the command GHCI which is GHC’s interactive environment where Haskell expression can be interactively evaluated and programs can be interpreted.
When declaring variables on the terminal you must declare each variable/function with let.
For example,
let var = 2
let function x = x * 2 -- where function is the name and x its parameterWhen writing on a file the extension must be .hs and there you can’t use the let keyword. To load a file onto ghci you use the :load file.hs command
:load file.hs
var = 2
function x = x * 2I recommend that you read through this online tutorial