Maybe I don't have /etc/doas.conf set up correctly, but using doas to install pandoc 2.2.1 on OpenBSD using the instructions on https://deftly.net/posts/2017-10-12-using-cabal-on-openbsd.html by @qbit didn't work for me. I kept getting out of memory issues no matter what I did with /etc/login.conf and ulimit.
I don't recall having this trouble with Pandoc 1.x, but no matter. Running "cabal install pandoc" as root and adding symlinks from /usr/local/cabal/bin/ to /usr/local/bin/ was what worked for me.