mkRuntimeErrorApp
        :: Id           -- Should be of type (forall a. Addr# -> a)
                        --      where Addr# points to a UTF8 encoded string
        -> Type         -- The type to instantiate 'a'
        -> String       -- The string to print
        -> CoreExpr

mkRuntimeErrorApp err_id res_ty err_msg
  = mkApps (Var err_id) [Type res_ty, err_string]
  where
    err_string = Lit (mkMachString err_msg)
mkRuntimeErrorApp
        :: Id           -- Should be of type (forall a. Addr# -> a)
                        --      where Addr# points to a UTF8 encoded string
        -> Type         -- The type to instantiate 'a'
        -> String       -- The string to print
        -> CoreExpr
mkRuntimeErrorApp err_id res_ty err_msg
  = mkApps (Var err_id) [Type res_ty, err_string]
  where
    err_string = Lit (mkMachString err_msg)
mkRuntimeErrorApp err_id res_ty err_msg
  = mkApps (Var err_id) [Type res_ty, err_string]
  where
    err_string = Lit (mkMachString err_msg)