Allow encoders "as" options to be functions