typeExpHtml :: TypeExp VName -> Html
typeExpHtml e = case e of
  TEUnique t _  -> "*" >> typeExpHtml t
  TEArray at d _ -> brackets (prettyDimDecl d) <> typeExpHtml at
  TETuple ts _ -> parens $ commas (map typeExpHtml ts)
  TERecord fs _ -> braces $ commas (map ppField fs)
    where ppField (name, t) = toHtml (nameToString name) <>
            "=" <> typeExpHtml t
  TEVar name  _ -> qualNameHtml name
  TEApply t args _ ->
    qualNameHtml t <> foldMap (" " <>) (map prettyTypeArgExp args)
typeExpHtml :: TypeExp VName -> Html
typeExpHtml e = case e of
  TEUnique t _  -> "*" >> typeExpHtml t
  TEArray at d _ -> brackets (prettyDimDecl d) <> typeExpHtml at
  TETuple ts _ -> parens $ commas (map typeExpHtml ts)
  TERecord fs _ -> braces $ commas (map ppField fs)
    where ppField (name, t) = toHtml (nameToString name) <>
            "=" <> typeExpHtml t
  TEVar name  _ -> qualNameHtml name
  TEApply t args _ ->
    qualNameHtml t <> foldMap (" " <>) (map prettyTypeArgExp args)
typeExpHtml e = case e of
  TEUnique t _  -> "*" >> typeExpHtml t
  TEArray at d _ -> brackets (prettyDimDecl d) <> typeExpHtml at
  TETuple ts _ -> parens $ commas (map typeExpHtml ts)
  TERecord fs _ -> braces $ commas (map ppField fs)
    where ppField (name, t) = toHtml (nameToString name) <>
            "=" <> typeExpHtml t
  TEVar name  _ -> qualNameHtml name
  TEApply t args _ ->
    qualNameHtml t <> foldMap (" " <>) (map prettyTypeArgExp args)