Generic Module Signatures

If the values which differ in type as regards your various endpoints are known when you apply your make function to construct the endpoints, you can consider storing the values as closures, or store them existentially using GADTs or first class modules. A simple example is here: OO with rere? how to work-around? - #18 by cvine and in related postings in that thread.

Also, don’t forget variants: you could consider representing each different record comprising your endpoints as the payload of the cases of a variant type and match on the variant. The best approach depends on the trade offs.