Open
Description
open Tyxml
let page title content = [%html {|
<html>
<head>
<title>|} title {|</title>
<link rel=stylesheet href="/style.css" />
</head>
<body>|} content {|</body>
</html>
|}]
let a_or_button contents =
if true then
Html.a contents
else
Html.button contents
let _ = page [%html "foo"] [Html.a []]
let _ = page [%html "foo"] [Html.button []]
let _ = page [%html "foo"] [a_or_button []]
Surprisingly, the last line fails to typecheck, with the following error: https://paste.isomorphis.me/Tgo