úÎ!=r;H'      !"#$%&Safe>relation)Representation of a relation on ordered (Ord) valuesSaferelationFlatten a set of sets.I(c) JK. 2019 (c) DD. 2012 (c) LFL. 2009 BSD-styleDrew Day<drewday@gmail.com> experimentalportableSafe7T relationsize rh returns the number of tuples in the relation. >>> size (fromList []) == 0 True >>> size (fromList [(a, 1)]) == 1 True relationLConstruct a relation with no elements. >>> toList (fromList []) == [] True relation[The list must be formatted like: [(k1, v1), (k2, v2),..,(kn, vn)]. >>> toList (fromList [(a , 1)]) == [(a, 1)] True >>> fromList [(a, 1), (a, 1)] == fromList [(a, 1), (a, 1)] True >>> fromList [(a, 1), (b, 1)] == fromList [(a, 1), (b , 1)] True relation7Builds a List from a Relation. >>> toList (fromList [(a , 1)]) == [(a$, 1)] True >>> toList (fromList [(a, 1), (b , 2)]) == [(a, 1), (b$, 2)] True >>> toList (fromList [(a, 1), (a , 2)]) == [(a, 1), (a$, 2)] True >>> toList (fromList [(a, 1), (a , 1)]) == [(a , 1)] True relation Builds a & consiting of an association between: x and y. >>> singleton a 1 == fromList [(a , 1)] TruerelationThe / that results from the union of two relations: r and s. >>> fromList [(a, 1)]  fromList [(a, 1)] == fromList [(a, 1)] True >>> fromList [(a, 2)]  fromList [(a, 2)] == fromList [(a, 2)] True >>> fromList [(a, 1)]  fromList [(b, 2)] == fromList [(a, 1), (b , 2)] Truerelation$Union a list of relations using the  G relation. >>> unions [] == fromList [] True >>> unions [fromList [(a, 1)]] == fromList [(a$, 1)] True >>> unions [fromList [(a, 1)], fromList [(a, 1)]] == fromList [(a$, 1)] True >>> unions [fromList [(a, 2)], fromList [(a, 2)]] == fromList [(a$, 2)] True >>> unions [fromList [(a, 1)], fromList [(b, 2)]] == fromList [(a, 1), (b , 2)] TruerelationIntersection of two relations: a and b are related by intersection r s exactly when a and b are related by r and s. >>> fromList [(a, 1)]  fromList [(a, 1)] == fromList [(a, 1)] True >>> fromList [(a, 2)]  fromList [(a, 2)] == fromList [(a, 2)] True >>> fromList [(a, 1)]  fromList [(b, 2)] == fromList [] TruerelationInsert a relation  x  and  y  in the relation  r relation&Delete an association in the relation.relation8The Set of values associated with a value in the domain.relation7The Set of values associated with a value in the range.relationTrue if the element  x  exists in the domain of  r .relation(True if the element exists in the range.relationTrue if the relation r is the   relation.relation.True if the relation contains the association x and yrelationTrue if the relation does not contain the association x and yrelation>Returns the domain in the relation, as a Set, in its entirety.relation=Returns the range of the relation, as a Set, in its entirety.relation%Returns the converse of the relation.relation/Restrict the domain to that of the provided setrelation.Restrict the range to that of the provided setrelation;Restrict the domain to exclude elements of the provided set relation:Restrict the range to exclude elements of the provided set!relation-Compose two relations: right to left version."relation-Compose two relations: left to right version.  !"   !" !9 "9 Safe;$#relation (Case b <| r a)$relation (Case a |> r b)%relation0Domain restriction for a relation. Modeled on z.&relation/Range restriction for a relation. Modeled on z.#$%&$#%&'      !"#$%&'()*+'relation-0.5.1.0-4yUx1WC3bLnBsmrUgg0wJsData.Relation.InternalData.Relation.Internal.Set Data.RelationData.Relation.OpsRelationdomainrange$fShowRelation $fEqRelation $fOrdRelationflattenjustUnlessEmptysizeemptyfromListtoList singletonunionunions intersectioninsertdelete lookupDom lookupRan memberDom memberRannullmember notMemberdomranconverse restrictDom restrictRan withoutDom withoutRan<-<>-><$||$><||>