From 7b41128a0a1be91113cf635c90f5592f98b7f36c Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Mon, 20 May 2013 17:25:17 +0900 Subject: [PATCH] Update interfaces of Product module. --- .../src/Database/Relational/Query/Join.hs | 2 +- .../src/Database/Relational/Query/Product.hs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/relational-join/src/Database/Relational/Query/Join.hs b/relational-join/src/Database/Relational/Query/Join.hs index e708869a..368b543f 100644 --- a/relational-join/src/Database/Relational/Query/Join.hs +++ b/relational-join/src/Database/Relational/Query/Join.hs @@ -171,7 +171,7 @@ unsafeMergeAnother attr q1 = QueryJoin $ \st0 -> let p0 = product st0 (pj, st1) = runQueryJoin q1 (st0 { product = Nothing}) - p1 = Product.unsafeUpdateNodeAttr attr + p1 = Product.node attr . mayEmptyProduct "unsafeMergeAnother" $ product st1 in (pj, updateProduct' (const $ mergeProduct p0 p1) st1) diff --git a/relational-join/src/Database/Relational/Query/Product.hs b/relational-join/src/Database/Relational/Query/Product.hs index 58a5c405..641c48f0 100644 --- a/relational-join/src/Database/Relational/Query/Product.hs +++ b/relational-join/src/Database/Relational/Query/Product.hs @@ -1,7 +1,7 @@ module Database.Relational.Query.Product ( - NodeAttr (Just', Maybe), unsafeUpdateNodeAttr, + NodeAttr (Just', Maybe), -- unsafeUpdateNodeAttr, ProductTree, Node, QueryProduct, QueryProductNode, - growProductRight, growProductLeft, + node, growRight, growLeft, growProduct, product, restrictProduct, Product, tree, @@ -55,19 +55,19 @@ node a q = unsafeUpdateNodeAttr a q leaf :: NodeAttr -> q -> Node q leaf a q = node a (Leaf a q) -growProductRight :: Maybe (ProductTree q) -> (NodeAttr, ProductTree q) -> ProductTree q -growProductRight = d where +growRight :: Maybe (ProductTree q) -> (NodeAttr, ProductTree q) -> ProductTree q +growRight = d where d Nothing (na, q) = node na q d (Just l) (na, q) = Join Just' l (node na q) Nothing -growProductLeft :: (NodeAttr, ProductTree q) -> Maybe (ProductTree q) -> ProductTree q -growProductLeft = d where +growLeft :: (NodeAttr, ProductTree q) -> Maybe (ProductTree q) -> ProductTree q +growLeft = d where d (na, q) Nothing = node na q d (na, q) (Just r) = Join Just' (node na q) r Nothing growProduct :: Maybe (ProductTree q) -> (NodeAttr, q) -> ProductTree q growProduct = match where - match t (na, q) = growProductRight t (na, leaf na q) + match t (na, q) = growRight t (na, leaf na q) product :: NodeAttr -> ProductTree q -> ProductTree q -> Maybe (Expr Bool) -> ProductTree q