gameServer/Store.hs
changeset 3435 4e4f88a7bdf2
parent 3425 ead2ed20dfd4
child 3501 a3159a410e5c
equal deleted inserted replaced
3434:6af73e7f2438 3435:4e4f88a7bdf2
    21 import Data.IORef
    21 import Data.IORef
    22 import Control.Monad
    22 import Control.Monad
    23 
    23 
    24 
    24 
    25 newtype ElemIndex = ElemIndex Int
    25 newtype ElemIndex = ElemIndex Int
    26     deriving (Eq)
    26     deriving (Eq, Show, Read)
    27 newtype MStore e = MStore (IORef (IntSet.IntSet, IntSet.IntSet, IOA.IOArray Int e))
    27 newtype MStore e = MStore (IORef (IntSet.IntSet, IntSet.IntSet, IOA.IOArray Int e))
    28 newtype IStore e = IStore (IntSet.IntSet, IA.Array Int e)
    28 newtype IStore e = IStore (IntSet.IntSet, IA.Array Int e)
    29 
    29 
    30 instance Show ElemIndex where
       
    31     show (ElemIndex i) = 'i' : show i
       
    32 
    30 
    33 firstIndex :: ElemIndex
    31 firstIndex :: ElemIndex
    34 firstIndex = ElemIndex 0
    32 firstIndex = ElemIndex 0
    35 
    33 
    36 -- MStore code
    34 -- MStore code