@@ -65,7 +65,7 @@ tupleAtomExprP = do
65 atomExpr <- atomExprP
65 atomExpr <- atomExprP
66 pure $ (attributeName, atomExpr)
66 pure $ (attributeName, atomExpr)
68−projectP :: RelationalMarkerExpr a => Parser (RelationalExprBase a -> RelationalExprBase a)
68+projectP :: Parser (RelationalExprBase a -> RelationalExprBase a)
69projectP = do
69projectP = do
70 attrs <- braces attributeListP
70 attrs <- braces attributeListP
71 pure $ Project attrs
71 pure $ Project attrs
@@ -77,7 +77,7 @@ renameClauseP = do
77 newAttr <- identifier
77 newAttr <- identifier
78 pure $ (oldAttr, newAttr)
78 pure $ (oldAttr, newAttr)
80−renameP :: RelationalMarkerExpr a => Parser (RelationalExprBase a -> RelationalExprBase a)
80+renameP :: Parser (RelationalExprBase a -> RelationalExprBase a)
81renameP = do
81renameP = do
82 reservedOp "rename"
82 reservedOp "rename"
83 renameList <- braces (sepBy renameClauseP comma)
83 renameList <- braces (sepBy renameClauseP comma)
@@ -96,14 +96,14 @@ groupClauseP = do
96 newAttrName <- identifier
96 newAttrName <- identifier
97 return $ (attrs, newAttrName)
97 return $ (attrs, newAttrName)
99−groupP :: RelationalMarkerExpr a => Parser (RelationalExprBase a -> RelationalExprBase a)
99+groupP :: Parser (RelationalExprBase a -> RelationalExprBase a)
100groupP = do
100groupP = do
101 reservedOp "group"
101 reservedOp "group"
102 (groupAttrList, groupAttrName) <- parens groupClauseP
102 (groupAttrList, groupAttrName) <- parens groupClauseP
103 pure $ Group groupAttrList groupAttrName
103 pure $ Group groupAttrList groupAttrName
105--in "Time and Relational Theory" (2014), Date's Tutorial D grammar for ungroup takes one attribute, while in previous books, it take multiple arguments. Let us assume that nested ungroups are the same as multiple attributes.
105--in "Time and Relational Theory" (2014), Date's Tutorial D grammar for ungroup takes one attribute, while in previous books, it take multiple arguments. Let us assume that nested ungroups are the same as multiple attributes.
106−ungroupP :: RelationalMarkerExpr a => Parser (RelationalExprBase a -> RelationalExprBase a)
106+ungroupP :: Parser (RelationalExprBase a -> RelationalExprBase a)
107ungroupP = do
107ungroupP = do
108 reservedOp "ungroup"
108 reservedOp "ungroup"
109 rvaAttrName <- identifier
109 rvaAttrName <- identifier
@@ -195,13 +195,13 @@ consumeAtomExprP consume = try functionAtomExprP <|>
195 nakedAtomExprP <|>
195 nakedAtomExprP <|>
196 relationalAtomExprP
196 relationalAtomExprP
198−attributeAtomExprP :: RelationalMarkerExpr a => Parser (AtomExprBase a)
198+attributeAtomExprP :: Parser (AtomExprBase a)
199attributeAtomExprP = do
199attributeAtomExprP = do
200 _ <- string "@"
200 _ <- string "@"
201 attrName <- identifier
201 attrName <- identifier
202 return $ AttributeAtomExpr attrName
202 return $ AttributeAtomExpr attrName
204−nakedAtomExprP :: RelationalMarkerExpr a => Parser (AtomExprBase a)
204+nakedAtomExprP :: Parser (AtomExprBase a)
205nakedAtomExprP = NakedAtomExpr <$> atomP
205nakedAtomExprP = NakedAtomExpr <$> atomP
207constructedAtomExprP :: RelationalMarkerExpr a => Bool -> Parser (AtomExprBase a)
207constructedAtomExprP :: RelationalMarkerExpr a => Bool -> Parser (AtomExprBase a)