h***@gmail.com
2017-07-01 18:35:40 UTC
Hi everyone.
It's been some time that I'm thinking about type checking HTML Attributes to ensure at compile time that useless attributes can't be set on HTML. For instance, it makes no sense to set Html.Attributes.src to an h1 title.
I was imagining simple cases :
Html.a [ Html.Attributes.href "#" ] [] => compile
Html.a [ Html.Attributes.src "#" ] [] => does not compile
Html.img [ Html.Attributes.src "#"] [] => compile
Html.iframe [ Html.Attributes.src "#" ] [] => compile
Obviously, this behavior should be extended to every attributes on every HTML elements. ð
I was thinking about Phantom Types, but I can't figure a correct way to do it.
Anyone has an idea on what I should give a try?
Just in case, I know the cost to do it will probably be higher than what it actually, but, hey! Error checking at compile time is so good that no trying it would be too bad!
It's been some time that I'm thinking about type checking HTML Attributes to ensure at compile time that useless attributes can't be set on HTML. For instance, it makes no sense to set Html.Attributes.src to an h1 title.
I was imagining simple cases :
Html.a [ Html.Attributes.href "#" ] [] => compile
Html.a [ Html.Attributes.src "#" ] [] => does not compile
Html.img [ Html.Attributes.src "#"] [] => compile
Html.iframe [ Html.Attributes.src "#" ] [] => compile
Obviously, this behavior should be extended to every attributes on every HTML elements. ð
I was thinking about Phantom Types, but I can't figure a correct way to do it.
Anyone has an idea on what I should give a try?
Just in case, I know the cost to do it will probably be higher than what it actually, but, hey! Error checking at compile time is so good that no trying it would be too bad!
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.