úÎS^Qy     *semi-portable (overlapping instances, etc) provisionalwren@community.haskell.org>This class defines a partially ordered type. The method names ( were chosen so as not to conflict with  and  . We use   instead of defining new types PartialOrdering and   FuzzyBool2 because this way should make the class easier to  use. Minimum complete definition:  .non-portable (CPP, MPTC, OverlappingInstances)betawren@community.haskell.org The & function is defined to pivot through  a 7 according to the haskell98 spec. This is non-portable D and problematic as discussed above. Since there is some resistance D to breaking from the spec, this class defines a reasonable variant 4 which deals with transfinite values appropriately. ?N.B. The generic instance for transfinite types uses expensive < checks to ensure correctness. On GHC there are specialized B versions which use primitive converters instead. These instances @ are hidden from other compilers by the CPP. Be warned that the ! instances are overlapped, so you' ll need to give type signatures  if the arguments to   are polymorphic. CIf any of these restrictions (CPP, GHC-only, OverlappingInstances) @ are onerous to you, contact the maintainer (we like patches :) Many numbers are not  yet, even though they can > represent arbitrarily large values, they are not necessarily ? able to represent transfinite values such as infinity itself. @ This class is for types which are capable of representing such = values. Notably, this class does not require the type to be   nor  & since integral types could also have ? representations for transfinite values. By popular demand the   ; restriction has been lifted as well, due to complications  of defining   or  for some types. AIn particular, this class extends the ordered projection to have  a maximum value   and a minimum value  , ! as well as an exceptional value . All the natural  laws regarding infinity and negativeInfinity should pertain. & (Some of these are discussed below.) =A transfinite value which is greater than all finite values. : Adding or subtracting any finite value is a no-op. As is 7 multiplying by any non-zero positive value (including  infinity3), and dividing by any positive finite value. Also  obeys the law "negate infinity = negativeInfinity with all  appropriate ramifications. :A transfinite value which is less than all finite values.  Obeys all the same laws as infinity with the appropriate " changes for the sign difference. <An exceptional transfinite value for dealing with undefined : results when manipulating infinite values. The following  operations must return  notANumber, where inf is any value  which  isInfinite:   inf + inf  inf - inf inf * 0 0 * inf inf / inf inf   inf 0 / 0 0   0-Additionally, any mathematical operations on  notANumber  must also return  notANumber, and any equality or ordering  comparison on  notANumber must return False . Since it @ returns false for equality, there may be more than one machine  representation of this value. Return true for both infinity and negativeInfinity,  false for all other values. Return true only for  notANumber.    portable provisionalwren@community.haskell.org!@Reduce the number of constant string literals we need to store. "9We need these guards in order to ensure some invariants. #It's unfortunate that  is not equal to itself, but A we can hack around that. GHC gives NaN for the log of negatives + and so we could ideally take advantage of log . guardNonNegative  fun = guardIsANumber fun . log to simplify things, but Hugs  raises an error so that's non-portable. A LogFloat is just a $  with a special interpretation.  The 3 function is presented instead of the constructor, 8 in order to ensure semantic conversion. At present the   > instance will convert back to the normal-domain, and so will B underflow at that point. This behavior may change in the future. ;Performing operations in the log-domain is cheap, prevents B underflow, and is otherwise very nice for dealing with miniscule A probabilities. However, crossing into and out of the log-domain < is expensive and should be avoided as much as possible. In  particular, if you'+re doing a series of multiplications as in  lp * logFloat q * logFloat r it's faster to do lp * logFloat  (q * r) if you'4re reasonably sure the normal-domain multiplication  won'<t underflow, because that way you enter the log-domain only  once, instead of twice. #Even more particularly, you should avoid addition whenever * possible. Addition is provided because it's necessary at times ? and the proper implementation is not immediately transparent.  However, between two LogFloat!s addition requires crossing the  exp/log boundary twice; with a LogFloat and a regular number  it':s three times since the regular number needs to enter the ? log-domain first. This makes addition incredibly slow. Again, > if you can parenthesize to do plain operations first, do it!  %  !"#$%&'( ) * +,-./ 01logfloat-0.9.1Data.Number.PartialOrdData.Number.TransfiniteData.Number.LogFloatbaseGHC.Base Data.MaybeGHC.RealGHC.Enum GHC.FloatGHC.NumGHC.ShowPrelude PartialOrdcmpgtgeeqneleltlog RealToFrac realToFrac TransfiniteinfinitynegativeInfinity notANumber isInfiniteisNaNlogFloat logToLogFloat fromLogFloatlogFromLogFloatLogFloatOrdEqMaybeRationalBounded FractionalFloatingNumShowdiverrorOutOfRangeguardNonNegativeguardIsANumberDouble