grisette-0.11.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2024
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Grisette.Internal.Unified.Class.UnifiedSafeFromFP

Description

 
Synopsis

Documentation

class UnifiedSafeFromFP (mode :: EvalModeTag) e a fp fprd m where Source #

A class that provides unified safe conversion from floating points.

We use this type class to help resolve the constraints for SafeFromFP.

Methods

withBaseSafeFromFP :: (SafeFromFP e a fp fprd m => r) -> r Source #

Instances

Instances details
(UnifiedBranching mode m, SafeFromFP e a fp fprd m) => UnifiedSafeFromFP mode e a fp fprd m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

Methods

withBaseSafeFromFP :: (SafeFromFP e a fp fprd m => r) -> r Source #

(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb) => UnifiedSafeFromFP 'S NotRepresentableFPError SymAlgReal (SymFP eb sb) SymFPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb) => UnifiedSafeFromFP 'S NotRepresentableFPError SymInteger (SymFP eb sb) SymFPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError AlgReal (FP eb sb) FPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb) => UnifiedSafeFromFP mode NotRepresentableFPError Integer (FP eb sb) FPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP 'S NotRepresentableFPError (SymIntN n) (SymFP eb sb) SymFPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching 'S m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP 'S NotRepresentableFPError (SymWordN n) (SymFP eb sb) SymFPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (IntN n) (FP eb sb) FPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

(MonadError NotRepresentableFPError m, UnifiedBranching mode m, ValidFP eb sb, KnownNat n, 1 <= n) => UnifiedSafeFromFP mode NotRepresentableFPError (WordN n) (FP eb sb) FPRoundingMode m Source # 
Instance details

Defined in Grisette.Internal.Unified.Class.UnifiedSafeFromFP

safeFromFP :: forall mode e a fp fprd m. (UnifiedSafeFromFP mode e a fp fprd m, MonadError e m) => fprd -> fp -> m a Source #

Unified safeFromFP operation.

This function isn't able to infer the mode, so you need to provide the mode explicitly. For example:

safeFromFP @mode mode fp