Suppose I have an incomplete code block like:
\documentclass{article}
%include polycode.fmt
\begin{document}
\begin{code}
somefunction :: a -> a
\end{code}
\begin{spec}
somefunction x = undefined
\end{spec}
\end{document}
It is supposed to express a work in-progress, because somefunction
is only defined at a later point, so I want to hide this incomplete definition from ghc, but I want to reuse the type signature. Unfortunately in this setup there is a vertical space between the two lines. A workaround is to rewrite the document body as follows:
\begin{spec}
somefunction :: a -> a
somefunction x = undefined
\end{spec}
%if False
\begin{code}
somefunction :: a -> a
\end{code}
%endif
This has the downside of being repetitive and thereby likely to introduce mistakes.
The space inserted appears to be about \belowdisplayskip
+ \baselineskip
+ \abovedisplayskip
, so one could add negative \vspace
in the former definition.
Is space really the sum of the above? What solution is recommended for gluing code
and spec
environments?