
On Fri, Dec 08, 2023 at 04:50:58PM +0100, Max Ulidtko wrote:
And overall, to zoom out of "XY Problem" pitfalls: am I missing a neater way to have "partial" IsString instances, those that can reject some literals at compile-time?
Having this code work is the goal:
text1, text2 :: NonEmptyText text1 = "hello, types" text2 = "" -- compile error
Is at TH splice too cumbersome? text1, text2 :: NonEmptyText text1 = $$(neTxt "hello, types") text = $$(neTxt "") -- compile error I am validating DNS domain name literals at compile time, where checks include full DNS syntax validation with no empty labels, no labels longer than 63 bytes, and overall wire length at most 255 bytes. https://github.com/dnsbase/dnsbase/blob/548270f2e575949592ca3f1e40c58edc450b... -- Viktor.