on master help sign in
add missing AttributeNames source
commit6a7ede4ac0a5c756e1c059f1ce4b89d627ade680 authorAgentM <agentm@themactionfaction.com> dateSat 6 Jun 2015, 22:48 (11 years ago) parent78bc7c6
1 file changed+18
ProjectM36/AttributeNames.hs+18
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