{-------------------------------------------
Some operations on a Db
--------------------------------------------}

-- takes a row and a column and returns the value
vlookup :: (Eq a, Read a) => Db a -> String -> String -> Maybe (Value a)
vlookup db id colname = select (CellName colname) r
    where
        s1 = CellName "Id" -- the selector for the house column
        v = map Char id -- the value
        r = head $ exec [(s1,v)] db -- gets just the row for the house

-- if Just 1.0, goes to TRUE otherwise FALSE
vlookup :: (Eq a, Read a) => Db a -> String -> String -> Maybe (Value a)
vlookup db id colname = select (CellName colname) r
    where
        s1 = CellName "Id" -- the selector for the house column
        v = map Char id -- the value
        r = head $ exec [(s1,v)] db -- gets just the row for the house

-- if Just 1.0, goes to TRUE otherwise FALSE
vlookup db id colname = select (CellName colname) r
    where
        s1 = CellName "Id" -- the selector for the house column
        v = map Char id -- the value
        r = head $ exec [(s1,v)] db -- gets just the row for the house

-- if Just 1.0, goes to TRUE otherwise FALSE