IsString [Char] instance

Herbert Valerio Riedel hvr at gnu.org
Mon May 18 10:43:08 UTC 2015


On 2015-05-18 at 02:08:04 +0200, Dan Doel wrote:
> Today, someone came into #haskell and asked why they couldn't type the
> equivalent of:
>
>     > "hi" ++ "bye"
>
> into GHCi with OverloadedStrings enabled.

A minor observation: had (s)he used <> instead, GHCi would have happily
inferred (and somewhat surprisingly reduced to a polymorphic "foobar"):

  GHCi, version 7.10.1: http://www.haskell.org/ghc/  :? for help
  λ:2> "foo" <> "bar"
  "foobar"
  it :: (Data.String.IsString m, Monoid m) => m



More information about the Libraries mailing list