default instance for IsString

Simon Peyton-Jones simonpj at
Tue Apr 24 10:04:38 CEST 2012

I'm not following the details of this thread, but if you guys can come to a conclusion and write up a design, I'd be happy to discuss it.

If you want validation of literal strings, then TH quasiquotes are the way to go:

	[url| http://this/that |]

will let you specify the parser/validator to use ("url" in this case) and allow any error messages to be delivered in a civilised way at compile time.

I don't really want to make "http://this/that" have exactly this semantics; apart from anything else, which parser do you mean.  This is what TH quasiquotation is *for*.


| -----Original Message-----
| From: glasgow-haskell-users-bounces at [mailto:glasgow-haskell-
| users-bounces at] On Behalf Of Yitzchak Gale
| Sent: 24 April 2012 07:46
| To: J. Garrett Morris
| Cc: GHC users
| Subject: Re: default instance for IsString
| J. Garrett Morris wrote:
| > By this logic, head is "unsound", since head [] throws an error.
| > Haskell types are pointed; Haskell computations can diverge.
| Well, there are those who would actually agree with that and banish 'head'
| and friends from the language.
| But I'll agree with you here.
| [As an aside - I'm finding that liberal use of Edward's non-empty list type,
| found in the semigroups package, solves many of those problems for me.]
| But there are two crucial differences. First, head is just a partial
| function, not basic language syntax.
| Second, the divergence of head is constant and well-known, and not dependent
| on the implementation of a type class at particular types by various library
| authors.
| >  What happens after the computation diverges is irrelevant to type
| > soundness.
| Agreed. I'm not talking about type soundness, in the technical sense. I'm
| talking about engineering soundness.
| Thanks,
| Yitz
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list