runBinaryROperation :: 
    ROperation -- ^ input ROperation
    -> RTable  -- ^ input RTable1
    -> RTable  -- ^ input RTable2    
    -> RTable  -- ^ output RTabl
runBinaryROperation rop irtab1 irtab2 = 
    case rop of
        RInJoin    { jpred = jpredicate } -> runInnerJoin jpredicate irtab1 irtab2
        RLeftJoin  { jpred = jpredicate } -> runLeftJoin jpredicate irtab1 irtab2
        RRightJoin { jpred = jpredicate } -> runRightJoin jpredicate irtab1 irtab2
        RUnion -> runUnion irtab1 irtab2
        RInter -> runIntersect irtab1 irtab2
        RDiff  -> runDiff irtab1 irtab2  
        RBinOp { rbinOp = bop } -> bop irtab1 irtab2      


-- * #########  Construction ##########

-- | Test whether an RTable is empty
runBinaryROperation :: 
    ROperation -- ^ input ROperation
    -> RTable  -- ^ input RTable1
    -> RTable  -- ^ input RTable2    
    -> RTable
runBinaryROperation rop irtab1 irtab2 = 
    case rop of
        RInJoin    { jpred = jpredicate } -> runInnerJoin jpredicate irtab1 irtab2
        RLeftJoin  { jpred = jpredicate } -> runLeftJoin jpredicate irtab1 irtab2
        RRightJoin { jpred = jpredicate } -> runRightJoin jpredicate irtab1 irtab2
        RUnion -> runUnion irtab1 irtab2
        RInter -> runIntersect irtab1 irtab2
        RDiff  -> runDiff irtab1 irtab2  
        RBinOp { rbinOp = bop } -> bop irtab1 irtab2      


-- * #########  Construction ##########

-- | Test whether an RTable is empty
runBinaryROperation rop irtab1 irtab2 = 
    case rop of
        RInJoin    { jpred = jpredicate } -> runInnerJoin jpredicate irtab1 irtab2
        RLeftJoin  { jpred = jpredicate } -> runLeftJoin jpredicate irtab1 irtab2
        RRightJoin { jpred = jpredicate } -> runRightJoin jpredicate irtab1 irtab2
        RUnion -> runUnion irtab1 irtab2
        RInter -> runIntersect irtab1 irtab2
        RDiff  -> runDiff irtab1 irtab2  
        RBinOp { rbinOp = bop } -> bop irtab1 irtab2      


-- * #########  Construction ##########

-- | Test whether an RTable is empty