diff --git a/src/language/modules/ModuleRepository.cpp b/src/language/modules/ModuleRepository.cpp
index 74a8cb2d90b6ba950d3ac241f8750b7044c19c5d..557947aadcdecc57e58a9b83e9dddef95dfefddd 100644
--- a/src/language/modules/ModuleRepository.cpp
+++ b/src/language/modules/ModuleRepository.cpp
@@ -19,6 +19,7 @@
 #include <utils/PugsAssert.hpp>
 
 #include <algorithm>
+#include <set>
 
 void
 ModuleRepository::_subscribe(std::unique_ptr<IModule> m)
@@ -219,20 +220,31 @@ ModuleRepository::getModuleInfo(const std::string& module_name) const
     os << rang::fgB::yellow << "Module '" << rang::fgB::blue << module_name << rang::fgB::yellow << "' provides"
        << rang::style::reset << '\n';
     const auto& builtin_function_map = i_module->second->getNameBuiltinFunctionMap();
-    if (builtin_function_map.size() > 0) {
+    std::map<std::string, std::pair<std::string, std::string>> sorted_builtin_function_map;
+    for (auto& [mangled_name, function] : builtin_function_map) {
+      sorted_builtin_function_map[mangled_name] =
+        std::make_pair(dataTypeName(function->getParameterDataTypes()), dataTypeName(function->getReturnDataType()));
+    }
+    Assert(sorted_builtin_function_map.size() == builtin_function_map.size());
+    if (sorted_builtin_function_map.size() > 0) {
       os << "  functions\n";
-      for (auto& [mangled_name, function] : builtin_function_map) {
+      for (auto& [mangled_name, domain_to_codomain] : sorted_builtin_function_map) {
         os << "    " << rang::fgB::green << demangleBuiltinFunction(mangled_name) << rang::style::reset << ": ";
-        os << dataTypeName(function->getParameterDataTypes());
+        os << domain_to_codomain.first;
         os << rang::fgB::yellow << " -> " << rang::style::reset;
-        os << dataTypeName(function->getReturnDataType()) << '\n';
+        os << domain_to_codomain.second << '\n';
       }
     }
 
     const auto& builtin_type_map = i_module->second->getNameTypeMap();
-    if (builtin_type_map.size() > 0) {
+    std::set<std::string> sorted_builtin_type_map;
+    for (auto& [name, descriptor] : builtin_type_map) {
+      sorted_builtin_type_map.insert(name);
+    }
+    Assert(sorted_builtin_type_map.size() == builtin_type_map.size());
+    if (sorted_builtin_type_map.size() > 0) {
       os << "  types\n";
-      for (auto& [name, descriptor] : builtin_type_map) {
+      for (auto& name : sorted_builtin_type_map) {
         os << "    " << rang::fgB::green << name << rang::style::reset << '\n';
       }
     }