Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] support page templates #1

Closed
wants to merge 12 commits into from

Conversation

complyue
Copy link
Collaborator

@complyue complyue commented Jun 3, 2024

This is very work-in-progress (I made some mod for it to compile by 3.1.1, a cleaner PR should be drafted after 3.1.2 is released), I created it as a PR only for a better context in asking your help for the way of proper typing here:

https://github.com/complyue/html/blob/cf4dd28f0ab492d28a6ef270aeeb20006d39481f/html/layout.kk#L61-L69


Template-using example here:

https://github.com/complyue/html/blob/cyue-play/examples/front.kk

@complyue
Copy link
Collaborator Author

complyue commented Jun 3, 2024

https://github.com/complyue/html/blob/cca192b0be4cb5a15e98c27d9f813908fb998219/html/layout.kk#L63-L71

pub alias html-tmpl = <
  page-title,
  body-begin-scripts,
  body-content,
  body-end-scripts
>
/*
effects do not match
  inferred effect: <body-begin-scripts,body-content,body-end-scripts,page-title|$e>
  expected effect: <html-tmpl,html-builder/html-tree|$e>
*/
  create-component
    html
      page-head(page)()
      page-body(page)()

Does it seem like a Koka typing bug?

@TimWhiting
Copy link
Member

TimWhiting commented Jun 3, 2024

I think this gets you what you want?
https://github.com/koka-community/html/tree/cyue-play-fix

I tried just fixing the effect annotation, but ended up having to change some more to actually get it to work.

Part of the issue is that there are a few apis that would require bidirectional effects https://dl.acm.org/doi/abs/10.1145/3428207.

@complyue
Copy link
Collaborator Author

complyue commented Jun 4, 2024

Thanks for the info!

But I don't see more commits in cyue-play-fix branch atm, maybe you forget to push your local changes?

So is bidirectional effects currently supported by Koka?

@complyue complyue mentioned this pull request Jun 4, 2024
@complyue
Copy link
Collaborator Author

complyue commented Jun 4, 2024

Please use #2 for further discussion, closing this one.

@complyue complyue closed this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants