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

Figure out a better way to work with templates #124

Open
Martinsos opened this issue Nov 5, 2020 · 0 comments
Open

Figure out a better way to work with templates #124

Martinsos opened this issue Nov 5, 2020 · 0 comments
Labels
haskell refactoring Keeping that code clean!

Comments

@Martinsos
Copy link
Member

Martinsos commented Nov 5, 2020

Right now we are using https://hackage.haskell.org/package/mustache, but our surface between Haskell and templates is pretty loose type-wise (because we are passing Aeson objects), creating space for runtime errors. Plan is to either define data types that precisely describe each template (but we still have to ensure they correctly describe the templates) or (would be better) to find another mechanism for templates that is somehow better integrated with Haskell - maybe it creates types based on template content, while compiling them, and you have to use those types then - hm how would that work is that even possible?

I found this https://hackage.haskell.org/package/shakespeare -> I think this might be what we are looking for.
Although, it seems like shakespear demands templates to be either HTML, CSS or JS -> it is not as flexible as we would like it to be, it is meant more to be used as part of web framework.
In our case, these might make more sense:
https://hackage.haskell.org/package/heterocephalus or https://hackage.haskell.org/package/haiji .

So far, heterocephalus sounds most promising.
Dhall might also be interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
haskell refactoring Keeping that code clean!
Projects
None yet
Development

No branches or pull requests

1 participant