on master help sign in
add missing AttributeNames source
6a7ede4AgentM
ProjectM36/AttributeNames.hsnew file+18
@@ -0,0 +1,18 @@
1+module ProjectM36.AttributeNames where
2+import qualified ProjectM36.Attribute as A
3+import ProjectM36.Base
4+import qualified Data.Set as S
5+--AttributeNames is a data structure which can represent inverted projection attributes
6+
7+
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
11+
12+attributeNameSet :: AttributeNames -> S.Set AttributeName
13+attributeNameSet (AttributeNames nameSet) = nameSet
14+attributeNameSet (InvertedAttributeNames nameSet) = nameSet
15+
16+invertAttributeNames :: AttributeNames -> AttributeNames
17+invertAttributeNames (AttributeNames names) = InvertedAttributeNames names
18+invertAttributeNames (InvertedAttributeNames names) = AttributeNames names