If really, you could do something like:
sfoo="$(declare -f foo)";sfoo=${sfoo#*\{} sfoo=${sfoo%$'\n\}'};fzf --preview "zsh <(echo '${sfoo%\}}') {}"
(Feel free to replace zsh with bash! I've tested this with a more complex function, this work under
bash and
zsh!)