In this post we will go over how to accept environmental variables in Haskell.
We can compile this if we put it in a file called
and run it with an ad-hoc ENV variable:
Which will print out:
but this will throw an error if the ENV var doesn't exist:
To solve that issue we can use
which will give us a default value when the ENV variable doesn't exist: