X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Futils%2FFastString.lhs;h=8dbfefaa0b7690aae3b1a43b8814205c079e841e;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=d46b77599657daab35ae660248895a09d5889fbd;hpb=553e90d9a32ee1b1809430f260c401cc4169c6c7;p=ghc-hetmet.git diff --git a/ghc/compiler/utils/FastString.lhs b/ghc/compiler/utils/FastString.lhs index d46b775..8dbfefa 100644 --- a/ghc/compiler/utils/FastString.lhs +++ b/ghc/compiler/utils/FastString.lhs @@ -3,8 +3,18 @@ % \section{Fast strings} -Compact representations of character strings with -unique identifiers (hash-cons'ish). +FastString: A compact, hash-consed, representation of character strings. + Comparison is O(1), and you can get a Unique from them. + Generated by the FSLIT macro + Turn into SDoc with Outputable.ftext + +LitString: Just a wrapper for the Addr# of a C string (Ptr CChar). + Practically no operations + Outputing them is fast + Generated by the SLIT macro + Turn into SDoc with Outputable.ptext + +Use LitString unless you want the facilities of FastString \begin{code} module FastString @@ -498,7 +508,6 @@ hPutFS handle (UnicodeStr _ is) -- LitStrings, here for convenience only. type LitString = Ptr () --- ToDo: make it a Ptr when we don't have to support 4.08 any more mkLitString# :: Addr# -> LitString mkLitString# a# = Ptr a#