Literals and XOverloadedStrings
It is troublesome to use the pack function every time to create data of a target type from a string literal. So GHC provides extensions that allow you to create target types directly from string literals. The IsString class provided in the Data.String module and OverloadedStrings which is a function to extend the type of string literals from String type to arbitrary type that has class instance of IsString .
The fromString method of the IsString class is a function that defines the conversion from literally String to a type which is an instance of the IsString class.
Programmers who use library authors and types define IsString class instances and fromString methods and specify OverloadedStrings in the -X * or LANGUAGE directive, so that other literals such as numeric literals Similarly, string literals can be overloaded to various types and used
GHC supports overloading of string literals. Normally, string literals have type String, but if you enable overloading of string literals (with - XOverloadedStrings), string literals will have type of (IsString a) => a.
This means that you can write string types like ByteString, Text and others using regular string syntax. String literals behave much like integer literals. That is, it can be used in both expressions and patterns. When a literal is used in a pattern, it is replaced with a test for equality in the same way as an integer literal.
Useful links (Japanese)