diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-12-22 09:06:47 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-12-23 07:46:37 +0000 |
commit | 99eb002d0813638be0967bad714d504e26021f5c (patch) | |
tree | a70280b704f934e579d71b2e9b95320812e36672 | |
parent | c069be815aa0bce2eb2c9621a36f114badda2318 (diff) | |
download | haskell-99eb002d0813638be0967bad714d504e26021f5c.tar.gz |
Comments only
-rw-r--r-- | libraries/base/Data/String.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libraries/base/Data/String.hs b/libraries/base/Data/String.hs index df410f09b1..9e1f5f340f 100644 --- a/libraries/base/Data/String.hs +++ b/libraries/base/Data/String.hs @@ -35,9 +35,8 @@ import Data.List (lines, words, unlines, unwords) class IsString a where fromString :: String -> a -{- -Note [IsString String] -~~~~~~~~~~~~~~~~~~~~~~ +{- Note [IsString String] +~~~~~~~~~~~~~~~~~~~~~~~~~ Previously, the IsString instance that covered String was a flexible instance for [Char]. This is in some sense the most accurate choice, but there are cases where it can lead to an ambiguity, for instance: @@ -74,6 +73,8 @@ would be, and it certainly hasn't been implemented. A test case (should_run/overloadedstringsrun01.hs) has been added to ensure the good behavior of the above example remains in the future. -} + instance (a ~ Char) => IsString [a] where + -- See Note [IsString String] fromString xs = xs |