getInstruction :: Throws (Located GeneratorError) e => String -> FieldType -> (TypeInstructions -> a) -> GenerateJvm e a
getInstruction msg t fn = do
  let msg' = "Unsupported " ++ msg ++ ": " ++ show t
  case lookup t instructionsByType of
    Nothing -> failCheck GeneratorError msg'
    Just i -> return $ fn i
getInstruction :: Throws (Located GeneratorError) e => String -> FieldType -> (TypeInstructions -> a) -> GenerateJvm e a
getInstruction msg t fn = do
  let msg' = "Unsupported " ++ msg ++ ": " ++ show t
  case lookup t instructionsByType of
    Nothing -> failCheck GeneratorError msg'
    Just i -> return $ fn i
getInstruction msg t fn = do
  let msg' = "Unsupported " ++ msg ++ ": " ++ show t
  case lookup t instructionsByType of
    Nothing -> failCheck GeneratorError msg'
    Just i -> return $ fn i