-- | Load the module contained in the given file.
loadModuleByPath :: FilePath -> ModuleCmd T.Module
loadModuleByPath path env = runModuleM (resetModuleEnv env) $ do
  -- unload the module if it already exists
  unloadModule path

  m <- Base.loadModuleByPath path
  setFocusedModule (T.mName m)
  return m

-- | Load the given parsed module.
loadModuleByPath :: FilePath -> ModuleCmd T.Module
loadModuleByPath path env = runModuleM (resetModuleEnv env) $ do
  -- unload the module if it already exists
  unloadModule path

  m <- Base.loadModuleByPath path
  setFocusedModule (T.mName m)
  return m

-- | Load the given parsed module.
loadModuleByPath path env = runModuleM (resetModuleEnv env) $ do
  -- unload the module if it already exists
  unloadModule path

  m <- Base.loadModuleByPath path
  setFocusedModule (T.mName m)
  return m

-- | Load the given parsed module.