Typing & composability issue
Open
Nobody has claimed this yet.
enhancement
typing
- Dominant language
- OCaml
- Stars
- 179
- Forks
- 63
- Avg merge
- 5h
- Merged PRs (30d)
- 22
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OCaml reproduction in the issue, especially the a_or_button definition and the final page call, then inspect the linked type-checking error. Determine why the composed anchor-or-button value is rejected while each direct value succeeds. Done means the final example typechecks without regressing the two preceding examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100