  We construct a new topology on the space of stopped paths and introduce a
calculus for causal functionals on generic domains of this space. We propose a
generic approach to pathwise integration without any assumption on the
variation index of a path and obtain functional change of variable formulas
which extend the results of \follmer\ (1981) and Cont \& Fourni\'e (2010) to a
larger class of functionals, including \follmer's pathwise integrals. We show
that a class of smooth functionals possess a pathwise analogue of the
martingale property. For paths that possess finite quadratic variation, our
approach extends F\"ollmer-Ito calculus and removes previous restriction on the
time partition sequence. We introduce a foliation structure on this path space
and show that harmonic functionals may be represented as pathwise integrals of
closed 1-forms.
