on master help sign in
Derive Typeable
fa8e827Bryan O'Sullivan
Data/Text/Internal.hs+7−1
@@ -1,3 +1,5 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+
1module Data.Text.Internal
3module Data.Text.Internal
2 (
4 (
3 Text(..)
5 Text(..)
@@ -6,9 +8,13 @@ module Data.Text.Internal
6
8
7import Data.Array.ST (newArray_,runSTUArray)
9import Data.Array.ST (newArray_,runSTUArray)
8import Data.Array.Unboxed (UArray)
10import Data.Array.Unboxed (UArray)
11+import Data.Typeable (Typeable)
9import Data.Word (Word16)
12import Data.Word (Word16)
10
13
11−data Text = Text !(UArray Int Word16) {-# UNPACK #-}!Int {-# UNPACK #-}!Int
14+data Text = Text {-# UNPACK #-} !(UArray Int Word16) -- payload
15+ {-# UNPACK #-} !Int -- offset
16+ {-# UNPACK #-} !Int -- length
17+ deriving (Typeable)
12
18
13empty :: Text
19empty :: Text
14empty = Text (runSTUArray (newArray_ (0,0))) 0 0
20empty = Text (runSTUArray (newArray_ (0,0))) 0 0