Add Data.String, containing IsString(fromString); trac proposal #1126
[ghc-base.git] / Data / String.hs
1 {-# OPTIONS_GHC -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
3 -- |
4 -- Module      :  Data.String
5 -- Copyright   :  (c) The University of Glasgow 2007
6 -- License     :  BSD-style (see the file libraries/base/LICENSE)
7 --
8 -- Maintainer  :  libraries@haskell.org
9 -- Stability   :  experimental
10 -- Portability :  portable
11 --
12 -- Things related to the String type.
13 --
14 -----------------------------------------------------------------------------
15
16 module Data.String (
17    IsString(..)
18  ) where
19
20 #ifdef __GLASGOW_HASKELL__
21 import GHC.Base
22 #endif
23
24 -- | Class for string-like datastructures; used by the overloaded string
25 --   extension (-foverloaded-strings in GHC).
26 class IsString a where
27     fromString :: String -> a
28
29 instance IsString [Char] where
30     fromString xs = xs
31