on master help sign in
fix display of relations with empty tuple sets
e9350a5AgentM
RelationTerm.hs+4−4
@@ -74,12 +74,12 @@ renderTable table = renderHeader table (fst cellLocs) ++ renderBody (snd table)
74 cellLocs = cellLocations table
74 cellLocs = cellLocations table
75
75
76renderHeader :: Table -> [Int] -> String
76renderHeader :: Table -> [Int] -> String
77−renderHeader (header, body) columnLocations = renderTopBar ++ renderHeaderNames ++ renderBottomBar ++ "\n"
77+renderHeader (header, body) columnLocations = renderTopBar ++ renderHeaderNames ++ renderBottomBar
78 where
78 where
79 renderTopBar = boxTL ++ concat (L.intersperse boxTB (map (\x -> repeatString x boxH) columnLocations)) ++ boxTR ++ "\n"
79 renderTopBar = boxTL ++ concat (L.intersperse boxTB (map (\x -> repeatString x boxH) columnLocations)) ++ boxTR ++ "\n"
80 renderHeaderNames = renderRow header columnLocations 1 boxV
80 renderHeaderNames = renderRow header columnLocations 1 boxV
81 renderBottomBar = if length body == 0 then ""
81 renderBottomBar = if length body == 0 then ""
82− else renderHBar boxLB boxC boxRB columnLocations
82+ else renderHBar boxLB boxC boxRB columnLocations ++ "\n"
83
83
84renderHBar :: String -> String -> String -> [Int] -> String
84renderHBar :: String -> String -> String -> [Int] -> String
85renderHBar left middle end columnLocations = left ++ concat (L.intersperse middle (map (\x -> repeatString x boxH) columnLocations)) ++ end
85renderHBar left middle end columnLocations = left ++ concat (L.intersperse middle (map (\x -> repeatString x boxH) columnLocations)) ++ end
@@ -116,6 +116,6 @@ showRelation rel
116 | otherwise = renderTable (relationAsTable rel)
116 | otherwise = renderTable (relationAsTable rel)
117
117
118
118
119−simpleExample = s
119+--simpleExample = s
120−groupedExample = case group (S.fromList ["CITY"]) "CITYREL" s of {Right rel -> rel}
120+--groupedExample = case group (S.fromList ["CITY"]) "CITYREL" s of {Right rel -> rel}
121
121