\documentclass{report}

\usepackage{noweb}

\begin{document}

\section{Introduction}

<<type>>=
type x = int   (* *)
type y = float
@

\section{Interface}

<<demo.mli>>=
<<type>>
@ 


\section{Implementation}

<<demo.ml>>=
<<type>>
let foo x = 1
let bar y = 2

<<part1>>
<<part2>>
@ 

<<part1>>=
let misc = 3
@


<<part1>>=
let part1bis x = 1
@ 

<<part1>>=
let part1bisbis x = 1
@ 


<<part1>>=
let part1bisbisbis x = 1
@ 


<<part2>>=
let part2 x = 3
@ 

\end{document}
