Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Word

Contents

Description

Unsigned integer types.

Synopsis

Unsigned integral types

dataWord#

AWord is an unsigned integral type, with the same size asInt.

Instances
BoundedWordSource#

Since: 2.1

Instance details

Defined inGHC.Enum

EnumWordSource#

Since: 2.1

Instance details

Defined inGHC.Enum

EqWord 
Instance details

Defined inGHC.Classes

Methods

(==) ::Word ->Word ->Bool#

(/=) ::Word ->Word ->Bool#

IntegralWordSource#

Since: 2.1

Instance details

Defined inGHC.Real

DataWordSource#

Since: 4.0.0.0

Instance details

Defined inData.Data

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Word -> cWordSource#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cWordSource#

toConstr ::Word ->ConstrSource#

dataTypeOf ::Word ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cWord)Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cWord)Source#

gmapT :: (forall b.Data b => b -> b) ->Word ->WordSource#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Word -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Word -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Word -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Word -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Word -> mWordSource#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Word -> mWordSource#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Word -> mWordSource#

NumWordSource#

Since: 2.1

Instance details

Defined inGHC.Num

OrdWord 
Instance details

Defined inGHC.Classes

ReadWordSource#

Since: 4.5.0.0

Instance details

Defined inGHC.Read

RealWordSource#

Since: 2.1

Instance details

Defined inGHC.Real

ShowWordSource#

Since: 2.1

Instance details

Defined inGHC.Show

IxWordSource#

Since: 4.6.0.0

Instance details

Defined inGHC.Arr

FiniteBitsWordSource#

Since: 4.6.0.0

Instance details

Defined inData.Bits

BitsWordSource#

Since: 2.1

Instance details

Defined inData.Bits

StorableWordSource#

Since: 2.1

Instance details

Defined inForeign.Storable

PrintfArgWordSource#

Since: 2.1

Instance details

Defined inText.Printf

Generic1 (URecWord :: k ->Type)Source# 
Instance details

Defined inGHC.Generics

Associated Types

typeRep1 (URecWord) :: k ->TypeSource#

Functor (URecWord ::Type ->Type)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

Methods

fmap :: (a -> b) ->URecWord a ->URecWord bSource#

(<$) :: a ->URecWord b ->URecWord aSource#

Foldable (URecWord ::Type ->Type)Source#

Since: 4.9.0.0

Instance details

Defined inData.Foldable

Methods

fold ::Monoid m =>URecWord m -> mSource#

foldMap ::Monoid m => (a -> m) ->URecWord a -> mSource#

foldr :: (a -> b -> b) -> b ->URecWord a -> bSource#

foldr' :: (a -> b -> b) -> b ->URecWord a -> bSource#

foldl :: (b -> a -> b) -> b ->URecWord a -> bSource#

foldl' :: (b -> a -> b) -> b ->URecWord a -> bSource#

foldr1 :: (a -> a -> a) ->URecWord a -> aSource#

foldl1 :: (a -> a -> a) ->URecWord a -> aSource#

toList ::URecWord a -> [a]Source#

null ::URecWord a ->BoolSource#

length ::URecWord a ->IntSource#

elem ::Eq a => a ->URecWord a ->BoolSource#

maximum ::Ord a =>URecWord a -> aSource#

minimum ::Ord a =>URecWord a -> aSource#

sum ::Num a =>URecWord a -> aSource#

product ::Num a =>URecWord a -> aSource#

Traversable (URecWord ::Type ->Type)Source#

Since: 4.9.0.0

Instance details

Defined inData.Traversable

Methods

traverse ::Applicative f => (a -> f b) ->URecWord a -> f (URecWord b)Source#

sequenceA ::Applicative f =>URecWord (f a) -> f (URecWord a)Source#

mapM ::Monad m => (a -> m b) ->URecWord a -> m (URecWord b)Source#

sequence ::Monad m =>URecWord (m a) -> m (URecWord a)Source#

Eq (URecWord p)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

Ord (URecWord p)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

Show (URecWord p)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

