@@ -0,0 +1,18 @@
1+module ProjectM36.AttributeNames where
2+import qualified ProjectM36.Attribute as A
4+import qualified Data.Set as S
5+--AttributeNames is a data structure which can represent inverted projection attributes
8+projectionAttributesForAttributeNames :: Attributes -> AttributeNames -> Attributes
9+projectionAttributesForAttributeNames attrs (AttributeNames attrNameSet) = A.attributesForNames attrNameSet attrs
10+projectionAttributesForAttributeNames attrs (InvertedAttributeNames unselectedAttrNameSet) = A.attributesForNames (A.nonMatchingAttributeNameSet unselectedAttrNameSet (A.attributeNameSet attrs)) attrs
12+attributeNameSet :: AttributeNames -> S.Set AttributeName
13+attributeNameSet (AttributeNames nameSet) = nameSet
14+attributeNameSet (InvertedAttributeNames nameSet) = nameSet
16+invertAttributeNames :: AttributeNames -> AttributeNames
17+invertAttributeNames (AttributeNames names) = InvertedAttributeNames names
18+invertAttributeNames (InvertedAttributeNames names) = AttributeNames names