Allow encoders "as" option to be functions