How to import functions from a bash script?

Consider the following in your shell script ~/bin/libary:

lol() {
      echo LOL
export -f lol

Now in ~/bin/the_hard_stuff, you can use your previously defined library function lol like:

. ~/bin/library # "import module"
lol             # simply refer to the exported function

Now you know how to write reusable scripts, go and hack.