Pairs of topological modules L, Y over algebras A, B are considered that are in duality, with values in an (A, B)-bimodule, L. An important example: if an arbitrary A-module L is regarded as an (A, B)-bimodule, where B = Hom(A) (L, L), then for any A-module L the pair X, Hom(A) (L, L) is in a natural L-duality. Conditions on the (A, B)-bimodule L are found under which the bipolar theorem and certain other results in convex analysis carry over to L-valued duality. In several cases this enables one to describe the structure of the closed submodules and (in terms of graphs) the closed homomorphisms. Among the applications are results on communication systems, unbounded derivations, left Hilbert algebras, spaces with an indefinite metric, and multipliers of C* -algebras.