[Haskell-cafe] Type checking string literal in Haskell?

KwangYul Seo kwangyul.seo at gmail.com
Sat Mar 1 12:35:09 UTC 2014

In Java, the Checker Framework (
http://types.cs.washington.edu/checker-framework/) provides a way to type
check string literals. For example, Java signatures type system
differentiates strings literals in different forms:

1. Unqualified strings :
"Hello, world!" -> @Unqualified String

2. Fully qualified names:
"package.Outer.Inner" -> @FullyQualifiedString String

3. Binary names:
"package.Outer$Inner" -> @BinaryName String

4. Field descriptors:
"Lpackage/Outer$Inner;" -> @FieldDescriptor String

It can do the similar checks with regular expressions or SQL statements.

Is it possible to type check string literals in Haskell? I think it would
be nice if we can check if a given string literal is a valid URL or an
email address at compile time.

Kwang Yul Seo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140301/22b76238/attachment.html>

More information about the Haskell-Cafe mailing list