fix cabalbuild

Change global variable to getter function.