Foundations should be designed for the needs of mathematics and not vice versa. We propose a technique for doing this that exploits the correspondence between category theory and logic and is potentially applicable to several mathematical disciplines.This method is applied to devising a new paradigm for general topology, called Abstract Stone Duality. We express the duality between algebra and geometry as an abstract monadic adjunction that we turn into a new type theory. To this we add an equation that is satisfied by the Sierpiński space, which plays a key role as the classifier for both open and closed subspaces.In the resulting theory there is a duality between open and closed concepts. This captures many basic properties of compact and closed subspaces, despite the absence of any explicitly infinitary axiom. It offers dual results that link general topology to recursion theory.The extensions and applications of ASD elsewhere that this paper survey include a purely recursive theory of elementary real analysis in which, unlike in previous approaches, the real closed interval [0, 1] in ASD is compact."In these days the angel of topology and the devil of abstract algebra fight for the soul of every individual discipline of mathematics." (Hermann Weyl.)"Point-set topology is a disease from which the human race will soon recover." (Henri Poincaré, quoted in Comic Sections by Des MacHale.)