renderSigExp :: SigExpBase Info VName -> DocM Html
renderSigExp e = case e of
  SigVar v _ -> renderQualName Signature v
  SigParens e' _ -> parens <$> renderSigExp e'
  SigSpecs ss _ -> braces . (div ! A.class_ "specs") . mconcat <$> mapM specHtml ss
  SigWith s (TypeRef v t) _ ->
    do e' <- renderSigExp s
       --name <- renderQualName Type v
       return $ e' <> " with " <> prettyQualName v <>
         " = "  <> typeDeclHtml t
  SigArrow Nothing e1 e2 _ ->
    liftM2 f (renderSigExp e1) (renderSigExp e2)
    where f e1' e2' = e1' <> " -> " <> e2'
  SigArrow (Just v) e1 e2 _ ->
    do name <- vnameHtmlM Signature v
       e1' <- renderSigExp e1
       e2' <- renderSigExp e2
       return $ "(" <> name <> ": " <>
         e1' <> ") -> " <> e2'
renderSigExp :: SigExpBase Info VName -> DocM Html
renderSigExp e = case e of
  SigVar v _ -> renderQualName Signature v
  SigParens e' _ -> parens <$> renderSigExp e'
  SigSpecs ss _ -> braces . (div ! A.class_ "specs") . mconcat <$> mapM specHtml ss
  SigWith s (TypeRef v t) _ ->
    do e' <- renderSigExp s
       --name <- renderQualName Type v
       return $ e' <> " with " <> prettyQualName v <>
         " = "  <> typeDeclHtml t
  SigArrow Nothing e1 e2 _ ->
    liftM2 f (renderSigExp e1) (renderSigExp e2)
    where f e1' e2' = e1' <> " -> " <> e2'
  SigArrow (Just v) e1 e2 _ ->
    do name <- vnameHtmlM Signature v
       e1' <- renderSigExp e1
       e2' <- renderSigExp e2
       return $ "(" <> name <> ": " <>
         e1' <> ") -> " <> e2'
renderSigExp e = case e of
  SigVar v _ -> renderQualName Signature v
  SigParens e' _ -> parens <$> renderSigExp e'
  SigSpecs ss _ -> braces . (div ! A.class_ "specs") . mconcat <$> mapM specHtml ss
  SigWith s (TypeRef v t) _ ->
    do e' <- renderSigExp s
       --name <- renderQualName Type v
       return $ e' <> " with " <> prettyQualName v <>
         " = "  <> typeDeclHtml t
  SigArrow Nothing e1 e2 _ ->
    liftM2 f (renderSigExp e1) (renderSigExp e2)
    where f e1' e2' = e1' <> " -> " <> e2'
  SigArrow (Just v) e1 e2 _ ->
    do name <- vnameHtmlM Signature v
       e1' <- renderSigExp e1
       e2' <- renderSigExp e2
       return $ "(" <> name <> ": " <>
         e1' <> ") -> " <> e2'