Update base for latest Safe Haskell.
[packages/base.git] / Data / String.hs
1 {-# LANGUAGE Trustworthy #-}
2 {-# LANGUAGE CPP, NoImplicitPrelude, FlexibleInstances #-}
3
4 -----------------------------------------------------------------------------
5 -- |
6 -- Module : Data.String
7 -- Copyright : (c) The University of Glasgow 2007
8 -- License : BSD-style (see the file libraries/base/LICENSE)
9 --
10 -- Maintainer : libraries@haskell.org
11 -- Stability : experimental
12 -- Portability : portable
13 --
14 -- The @String@ type and associated operations.
15 --
16 -----------------------------------------------------------------------------
17
18 module Data.String (
19 String
20 , IsString(..)
21
22 -- * Functions on strings
23 , lines
24 , words
25 , unlines
26 , unwords
27 ) where
28
29 #ifdef __GLASGOW_HASKELL__
30 import GHC.Base
31 #endif
32
33 import Data.List (lines, words, unlines, unwords)
34
35 -- | Class for string-like datastructures; used by the overloaded string
36 -- extension (-foverloaded-strings in GHC).
37 class IsString a where
38 fromString :: String -> a
39
40 #ifndef __NHC__
41 instance IsString [Char] where
42 fromString xs = xs
43 #endif
44