@@ -87,12 +87,12 @@ joinAttributes attrs1 attrs2 | V.length uniqueOverlappingAttributes /= V.length
87 overlappingAttributes = V.filter (`V.elem` attrs2) attrs1
87 overlappingAttributes = V.filter (`V.elem` attrs2) attrs1
89joinAttributes :: Attributes -> Attributes -> Either RelationalError Attributes
89joinAttributes :: Attributes -> Attributes -> Either RelationalError Attributes
90−joinAttributes attrs1 attrs2 =
90+joinAttributes attrs1 attrs2
91− if S.size overlappingNames == 0 then -- fast path, no overlapping names
91+ | S.size overlappingNames == 0 = -- fast path, no overlapping names
92 pure (concated id)
92 pure (concated id)
93− else if attributesForNames overlappingNames attrs1 == attributesForNames overlappingNames attrs2 then -- check that atomtypes match
93+ | attributesForNames overlappingNames attrs1 == attributesForNames overlappingNames attrs2 = -- that atomtypes match
94 pure (concated vectorUniqueify)
94 pure (concated vectorUniqueify)
95− else
95+ | otherwise =
96 --special handling to validate that overlapping names have the same atom types
96 --special handling to validate that overlapping names have the same atom types
97 Left (TupleAttributeTypeMismatchError (attributesForNames overlappingNames attrs1))
97 Left (TupleAttributeTypeMismatchError (attributesForNames overlappingNames attrs1))
@@ -111,7 +111,7 @@ member :: Attribute -> Attributes -> Bool
111member attr attrs = HS.member attr (attributesSet attrs)
111member attr attrs = HS.member attr (attributesSet attrs)
113deleteAttributeName :: AttributeName -> Attributes -> Attributes
113deleteAttributeName :: AttributeName -> Attributes -> Attributes
114−deleteAttributeName attrName attrs = deleteAttributeNames (S.singleton attrName) attrs
114+deleteAttributeName attrName = deleteAttributeNames (S.singleton attrName)
116deleteAttributeNames :: S.Set AttributeName -> Attributes -> Attributes
116deleteAttributeNames :: S.Set AttributeName -> Attributes -> Attributes
117deleteAttributeNames attrNames attrs = Attributes {
117deleteAttributeNames attrNames attrs = Attributes {
@@ -215,7 +215,7 @@ attributesDifference attrsA attrsB =
215 hset = HS.difference setA setB <> HS.difference setB setA
215 hset = HS.difference setA setB <> HS.difference setB setA
216 setA = attributesSet attrsA
216 setA = attributesSet attrsA
217 setB = attributesSet attrsB
217 setB = attributesSet attrsB
218− vec = V.filter (\attr -> HS.member attr hset) (attributesVec attrsA <> attributesVec attrsB)
218+ vec = V.filter (`HS.member` hset) (attributesVec attrsA <> attributesVec attrsB)
220vectorUniqueify :: (Hash.Hashable a, Eq a) => V.Vector a -> V.Vector a
220vectorUniqueify :: (Hash.Hashable a, Eq a) => V.Vector a -> V.Vector a
221vectorUniqueify vecIn = V.fromList $ HS.toList $ HS.fromList $ V.toList vecIn
221vectorUniqueify vecIn = V.fromList $ HS.toList $ HS.fromList $ V.toList vecIn