For identifier validity checking and recursion, you should look into let-rec and its differences from ordinary let. As for API checking, you would probably be using typeclasses or interfaces to specify an API. Even if the individual URL objects do not exist yet, a URL type should exist (at compile-time) that defines what operations are valid. I don’t think that a separate function would need to be generated for each link, but you can build arbitrary operations at runtime with first-class functions.