Order loaded modules by amount of functions
Breaking the problem into tiny, useful functions is a very good way to write Erlang code. So your code is easy to read and gives us a great start in understanding and analyzing it.

The one thing I notice is that, in loaded_modules_with_functions, you map a function over a list and then map a function on the resulting list. This creates an intermediate list which will just be thrown away (GCed.) I'd combine the two operations so there's only one pass through the list. Since the result of this function is the resulting list, I'd use a list comprehension:

loaded_modules_with_functions() -&gt;
  [ extract_functions_from_module(ModName) || {ModName, _} &lt;- code:all_loaded() ].


In extract_functions_from_module, you're making an assumption that the export list is always the second element. Maybe this is the case. Or maybe in your OTP release this is always the case. The next release, however, may break your code if module_info adds more information. You can use the proplists module (in the standard library) to generalize the look-up:

extract_functions_from_module(ModuleName) -&gt;
  {ModuleName, proplists:get_value(exports, ModuleName:module_info(), [])}.


Finally, I'd put a list comprehension at the end of modules_ordered_by_amount_of_functions and inline extract_amount_of_functions.