specHtml :: SpecBase Info VName -> DocM Html
specHtml spec = case spec of
  TypeAbbrSpec tpsig -> H.div <$> typeBindHtml tpsig
  TypeSpec name ps doc _ -> return . H.div $
    renderDoc doc <> "type " <> vnameHtml name <>
    joinBy " " (map prettyTypeParam ps)
  ValSpec name tparams params rettype doc _ -> return . H.div $
    renderDoc doc <>
    "val " <> vnameHtml name <>
    foldMap (" " <>) (map prettyTypeParam tparams) <> " : " <>
    foldMap (\tp -> paramBaseHtml tp <> " -> ") params <>
    typeDeclHtml rettype
  ModSpec name sig _ ->
    do m <- vnameHtmlM Term name
       s <- renderSigExp sig
       return $ "module " <> m <> ": "<> s
  IncludeSpec e _ -> H.div . ("include " <>) <$> renderSigExp e
specHtml :: SpecBase Info VName -> DocM Html
specHtml spec = case spec of
  TypeAbbrSpec tpsig -> H.div <$> typeBindHtml tpsig
  TypeSpec name ps doc _ -> return . H.div $
    renderDoc doc <> "type " <> vnameHtml name <>
    joinBy " " (map prettyTypeParam ps)
  ValSpec name tparams params rettype doc _ -> return . H.div $
    renderDoc doc <>
    "val " <> vnameHtml name <>
    foldMap (" " <>) (map prettyTypeParam tparams) <> " : " <>
    foldMap (\tp -> paramBaseHtml tp <> " -> ") params <>
    typeDeclHtml rettype
  ModSpec name sig _ ->
    do m <- vnameHtmlM Term name
       s <- renderSigExp sig
       return $ "module " <> m <> ": "<> s
  IncludeSpec e _ -> H.div . ("include " <>) <$> renderSigExp e
specHtml spec = case spec of
  TypeAbbrSpec tpsig -> H.div <$> typeBindHtml tpsig
  TypeSpec name ps doc _ -> return . H.div $
    renderDoc doc <> "type " <> vnameHtml name <>
    joinBy " " (map prettyTypeParam ps)
  ValSpec name tparams params rettype doc _ -> return . H.div $
    renderDoc doc <>
    "val " <> vnameHtml name <>
    foldMap (" " <>) (map prettyTypeParam tparams) <> " : " <>
    foldMap (\tp -> paramBaseHtml tp <> " -> ") params <>
    typeDeclHtml rettype
  ModSpec name sig _ ->
    do m <- vnameHtmlM Term name
       s <- renderSigExp sig
       return $ "module " <> m <> ": "<> s
  IncludeSpec e _ -> H.div . ("include " <>) <$> renderSigExp e