Hoogle Search
Within LTS Haskell 24.5 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
ghc GHC.Builtin.PrimOps No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
-
ghc GHC.Builtin.Types.Prim No documentation available.
narrowS :: Width -> Integer -> Integerghc GHC.Cmm.Type Narrow a signed value to the given width. The result will reside in [-2^(width-1), +2^(width-1)).
>>> narrowS W8 256 == 0 >>> narrowS W8 255 == -1 >>> narrowS W8 128 == -128 >>> narrowS W8 127 == 127 >>> narrowS W8 0 == 0 >>> narrowS W8 (-127) == -127 >>> narrowS W8 (-128) == -128 >>> narrowS W8 (-129) == 127 >>> narrowS W8 (-255) == 1 >>> narrowS W8 (-256) == 0
narrowU :: Width -> Integer -> Integerghc GHC.Cmm.Type Narrow a signed or unsigned value to the given width. The result will reside in [0, +2^width).
>>> narrowU W8 256 == 256 >>> narrowU W8 255 == 255 >>> narrowU W8 128 == 128 >>> narrowU W8 127 == 127 >>> narrowU W8 0 == 0 >>> narrowU W8 (-127) == 129 >>> narrowU W8 (-128) == 128 >>> narrowU W8 (-129) == 127 >>> narrowU W8 (-255) == 1 >>> narrowU W8 (-256) == 0