hmpfr-0.4.4: Haskell binding to the MPFR library

Safe HaskellNone
LanguageHaskell98

Data.Number.MPFR.Mutable.Internal

Synopsis

Documentation

withMutableMPFR1 :: (Integral a, Integral b) => (Ptr MPFR -> Ptr MPFR -> a -> CRoundMode -> IO CInt) -> MMPFR s -> MMPFR s -> b -> RoundMode -> ST s Int Source #

withMutableMPFR2 :: (Integral a, Integral b) => (Ptr MPFR -> a -> Ptr MPFR -> CRoundMode -> IO CInt) -> MMPFR s -> b -> MMPFR s -> RoundMode -> ST s Int Source #

withMutableMPFRUI :: (Integral a, Integral b) => (Ptr MPFR -> a -> CRoundMode -> IO CInt) -> MMPFR s -> b -> RoundMode -> ST s Int Source #

withMutableMPFRSNRNR :: (Ptr MPFR -> IO ()) -> MMPFR s -> ST s () Source #

unsafeWriteMMPFR :: MMPFR s -> MPFR -> ST s () Source #

Replace the state of the mutable MPFR with a new one. The actual limbs are not copied, so any further modifications on the mutable MPFR will reflect on the MPFR given in as the second argument.

unsafeFreeze :: MMPFR s -> ST s MPFR Source #

Convert a mutable MPFR to an immutable one. The unsafe prefix comes from the fact that limbs of the MPFR are not copied so any further modifications on the mutable MPFR will reflect on the "frozen" one. If mutable MPFR will not be modified afterwards, it is perfectly safe to use.

unsafeThaw :: MPFR -> ST s (MMPFR s) Source #

Convert an immutable MPFR to a mutable one. The unsafe prefix comes from the fact that limbs of the MPFR are not copied so any modifications done on on the mutable MPFR will reflect on the original. If the original will not be used or limbs of the mutable not modified, then it is safe to use.

writeMMPFR :: MMPFR s -> MPFR -> ST s () Source #

Replace the state of the mutable MPFR with a new one, making a complete copy.

freeze :: MMPFR s -> ST s MPFR Source #

Convert a mutable MPFR to an immutable one, making a complete copy.

thaw :: MPFR -> ST s (MMPFR s) Source #

Convert an immutable MPFR to a mutable one, making a complete copy.

data MMPFR s Source #

A mutable MPFR. Currently this is just a newtype wrapped STRef to a MPFR but this may change in the future for a more efficient implementation. Type argument s is the state variable argument for the ST type.

Instances

Eq (MMPFR s) Source # 

Methods

(==) :: MMPFR s -> MMPFR s -> Bool #

(/=) :: MMPFR s -> MMPFR s -> Bool #