If you're using lhs2TeX (which you seem to be), then you can hide code from LaTeX by using lhs2TeX conditionals:
%if False
> code seen by Haskell but not typeset
> -- comment that is not typeset
%endif
> code seen by Haskell and typeset
> -- comment that will be typeset
As Daniel Wagner suggests in his comment, another option is to prefix complete lines with %
to turn them into LaTeX comments.
lhs2TeX will always treat comments as LaTeX text, but it will in addition perform preprocessing. So using a %
on a line with a comment (as in -- %
) is not going to work, because the %
will be ending up in the middle of partially relevant code in the generated TeX file and trigger errors.