Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 52 lines (42 sloc) 1.259 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude, FlexibleInstances #-}

-----------------------------------------------------------------------------
-- |
-- Module : Data.String
-- Copyright : (c) The University of Glasgow 2007
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : experimental
-- Portability : portable
--
-- The @String@ type and associated operations.
--
-----------------------------------------------------------------------------

module Data.String (
   String
 , IsString(..)

 -- * Functions on strings
 , lines
 , words
 , unlines
 , unwords
 ) where

#ifdef __GLASGOW_HASKELL__
import GHC.Base
#endif

#ifdef __UHC__
import UHC.Base
#endif

import Data.List (lines, words, unlines, unwords)

-- | Class for string-like datastructures; used by the overloaded string
-- extension (-foverloaded-strings in GHC).
class IsString a where
    fromString :: String -> a

instance IsString [Char] where
    fromString xs = xs

#ifdef __UHC_TARGET_JS__
foreign import prim "primStringToPackedString" primStringToPackedString :: String -> PackedString

instance IsString PackedString where
    fromString = primStringToPackedString
#endif
Something went wrong with that request. Please try again.