Add to_hal method to objects.