Serialize functions by enumerating their domains.