!*o      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"# $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < =>?@ABCDEFGHIJKLMNOPQRSTUVWXY Z [ \ ] ^ _ ` a b c d e f g h i j k l m n Safe,24567=>?@AXk[ connections'Max element of a partially ordered set. \forall x: x \le maximal This means that % must be comparable to all values in a. connections'Min element of a partially ordered set. \forall x: x \ge minimal This means that % must be comparable to all values in a.  connectionsA partial order on the set a.A poset relation  7 must satisfy the following three partial order axioms: \forall x: x \leq x  (reflexivity): \forall a, b: (a \leq b) \Leftrightarrow \neg (b \leq a)  (anti-symmetry)H \forall a, b, c: ((a \leq b) \wedge (b \leq c)) \Rightarrow (a \leq c)  (transitivity)8If a prior equality relation is available, then a valid Prd a3 instance may be derived from a semiorder relation  as: x   y =  x y o x p y If a4 is derived from a semiorder then the definition of + must satisfy the three semiorder axioms:0 \forall x, y: x \lt y \Rightarrow \neg y \lt x  (asymmetry)P \forall x, y, z, w: x \lt y \wedge y \sim z \wedge z \lt w \Rightarrow x \lt w  (2-2 chain)h \forall x, y, z, w: x \lt y \wedge y \lt z \wedge y \sim w \Rightarrow \neg (x \sim w \wedge z \sim w)  (3-1 chain)The poset axioms on  / then follow from the first & second axioms on H, however the converse is not true. While the first semiorder axiom on s follows, the second and third semiorder axioms forbid partial orders of four items forming two disjoint chains: Lthe second axiom forbids two chains of two items each (the (2+2) free poset)Bthe third axiom forbids a three-item chain with one unrelated item&See also the wikipedia definitions of  3https://en.wikipedia.org/wiki/Partially_ordered_setpartially ordered set and  'https://en.wikipedia.org/wiki/Semiorder semiorder.  connections%Non-strict partial order relation on a. . is reflexive, anti-symmetric, and transitive.  connections.Converse non-strict partial order relation on a. . is reflexive, anti-symmetric, and transitive. connectionsEquivalence relation on a.) is reflexive, symmetric, and transitive.0@ x =~ y = maybe False (== EQ) (pcomparePrd x y)If a implements q then (ideally) x =~ y = x == y. connectionsComparability relation on a. ) is reflexive, symmetric, and transitive. 4 x ?~ y = maybe False (const True) (pcomparePrd x y)If a implements r then (ideally)  x ?~ y = True. connectionsPartial version of  . connectionsSimilarity relation on a. < is reflexive and symmetric, but not necessarily transitive. Note this is only equivalent to p in a total (i.e. linear) order. connections Negation of . connections Version of , that uses the derived equivalence relation."This can be useful if there is no q5 instance or if it is compromised, for example when a is a floating point number. connections Version of  that uses s. connectionsPrefix version of .0@ eq x y = maybe False (== EQ) (pcomparePrd x y) connections Negation of .0@ ne x y = maybe False (/= EQ) (pcomparePrd x y) connectionsPrefix version of  .0@ le x y = maybe False (<= EQ) (pcomparePrd x y) connectionsPrefix version of  .0@ ge x y = maybe False (>= EQ) (pcomparePrd x y) connections!Strict partial order relation on a., is irreflexive, asymmetric, and transitive. + lt x y = maybe False (< EQ) (pcompare x y)If a implements r then (ideally) x  y = x < y. connections*Converse strict partial order relation on a., is irreflexive, asymmetric, and transitive. + gt x y = maybe False (> EQ) (pcompare x y)If a implements r then (ideally) x  y = x > y. connectionsA partial version of ()Returns t instead of u( when the two values are not comparable. connectionsA partial version of ()Returns t instead of u( when the two values are not comparable. connectionsA partial version of ( )Returns t instead of u( when the two values are not comparable. connectionsA partial version of ( )Returns t instead of u( when the two values are not comparable. connectionsA partial version of (v) Returns t instead of u( when the two values are not comparable. "lt x y == maybe False id $ plt x y  connectionsA partial version of (w)Returns t instead of u( when the two values are not comparable. "gt x y == maybe False id $ pgt x y! connectionsA partial version of  . DDefault instance returns the connr argument in the case of equality.# connectionsA partial version of  . DDefault instance returns the connr argument in the case of equality., connectionsLGreatest (resp. least) fixed point of a monitone (resp. antitone) function. >Does not check that the function is monitone (resp. antitone). See also  7http://en.wikipedia.org/wiki/Kleene_fixed-point_theorem.,  !"#$%&'()*+,,  !"#$%&'()*+, 4 4444444444444444 4!4#4Safe 27=?@AXkq connections Lattices.A lattice is a partially ordered set in which every two elements have a unique join (least upper bound or supremum) and a unique meet (greatest lower bound or infimum). See  ,http://en.wikipedia.org/wiki/Lattice_(order) and  +http://en.wikipedia.org/wiki/Absorption_law.Laws x   "a x  Corollary x   "a' identity ' (x  )   "a' absorption '   x   "a x  Corollary x   "a' identity ' (x  )   "a' absorption '   Associativity x  (y  z) "a (x  y)  z x  (y  z) "a (x  y)  z  Commutativity x  y "a y  x x  y "a y  x  Idempotency x  x "a x x  x "a x  Absorption (x  y)  y "a y (x  y)  y "a y  connectionsLattice morphism. connections>The partial ordering induced by the join-semilattice structure connectionsKThe join of at a list of join-semilattice elements (of length at least one) connectionsKThe meet of at a list of meet-semilattice elements (of length at least one) connections.Birkhoff's self-dual ternary median operation.TODO: require a Dioid instance.  median x x y "a x  median x y z "a median z x y  median x y z "a median x z y 6 median (median x w y) w z "a median x w (median y w z)56Safe =?@AHVXks connectionsAn adjoint triple. f g h satisfies:f " g " " g " hSee ,https://ncatlab.org/nlab/show/adjoint+triple connections4A Galois connection between two monotone functions: connl \dashv connr AEach side of the adjunction may be defined in terms of the other:3 connr(x) = \sup \{y \in E \mid connl(y) \leq x \} 3 connl(x) = \inf \{y \in E \mid connr(y) \geq x \} YGalois connections have the same properties as adjunctions defined over other categories:a \forall x, y : connl \dashv connr \Rightarrow connl (x) \leq b \Leftrightarrow x \leq connr (y) > \forall x, y : x \leq y \Rightarrow connl (x) \leq connl (y) > \forall x, y : x \leq y \Rightarrow connr (x) \leq connr (y) I \forall x : connl \dashv connr \Rightarrow x \leq connr \circ connl (x) I \forall x : connl \dashv connr \Rightarrow connl \circ connr (x) \leq x / \forall x : unit \circ unit (x) \sim unit (x) 5 \forall x : counit \circ counit (x) \sim counit (x) 3 \forall x : counit \circ connl (x) \sim connl (x) 1 \forall x : unit \circ connr (x) \sim connr (x)  See also  and  /https://en.wikipedia.org/wiki/Galois_connection. connectionsPartial version of  .  Helpful in conjunction with the xxxBy functions from . connections"Lens into first part of a product.  (ab >>> cd) =  ab >>>  cd connectionsPrism into left part of a sum.  (ab >>> cd) =  ab >>>  cd++32323232Safe=?@AXkSafe =?@AHVXk  connectionsQ \forall x, y : f \dashv g \Rightarrow f (x) \leq y \Leftrightarrow x \leq g (y) A monotone Galois connection. connections9 \forall x : f \dashv g \Rightarrow x \leq g \circ f (x) This is a required property. connections9 \forall x : f \dashv g \Rightarrow x \leq g \circ f (x) This is a required property. connections9 \forall x : f \dashv g \Rightarrow f \circ g (x) \leq x This is a required property. connections9 \forall x : f \dashv g \Rightarrow x \leq g \circ f (x) This is a required property. connections6 \forall x, y : x \leq y \Rightarrow g (x) \leq g (y) This is a required property. connections6 \forall x, y : x \leq y \Rightarrow f (x) \leq f (y) This is a required property. connectionsF \forall x : f \dashv g \Rightarrow unit \circ unit (x) \sim unit (x)  connectionsL \forall x : f \dashv g \Rightarrow counit \circ counit (x) \sim counit (x)  connectionsA \forall x: f \dashv g \Rightarrow counit \circ f (x) \sim f (x) See 3https://ncatlab.org/nlab/show/idempotent+adjunction connections? \forall x: f \dashv g \Rightarrow unit \circ g (x) \sim g (x) See 3https://ncatlab.org/nlab/show/idempotent+adjunction Safe=?@AXkSafe24567=>?@ASXk           Safe=?@AXk0 connections Shift by Int32 units of least precision.#$%&'()*+,-./0123456#$%&'()*+,-./0123456Safe =>?@AXk D connections maximal (positive) finite value.E connections$minimal (positive) normalized value.F connections#maximal representable odd integer.  maxOdd = 2**24 - 1G connectionsminimal (positive) value.H connectionsIdifference between 1 and the smallest representable value greater than 1.I connectionsfirst NaN value. J connectionsPositive infinity  nInf = 1/0K connectionsNegative infinity  nInf = -1/0M connections nan x == indeterminate xX connections Compare two 9 values for approximate equality, using Dawson's method.required accuracy is specified in ULPs (units of least precision). If the two numbers differ by the given number of ULPs or less, this function returns True.1#$%&'()*+,-./0123456=>?@ABCDEFGHIJKLMNOPQRSTUVWX=>?@ABCDEFGHIJKLMNOPQRSTUVWX Safe8=>?@AHSVXkY connections3Yoneda representation for lattice ideals & filters. A subset I of a lattice is an ideal if and only if it is a lower set that is closed under finite joins, i.e., it is nonempty and for all x, y in I, the element x vee y is also in I.upper and lower commute with Down: $lower x y == upper (Down x) (Down y) $lower (Down x) (Down y) == upper x yRep a is upward-closed: upper x s && x  ~y == upper y s ?upper x s && upper y s ==> connl filter x / connl filter y >~ sRep a is downward-closed: !lower x s && x >~ y ==> lower y s =lower x s && lower y s ==> connl ideal x / connl ideal y ~< sFinally filter >>> ideal and ideal >>> filter are both connections on a and Rep a respectively. See also: 2https://en.wikipedia.org/wiki/Filter_(mathematics) 2https://en.wikipedia.org/wiki/Ideal_(order_theory)Y]Z[\^^Y]Z[\ Safe=?@AXkڮ` connections3 \forall a, b: (a \eq b) \Leftrightarrow (b \eq a)  is a symmetric relation.This is a required property.a connections. \forall x, y: x \eq y \Leftrightarrow x == y  is a coreflexive relation.See  >https://en.wikipedia.org/wiki/Reflexive_relation#Related_terms.This is a required property.b connections \forall a: (a \eq a)  is a reflexive relation.This is a required property.c connectionsE \forall a, b, c: ((a \eq b) \wedge (b \eq c)) \Rightarrow (a \eq c)  is a transitive relation.This is a required property.d connections@ \forall a, b: (a \leq b) \wedge (b \leq a) \Rightarrow a \eq b   is an antisymmetric relation.This is a required property.e connections \forall a: (a \leq a)   is a reflexive relation.This is a required property.f connectionsH \forall a, b, c: ((a \leq b) \wedge (b \leq c)) \Rightarrow (a \leq c)   is an transitive relation.This is a required property.g connections, \forall a, b: ((a \leq b) \vee (b \leq a))   is a connex relation.h connections4 \forall a, b: (a \lt b) \Rightarrow \neg (b \lt a)  is an asymmetric relation.This is a required property.i connections \forall a: \neg (a \lt a)  is an irreflexive relation.This is a required property.j connectionsE \forall a, b, c: ((a \lt b) \wedge (b \lt c)) \Rightarrow (a \lt c)  is a transitive relation.This is a required property.k connectionsE \forall a, b: \neg (a \eq b) \Rightarrow ((a \lt b) \vee (b \lt a))  is a semiconnex relation.l connectionsv \forall a, b, c: ((a \lt b) \vee (a \eq b) \vee (b \lt a)) \wedge \neg ((a \lt b) \wedge (a \eq b) \wedge (b \lt a)) In other words, exactly one of a \lt b, a \eq b, or b \lt a holds.If < is a trichotomous relation then the set is totally ordered.m connectionsP \forall x, y, z, w: x \lt y \wedge y \sim z \wedge z \lt w \Rightarrow x \lt w  &A semiorder does not allow 2-2 chains.`abcdefghijklmn`abcdefghjiklmnx   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./01234 5 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L MNOPQRSTUVWXYZ[\]^_`abcdefghi j k l m n o p q r s t u v w x y z { | } ~  (connections-0.0.2-3bGTwkYWIphGQUrhB8xvK6 Data.FloatData.PrdData.Prd.LatticeData.ConnectionData.Connection.WordData.Connection.PropertyData.Connection.Int Data.Prd.NanData.Connection.FloatData.Connection.YonedaData.Prd.PropertyData.OrdcomparemaxminData.Function.ConnectionProperty comparingDataListghc-prim GHC.TypesFloatbaseDownMaxmaximalMinminimalBoundOrdered getOrderedPrd<~>~=~?~pcompare~~/~ pcomparePrd pcompareOrdeqnelegeltgtpeqpneplepgepltpgtpmaxpjoinpminpmeetsignzeropositivenegative indeterminateuntilwhilefixed $fPrdIntSet $fPrdIntMap$fPrdMap$fPrdSet $fPrd(,,,,) $fPrd(,,,) $fPrd(,,)$fPrd(,)$fPrd() $fPrdEither $fPrdMaybe $fPrdRatio $fPrdDouble $fPrdFloat$fPrdAll$fPrdAny $fPrdDual $fPrdDown $fPrdNonEmpty$fPrd[] $fPrdOrdering $fPrdWord64 $fPrdWord32 $fPrdWord16 $fPrdWord8 $fPrdWord $fPrdNatural $fPrdInt64 $fPrdInt32 $fPrdInt16 $fPrdInt8$fPrdInt $fPrdInteger $fPrdChar $fPrdBool $fPrdOrdered $fMinMaybe $fMinEither$fMin(,)$fMinMap$fMinSet $fMinIntMap $fMinWord64 $fMinWord32 $fMinWord16 $fMinWord8 $fMinWord $fMinInt64 $fMinInt32 $fMinInt16 $fMinInt8$fMinInt $fMinOrdering $fMinBool $fMinNatural$fMin() $fMaxDown $fMaxMaybe $fMaxEither$fMax(,) $fMaxWord64 $fMaxWord32 $fMaxWord16 $fMaxWord8 $fMaxWord $fMaxInt64 $fMaxInt32 $fMaxInt16 $fMaxInt8$fMaxInt $fMaxOrdering $fMaxBool$fMax() $fMinDown $fEqOrdered $fOrdOrdered $fShowOrdered $fDataOrdered$fGenericOrdered$fGeneric1Ordered$fFunctorOrdered$fFoldableOrdered$fTraversableOrderedMeetunMeetJoinunJoinLattice\//\ fromSubsetjoinLeqmeetLeqjoinmeetjoin1meet1median$fMaxAny$fMinAny$fMaxAll$fMinAll$fLatticeIntSet$fLatticeIntMap $fLatticeMap $fLatticeSet$fLatticeOrdered $fLatticeDown $fLatticeAny $fLatticeAll $fLatticeBool$fLatticeMaybe$fLatticeEither $fLattice(,) $fLattice() $fPrdJoin $fMonoidJoin$fSemigroupJoin $fMonoidMeet$fSemigroupMeet$fEqJoin $fOrdJoin $fShowJoin $fDataJoin $fGenericJoin$fEqMeet $fOrdMeet $fShowMeet $fDataMeet $fGenericMeetTripConnconnlconnrunitcounit pcomparingdual***+++&&&|||_1_2_L_Rjustlistordbinbinordtripltriprunitlunitrcounitlcounitrceiling'floor'****++++&&&&||||_1'_2'_L'_R'diagcodiagboundmaybelmayber$fCategoryTYPEConn$fCategoryTYPETripw08i08w08w16w08w32w08w64w08natw16i16w16w32w16w64w16natw32i32w32w64w32natw64i64w64nat connectionclosedclosed'kernelkernel'monotone monotone'idempotent_unitidempotent_counit projective_l projective_ri08w08i08w08'i08i16i08i32i08i64i16w16i16w16'i16i32i16i64i32w32i32w32'i32i64i64w64i64w64'intnatNanNaNDefnandefinedmapNanmaybeNannanMaybe eitherNan nanEitherliftNanliftNan'liftAllisInf floatOrderingnanfltdef$fNumNan$fApplicativeNan$fPrdNan$fEqNan$fOrdNan $fShowNan $fDataNan $fGenericNan $fGeneric1Nan $fFunctorNan $fFoldableNan$fTraversableNanUlp32unUlp32ulp32Nanf32u32u32f32u32w64abs'f32i64i64f32f64i64i64f64 float_word8shiftsigned32 unsigned32 int32Float floatInt32 word32Float floatWord32$fBoundedUlp32 $fMaxUlp32 $fMinUlp32 $fPrdUlp32 $fEqUlp32 $fShowUlp32splitlsbMaskmsbMaskexpMasksigMasksignBitevenBitmaxNormminNormmaxOddminSubepsilonaNanpInfnInfeq'isNanpinfninfinfinite denormalizedfinitenzeroulps ulpDistanceulpDelta ulpDelta'withinYonedaideallowerfilterupperRep $fYonedaBool symmetric coreflexive reflexive_eq transitive_eq antisymmetric reflexive_le transitive_leconnex asymmetricirreflexive_lt transitive_lt semiconnex trichotomouschain_22chain_31 GHC.Classes||==EqOrd GHC.MaybeNothingFalse<>