Support function construction rules in flatMap/Latest/First (#306)