packages feed

hmemdb 0.1.0.4 → 0.1.0.5

raw patch · 3 files changed

+5/−7 lines, 3 files

Files

hmemdb.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                hmemdb
-version:             0.1.0.4
+version:             0.1.0.5
 synopsis:            In-memory relational database
 description:         Library that provides a sort of relational database in memory (which could be saved to the disk, however). Very untested.
 license:             BSD3
src/Data/HMemDb.hs view
@@ -14,7 +14,7 @@      selectAll,
      ForeignKey, keyTarget,
 -- * Ids
-     TableVarId, idToVar, varToId, tableIds,
+     TableVarId, idToVar, varToId, tvIdTarget, tableIds,
 -- * Specs
      FullSpec(FullSpec, keySpec, tabSpec),
 -- ** Table specs
@@ -41,7 +41,7 @@      Keys(Keys), KeySpec, TableSpec(TableSpec),
      key, nonunique, val, unique, (:+:)((:+:)))
 import Data.HMemDb.Tables (Table, foldTable_)
-import Data.HMemDb.TableVarId (TableVarId, idToVar, varToId, tableIds)
+import Data.HMemDb.TableVarId (TableVarId, idToVar, tableIds, tvIdTarget, varToId)
 import Data.HMemDb.TableVars
     (TableVar, TableVarS,
      deleteTV, forTV, insert, modifyTV, readTV, selectAll, tableVarTarget)
src/Data/HMemDb/TableVars.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE GADTs #-}
 module Data.HMemDb.TableVars 
     (TableVar, TableVarS(TableVar),
-     deleteTV, forTV, getVarId, insert, modifyTV, readTV, selectAll, tableVarTarget) where
+     deleteTV, forTV, insert, modifyTV, readTV, selectAll, tableVarTarget) where
 import Control.Applicative (Applicative)
 import Control.Concurrent.STM (STM, readTVar)
 import Control.Compose (Id(Id), unId)
@@ -9,7 +9,7 @@ import Data.Foldable (Foldable, for_)
 import Data.Map (toAscList)
 import Data.Set (Set, fromAscList)
-import Data.HMemDb.Bin(Bin, IsId(isId))
+import Data.HMemDb.Bin(Bin)
 import Data.HMemDb.Binary (MS)
 import Data.HMemDb.RefConverter (rcTo)
 import Data.HMemDb.References (Ref(Ref, refContent, refIndex), deRef)
@@ -22,8 +22,6 @@ type TableVar = TableVarS Id
 -- ^ This type represents references to individual values in the table.
 -- It is returned by 'insert' and 'Data.HMemDb.select' functions.
-getVarId :: IsId s => TableVarS s a -> Integer
-getVarId (TableVar s _) = refIndex $ isId s
 tableVarTarget :: TableVarS s a -> Table a
 -- ^ This function returns the 'Table' that the 'TableVar' is from.
 tableVarTarget (TableVar _ pt) = Table pt