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

Instances for ToWidget #1298

Closed
andrewthad opened this issue Nov 15, 2016 · 3 comments
Closed

Instances for ToWidget #1298

andrewthad opened this issue Nov 15, 2016 · 3 comments
Assignees

Comments

@andrewthad
Copy link
Contributor

The ToWidget typeclass could be more helpful than it currently is. Notably, there are sensible instances for Text, lazy Text, and text Builder that are not provided. I think that one objection to introducing such classes is that there is a piece of syntax in the shakespeare quasiquoter ^{..} that calls ToWidget on its argument. Adding more instances would allow the end user to feed text into this construct, which might be undesirable.

I don't use the quasiquoter for templating, so the downside of it doesn't bother me. The reason I would like these instances is because there are a number of situations where I have to call toWidget . toHtml in my code that could be abbreviated to toWidget if these instances were provided. If this change is at odds with the goals of the TH templating, then I wouldn't want to mess that up for people, but if not, I would find these instances useful.

@snoyberg
Copy link
Member

I could go either way on it. How about asking on the mailing list, and if there are no objections, sending a PR?

@andrewthad
Copy link
Contributor Author

I'm now on the mailing list, and I've asked there, so we can see what others think.

@andrewthad
Copy link
Contributor Author

As requested in the google groups conversation, I've put up a PR.

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

No branches or pull requests

2 participants