default instance for IsString

Simon Marlow marlowsd at gmail.com
Tue Apr 24 18:08:50 CEST 2012


On 24/04/2012 15:19, Yitzchak Gale wrote:
> Simon Marlow wrote:
>> In this thread people are using the term "safe" to
>> mean "total".  We already overload "safe" too much, might it be a better
>> idea to use "total" instead?
>
> I'm not sure what you're talking about. I don't see how
> this thread has anything to do with total vs. partial
> functions.

My apologies if I've misunderstood, but the problem that people seem to 
be worried about is fromString failing at runtime (i.e. it is a partial 
function), and this has been referred to as "unsafe".

> I'm saying that the static syntax of string literals should
> be checked at compile time, not at run time. Isn't that
> simple enough, and self-evident?

Well, the syntax of overloaded integers isn't checked at compile time, 
so why should strings be special?

I'm not arguing in favour of using OverloadedStrings for URLs or 
anything like that, but I'm not sure I see why it's bad for Text and 
ByteString.

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list