[Haskell-cafe] Type checking string literal in Haskell?
jwlato at gmail.com
Mon Mar 3 23:46:01 UTC 2014
Ah yes, I'd missed the "string literal" part. In that case, I agree with
Niklas that quasi-quoters seem the best option. Although, they require
pretty much the same framework to operate (a custom data type and parser),
so once you have a quasi-quoter it's usually easy to implement dynamic
checks with the same tooling.
On Mon, Mar 3, 2014 at 12:29 PM, Richard A. O'Keefe <ok at cs.otago.ac.nz>wrote:
> On 3/03/2014, at 4:59 PM, John Lato wrote:
> > Yes. In Haskell, types are your friends. You should define new types
> I believe the original poster was asking about a *static* check.
> Newtypes with "smart constructors" are a good way to plug in
> a *dynamic* check, which is valuable but different.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe