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