On 07/12/2013 02:03 AM, John Lato wrote:I appreciate that! :) I, too, enjoy playing the devil's advocate.
In all seriousness, I'm not that fond of the proposal myself. I just wanted to argue the other side because nobody else was.
There is a difference between type-classing `fmap` and type-classing string literals. `fmap` has laws governing its behavior that preserve a certain intuition and keep the instance writer on the straight and narrow path.
But so far, I've seen two main arguments against the proposal:
1. IsString is for things that are notionally some sort of string.
2. It makes the types more confusing.
The second seems like a weak argument to me. First off, the proposal seems very similar to the recent generalization of Prelude.map, which had a great deal of support.
Speaking of which, it would be an improvement if `fromString` instances some sort of functor laws, even if they were not totally rigorous and the destination category is changing on an instance-by-instance basis. For example, the `String`/`Text`/`ByteString` instances for `fromString` should obey (or *mostly* obey) these laws:
fromString (str1 <> str2) = fromString str1 <> fromString str2 :: Vector Char/Text/ByteString
fromString mempty = mempty