1module ProjectM36.AttributeNames where
2import qualified ProjectM36.Attribute as A
5import qualified Data.Set as S
6--AttributeNames is a data structure which can represent inverted projection attributes
8--check that the attribute names are actually in the attributes
9projectionAttributesForAttributeNames :: Attributes -> AttributeNames -> Either RelationalError Attributes
10projectionAttributesForAttributeNames attrs (AttributeNames attrNameSet) = do
11 let nonExistentAttributeNames = A.attributeNamesNotContained attrNameSet (A.attributeNameSet attrs)
12 if not $ S.null nonExistentAttributeNames then
13 Left $ AttributeNamesMismatchError nonExistentAttributeNames
15 return $ A.attributesForNames attrNameSet attrs
17projectionAttributesForAttributeNames attrs (InvertedAttributeNames unselectedAttrNameSet) = do
18 let nonExistentAttributeNames = A.attributeNamesNotContained unselectedAttrNameSet (A.attributeNameSet attrs)
19 if not $ S.null nonExistentAttributeNames then
20 Left $ AttributeNamesMismatchError nonExistentAttributeNames
22 return $ A.attributesForNames (A.nonMatchingAttributeNameSet unselectedAttrNameSet (A.attributeNameSet attrs)) attrs
24attributeNameSet :: AttributeNames -> S.Set AttributeName
25attributeNameSet (AttributeNames nameSet) = nameSet
26attributeNameSet (InvertedAttributeNames nameSet) = nameSet
28invertAttributeNames :: AttributeNames -> AttributeNames
29invertAttributeNames (AttributeNames names) = InvertedAttributeNames names
30invertAttributeNames (InvertedAttributeNames names) = AttributeNames names
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list