We describe a general-purpose framework to design quantum algorithms. This framework relies on two pillars: a basic data structure called quantum matrix and a modular structure based on three quasi-independent modules. These latter include a loading module, a tool-kit of basic quantum arithmetic operations and a read-out module. We briefly discuss the loading and read-out modules, while the arithmetic module is analyzed in more depth. Eventually, we give explicit examples regarding the manipulation of generic oracles and hint at possible applications.