[Haskell-cafe] Statically checked overloaded strings

Merijn Verstraaten merijn at inconsistent.nl
Thu Nov 14 09:37:47 UTC 2019


I proposed a static validation for partial conversions from all sorts of polymorphic literals. At the time it was rejected (I don't really recall why), so I ended up implementing something along these lines as a library: https://hackage.haskell.org/package/validated-literals

Which has the benefit that users don't have to deal with writing TH themselves, you can just write a regular pure conversion function.

Cheers,
Merijn

> On 13 Nov 2019, at 23:53, Christopher Done <chrisdone at gmail.com> wrote:
> 
> Hi all,
> 
> I just came up with this neat trick for adding static checks to overloaded strings: https://gist.github.com/chrisdone/809296b769ee36d352ae4f8dbe89a364
> 
> Hope it's helpful.
> 
> I wonder whether the GHC devs would be open to a small patch to permit: $$"..."
> 
> :-)
> 
> Cheers,
> 
> Chris
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20191114/a33db2a8/attachment.sig>


More information about the Haskell-Cafe mailing list