When defining on Bash a shell function including a - in its name, a not valid identifier error is obtained:
$ ml -V
Modules Release 4.7.1 (2021-04-06)
$ cat test
#%Module
set-function foo-bar {echo foo bar}
$ ml ./test
bash: export: `foo-bar': not a valid identifier