prettyMod :: FileModule -> ModBindBase Info VName -> Maybe (DocM Html)
prettyMod fm (ModBind name ps sig _me doc _)
  | Just env <- M.lookup name modtable
  , visible Term name fm = Just $ div ! A.class_ "mod" <$> do
    vname <- vnameHtmlM Term name
    params <- modParamHtml ps
    s <- case sig of Nothing -> envSig env
                     Just (s,_) -> renderSigExp s
    return $ renderDoc doc <> "module " <> vname <> ": " <> params <> s
    where FileModule Env { envModTable = modtable} _ = fm
          envSig (ModEnv e) = renderEnv e
          envSig (ModFun (FunSig _ _ (MTy _ m))) = envSig m
prettyMod :: FileModule -> ModBindBase Info VName -> Maybe (DocM Html)
prettyMod fm (ModBind name ps sig _me doc _)
  | Just env <- M.lookup name modtable
  , visible Term name fm = Just $ div ! A.class_ "mod" <$> do
    vname <- vnameHtmlM Term name
    params <- modParamHtml ps
    s <- case sig of Nothing -> envSig env
                     Just (s,_) -> renderSigExp s
    return $ renderDoc doc <> "module " <> vname <> ": " <> params <> s
    where FileModule Env { envModTable = modtable} _ = fm
          envSig (ModEnv e) = renderEnv e
          envSig (ModFun (FunSig _ _ (MTy _ m))) = envSig m
prettyMod fm (ModBind name ps sig _me doc _)
  | Just env <- M.lookup name modtable
  , visible Term name fm = Just $ div ! A.class_ "mod" <$> do
    vname <- vnameHtmlM Term name
    params <- modParamHtml ps
    s <- case sig of Nothing -> envSig env
                     Just (s,_) -> renderSigExp s
    return $ renderDoc doc <> "module " <> vname <> ": " <> params <> s
    where FileModule Env { envModTable = modtable} _ = fm
          envSig (ModEnv e) = renderEnv e
          envSig (ModFun (FunSig _ _ (MTy _ m))) = envSig m