fix haskell_type

Change global variable to getter function.