grisette-0.4.1.0: Symbolic evaluation as a library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Grisette.Core.Data.Class.SafeSymShift

Synopsis

Documentation

class SymShift a => SafeSymShift e a | a -> e where Source #

Safe version for shiftL or shiftR.

The safeSymShiftL and safeSymShiftR and their primed versions are defined for all non-negative shift amounts.

  • Shifting by negative shift amounts is an error.
  • The result is defined to be 0 when shifting left by more than or equal to the bit size of the number.
  • The result is defined to be 0 when shifting right by more than or equal to the bit size of the number and the number is unsigned or signed non-negative.
  • The result is defined to be -1 when shifting right by more than or equal to the bit size of the number and the number is signed negative.

The safeSymStrictShiftL and safeSymStrictShiftR and their primed versions are defined for all non-negative shift amounts that is less than the bit size. Shifting by more than or equal to the bit size is an error, otherwise they are the same as the non-strict versions.

Methods

safeSymShiftL :: (MonadError e m, UnionLike m) => a -> a -> m a Source #

safeSymShiftR :: (MonadError e m, UnionLike m) => a -> a -> m a Source #

safeSymShiftL' :: (MonadError e' m, UnionLike m) => (e -> e') -> a -> a -> m a Source #

safeSymShiftR' :: (MonadError e' m, UnionLike m) => (e -> e') -> a -> a -> m a Source #

safeSymStrictShiftL :: (MonadError e m, UnionLike m) => a -> a -> m a Source #

safeSymStrictShiftR :: (MonadError e m, UnionLike m) => a -> a -> m a Source #

safeSymStrictShiftL' :: (MonadError e' m, UnionLike m) => (e -> e') -> a -> a -> m a Source #

safeSymStrictShiftR' :: (MonadError e' m, UnionLike m) => (e -> e') -> a -> a -> m a Source #

Instances

Instances details
SafeSymShift ArithException Int16 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Int32 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Int64 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Int8 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Word16 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Word32 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Word64 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Word8 Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Int Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

SafeSymShift ArithException Word Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

(KnownNat n, 1 <= n) => SafeSymShift ArithException (IntN n) Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

(KnownNat n, 1 <= n) => SafeSymShift ArithException (WordN n) Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

(KnownNat n, 1 <= n) => SafeSymShift ArithException (SymIntN n) Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift

(KnownNat n, 1 <= n) => SafeSymShift ArithException (SymWordN n) Source # 
Instance details

Defined in Grisette.Core.Data.Class.SafeSymShift