text-1.2.5.0: An efficient packed Unicode text type.
Copyright(c) Bryan O'Sullivan 2009
LicenseBSD-style
Maintainerbos@serpentine.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Text.Internal.Unsafe.Shift

Description

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!

Fast, unchecked bit shifting functions.

Synopsis

Documentation

class UnsafeShift a where Source #

This is a workaround for poor optimisation in GHC 6.8.2. It fails to notice constant-width shifts, and adds a test and branch to every shift. This imposes about a 10% performance hit.

These functions are undefined when the amount being shifted by is greater than the size in bits of a machine Int#.

Minimal complete definition

Nothing

Methods

shiftL :: a -> Int -> a Source #

default shiftL :: Bits a => a -> Int -> a Source #

shiftR :: a -> Int -> a Source #

default shiftR :: Bits a => a -> Int -> a Source #

Instances

Instances details
UnsafeShift Word16 Source # 
Instance details

Defined in Data.Text.Internal.Unsafe.Shift

UnsafeShift Word32 Source # 
Instance details

Defined in Data.Text.Internal.Unsafe.Shift

UnsafeShift Word64 Source # 
Instance details

Defined in Data.Text.Internal.Unsafe.Shift

UnsafeShift Int Source # 
Instance details

Defined in Data.Text.Internal.Unsafe.Shift

Methods

shiftL :: Int -> Int -> Int Source #

shiftR :: Int -> Int -> Int Source #