GHC.Types.SaneDouble

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Types.SaneDouble

Description

Double datatype with saner instances

Synopsis

- newtype SaneDouble = SaneDouble {
  - unSaneDouble :: Double
  }

# Documentation

newtype SaneDouble Source #

A newtype wrapper around `Double` to ensure we never generate a `Double` that becomes a `NaN`, see instances for details on sanity.

Constructors

SaneDouble |
Fields unSaneDouble :: Double

#### Instances

Instances details

Binary SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods put_ :: WriteBinHandle -> SaneDouble -> IO () Source # put :: WriteBinHandle -> SaneDouble -> IO (Bin SaneDouble) Source # get :: ReadBinHandle -> IO SaneDouble Source #
Eq SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods (==) :: SaneDouble -> SaneDouble -> Bool Source # (/=) :: SaneDouble -> SaneDouble -> Bool Source #
Ord SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods compare :: SaneDouble -> SaneDouble -> Ordering Source # (<) :: SaneDouble -> SaneDouble -> Bool Source # (<=) :: SaneDouble -> SaneDouble -> Bool Source # (>) :: SaneDouble -> SaneDouble -> Bool Source # (>=) :: SaneDouble -> SaneDouble -> Bool Source # max :: SaneDouble -> SaneDouble -> SaneDouble Source # min :: SaneDouble -> SaneDouble -> SaneDouble Source #
Num SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods (+) :: SaneDouble -> SaneDouble -> SaneDouble Source # (-) :: SaneDouble -> SaneDouble -> SaneDouble Source # (*) :: SaneDouble -> SaneDouble -> SaneDouble Source # negate :: SaneDouble -> SaneDouble Source # abs :: SaneDouble -> SaneDouble Source # signum :: SaneDouble -> SaneDouble Source # fromInteger :: Integer -> SaneDouble Source #
Fractional SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods (/) :: SaneDouble -> SaneDouble -> SaneDouble Source # recip :: SaneDouble -> SaneDouble Source # fromRational :: Rational -> SaneDouble Source #
Show SaneDouble Source # |
Instance details Defined in GHC.Types.SaneDouble Methods showsPrec :: Int -> SaneDouble -> ShowS Source # show :: SaneDouble -> String Source # showList :: [SaneDouble] -> ShowS Source #