Automatic derivation of querying functions for servant