Generic (URecWord p)Source# 
Instance details

Defined inGHC.Generics

Associated Types

typeRep (URecWord p) ::Type ->TypeSource#

dataURecWord (p :: k)Source#

Used for marking occurrences ofWord#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

dataURecWord (p :: k) =UWord {}
typeRep1 (URecWord :: k ->Type)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

typeRep1 (URecWord :: k ->Type) =D1 (MetaData "URec" "GHC.Generics" "base"False) (C1 (MetaCons "UWord"PrefixITrue) (S1 (MetaSel (Just "uWord#")NoSourceUnpackednessNoSourceStrictnessDecidedLazy) (UWord :: k ->Type)))
typeRep (URecWord p)Source#

Since: 4.9.0.0

Instance details

Defined inGHC.Generics

typeRep (URecWord p) =D1 (MetaData "URec" "GHC.Generics" "base"False) (C1 (MetaCons "UWord"PrefixITrue) (S1 (MetaSel (Just "uWord#")NoSourceUnpackednessNoSourceStrictnessDecidedLazy) (UWord ::Type ->Type)))

dataWord8Source#

8-bit unsigned integer type

Instances
BoundedWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

EnumWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

EqWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

IntegralWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

DataWord8Source#

Since: 4.0.0.0

Instance details

Defined inData.Data

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Word8 -> cWord8Source#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cWord8Source#

toConstr ::Word8 ->ConstrSource#

dataTypeOf ::Word8 ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cWord8)Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cWord8)Source#

gmapT :: (forall b.Data b => b -> b) ->Word8 ->Word8Source#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Word8 -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Word8 -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Word8 -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Word8 -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Word8 -> mWord8Source#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Word8 -> mWord8Source#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Word8 -> mWord8Source#

NumWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

OrdWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

ReadWord8Source#

Since: 2.1

Instance details

Defined inGHC.Read

RealWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

ShowWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

IxWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

FiniteBitsWord8Source#

Since: 4.6.0.0

Instance details

Defined inGHC.Word

BitsWord8Source#

Since: 2.1

Instance details

Defined inGHC.Word

StorableWord8Source#

Since: 2.1

Instance details

Defined inForeign.Storable

PrintfArgWord8Source#

Since: 2.1

Instance details

Defined inText.Printf

dataWord16Source#

16-bit unsigned integer type

Instances
BoundedWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

EnumWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

EqWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

IntegralWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

DataWord16Source#

Since: 4.0.0.0

Instance details

Defined inData.Data

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Word16 -> cWord16Source#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cWord16Source#

toConstr ::Word16 ->ConstrSource#

dataTypeOf ::Word16 ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cWord16)Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cWord16)Source#

gmapT :: (forall b.Data b => b -> b) ->Word16 ->Word16Source#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Word16 -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Word16 -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Word16 -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Word16 -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Word16 -> mWord16Source#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Word16 -> mWord16Source#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Word16 -> mWord16Source#

NumWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

OrdWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

ReadWord16Source#

Since: 2.1

Instance details

Defined inGHC.Read

RealWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

ShowWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

IxWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

FiniteBitsWord16Source#

Since: 4.6.0.0

Instance details

Defined inGHC.Word

BitsWord16Source#

Since: 2.1

Instance details

Defined inGHC.Word

StorableWord16Source#

Since: 2.1

Instance details

Defined inForeign.Storable

PrintfArgWord16Source#

Since: 2.1

Instance details

Defined inText.Printf

dataWord32Source#

32-bit unsigned integer type

Instances
BoundedWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

EnumWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

EqWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

IntegralWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

DataWord32Source#

Since: 4.0.0.0

Instance details

Defined inData.Data

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Word32 -> cWord32Source#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cWord32Source#

toConstr ::Word32 ->ConstrSource#

dataTypeOf ::Word32 ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cWord32)Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cWord32)Source#

gmapT :: (forall b.Data b => b -> b) ->Word32 ->Word32Source#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Word32 -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Word32 -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Word32 -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Word32 -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Word32 -> mWord32Source#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Word32 -> mWord32Source#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Word32 -> mWord32Source#

NumWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

OrdWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

ReadWord32Source#

Since: 2.1

Instance details

Defined inGHC.Read

RealWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

ShowWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

IxWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

FiniteBitsWord32Source#

Since: 4.6.0.0

Instance details

Defined inGHC.Word

BitsWord32Source#

Since: 2.1

Instance details

Defined inGHC.Word

StorableWord32Source#

Since: 2.1

Instance details

Defined inForeign.Storable

PrintfArgWord32Source#

Since: 2.1

Instance details

Defined inText.Printf

dataWord64Source#

64-bit unsigned integer type

Instances
BoundedWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

EnumWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

EqWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

IntegralWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

DataWord64Source#

Since: 4.0.0.0

Instance details

Defined inData.Data

Methods

gfoldl :: (forall d b.Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) ->Word64 -> cWord64Source#

gunfold :: (forall b r.Data b => c (b -> r) -> c r) -> (forall r. r -> c r) ->Constr -> cWord64Source#

toConstr ::Word64 ->ConstrSource#

dataTypeOf ::Word64 ->DataTypeSource#

dataCast1 ::Typeable t => (forall d.Data d => c (t d)) ->Maybe (cWord64)Source#

dataCast2 ::Typeable t => (forall d e. (Data d,Data e) => c (t d e)) ->Maybe (cWord64)Source#

gmapT :: (forall b.Data b => b -> b) ->Word64 ->Word64Source#

gmapQl :: (r -> r' -> r) -> r -> (forall d.Data d => d -> r') ->Word64 -> rSource#

gmapQr :: (r' -> r -> r) -> r -> (forall d.Data d => d -> r') ->Word64 -> rSource#

gmapQ :: (forall d.Data d => d -> u) ->Word64 -> [u]Source#

gmapQi ::Int -> (forall d.Data d => d -> u) ->Word64 -> uSource#

gmapM ::Monad m => (forall d.Data d => d -> m d) ->Word64 -> mWord64Source#

gmapMp ::MonadPlus m => (forall d.Data d => d -> m d) ->Word64 -> mWord64Source#

gmapMo ::MonadPlus m => (forall d.Data d => d -> m d) ->Word64 -> mWord64Source#

NumWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

OrdWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

ReadWord64Source#

Since: 2.1

Instance details

Defined inGHC.Read

RealWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

ShowWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

IxWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

FiniteBitsWord64Source#

Since: 4.6.0.0

Instance details

Defined inGHC.Word

BitsWord64Source#

Since: 2.1

Instance details

Defined inGHC.Word

StorableWord64Source#

Since: 2.1

Instance details

Defined inForeign.Storable

PrintfArgWord64Source#

Since: 2.1

Instance details

Defined inText.Printf

byte swapping

byteSwap16 ::Word16 ->Word16Source#

Swap bytes inWord16.

Since: 4.7.0.0

byteSwap32 ::Word32 ->Word32Source#

Reverse order of bytes inWord32.

Since: 4.7.0.0

byteSwap64 ::Word64 ->Word64Source#

Reverse order of bytes inWord64.

Since: 4.7.0.0

Notes

  • All arithmetic is performed modulo 2^n, where n is the number of bits in the type. One non-obvious consequence of this is thatnegate shouldnot raise an error on negative arguments.
  • For coercing between any two integer types, usefromIntegral, which is specialized for all the common cases so should be fast enough. Coercing word types to and from integer types preserves representation, not sign.
  • An unbounded size unsigned integer type is available withNatural.
  • The rules that hold forEnum instances over a bounded type such asInt (see the section of the Haskell report dealing with arithmetic sequences) also hold for theEnum instances over the variousWord types defined here.
  • Right and left shifts by amounts greater than or equal to the width of the type result in a zero result. This is contrary to the behaviour in C, which is undefined; a common interpretation is to truncate the shift count to the width of the type, for example1 << 32 == 1 in some C implementations.

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp