projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5ba5975
)
Add Data instance for PackedString; patch from greenrd in trac #1263
author
Ian Lynagh
<igloo@earth.li>
Tue, 29 May 2007 20:54:20 +0000
(20:54 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Tue, 29 May 2007 20:54:20 +0000
(20:54 +0000)
Data/PackedString.hs
patch
|
blob
|
history
diff --git
a/Data/PackedString.hs
b/Data/PackedString.hs
index
1160d34
..
50d6b00
100644
(file)
--- a/
Data/PackedString.hs
+++ b/
Data/PackedString.hs
@@
-79,6
+79,7
@@
import Data.Array.Unboxed
import Data.Array.IO
import Data.Typeable
import Data.Char
import Data.Array.IO
import Data.Typeable
import Data.Char
+import Data.Generics
import System.IO
import System.IO
@@
-432,3
+433,11
@@
splitWithPS p =
joinPS sep = concatPS . intersperse sep
#endif
joinPS sep = concatPS . intersperse sep
#endif
+
+instance Data PackedString where
+ gunfold k z c = error "gunfold"
+ toConstr (PS _) = con_PS
+ dataTypeOf _ = ty_PackedString
+
+con_PS = mkConstr ty_PackedString "PS" [] Prefix
+ty_PackedString = mkDataType "Data.PackedString.PackedString" [con_PS]