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