on master help sign in
fix cabal file
2816ed8AgentM
project-m36.cabal+1−1
@@ -51,7 +51,7 @@ Library
51 ,extended-reals
51 ,extended-reals
52 ,network-transport
52 ,network-transport
53--required for persistent db driver
53--required for persistent db driver
54− ,persistent >= 2.2 && <2.3,
54+ ,persistent >= 2.2 && <2.3
55 ,persistent-template
55 ,persistent-template
56 ,aeson
56 ,aeson
57 ,path-pieces
57 ,path-pieces
src/bin/TutorialD/Interpreter/RelationalExpr.hs+6−6
@@ -65,7 +65,7 @@ tupleAtomExprP = do
65 atomExpr <- atomExprP
65 atomExpr <- atomExprP
66 pure $ (attributeName, atomExpr)
66 pure $ (attributeName, atomExpr)
67
67
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)
79
79
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)
98
98
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
104
104
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
197
197
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
203
203
204−nakedAtomExprP :: RelationalMarkerExpr a => Parser (AtomExprBase a)
204+nakedAtomExprP :: Parser (AtomExprBase a)
205nakedAtomExprP = NakedAtomExpr <$> atomP
205nakedAtomExprP = NakedAtomExpr <$> atomP
206
206
207constructedAtomExprP :: RelationalMarkerExpr a => Bool -> Parser (AtomExprBase a)
207constructedAtomExprP :: RelationalMarkerExpr a => Bool -> Parser (AtomExprBase a)