{-# LANGUAGE MultiParamTypeClasses
, TypeSynonymInstances
, FlexibleInstances
#-}moduleData.ByteString.Nums.Careless.IntwhereimportPreludehiding(head,tail,null)importData.WordimportData.IntimportData.RatioimportData.ByteStringhiding(head,pack)importData.ByteString.InternalimportData.ByteString.Char8hiding(foldl')importqualifiedData.ByteString.Lazy.Char8asLazyimportqualifiedData.ByteString.Lazy.InternalasLazy{-| Types that can be read from integer strings. Parses only decimal digits.
Signed types can be read from strings that begin with a plus or minus;
unsigned types are read from strings consisting solely of decimal digits.
-}class(Numn)=>Intablebnwhereint::b->ninstanceIntableByteStringWord8whereint=strict_unsignedinstanceIntableByteStringWord16whereint=strict_unsignedinstanceIntableByteStringWord32whereint=strict_unsignedinstanceIntableByteStringWord64whereint=strict_unsignedinstanceIntableByteStringWordwhereint=strict_unsignedinstanceIntableByteStringInt8whereint=strict_signedinstanceIntableByteStringInt16whereint=strict_signedinstanceIntableByteStringInt32whereint=strict_signedinstanceIntableByteStringInt64whereint=strict_signedinstanceIntableByteStringIntwhereint=strict_signedinstanceIntableByteStringFloatwhereint=strict_signedinstanceIntableByteStringDoublewhereint=strict_signedinstanceIntableByteStringRationalwhereint=strict_signedinstanceIntableByteStringIntegerwhereint=strict_signedinstanceIntableLazy.ByteStringWord8whereint=lazy_unsignedinstanceIntableLazy.ByteStringWord16whereint=lazy_unsignedinstanceIntableLazy.ByteStringWord32whereint=lazy_unsignedinstanceIntableLazy.ByteStringWord64whereint=lazy_unsignedinstanceIntableLazy.ByteStringWordwhereint=lazy_unsignedinstanceIntableLazy.ByteStringInt8whereint=lazy_signedinstanceIntableLazy.ByteStringInt16whereint=lazy_signedinstanceIntableLazy.ByteStringInt32whereint=lazy_signedinstanceIntableLazy.ByteStringInt64whereint=lazy_signedinstanceIntableLazy.ByteStringIntwhereint=lazy_signedinstanceIntableLazy.ByteStringFloatwhereint=lazy_signedinstanceIntableLazy.ByteStringDoublewhereint=lazy_signedinstanceIntableLazy.ByteStringRationalwhereint=lazy_signedinstanceIntableLazy.ByteStringIntegerwhereint=lazy_signedlazy_unsigned::(Numn)=>Lazy.ByteString->nlazy_unsigned=Lazy.foldlChunks(foldl'positive)0lazy_signedbytes|Lazy.nullbytes=0|Lazy.headbytes=='-'=foldnegative0(Lazy.tailbytes)|Lazy.headbytes=='+'=foldpositive0(Lazy.tailbytes)|otherwise=foldpositive0byteswherefold=Lazy.foldlChunks.foldl'strict_unsigned::(Numn)=>ByteString->nstrict_unsigned=foldl'positive0strict_signedbytes|nullbytes=0|headbytes=='-'=foldl'negative0(tailbytes)|headbytes=='+'=foldl'positive0(tailbytes)|otherwise=foldl'positive0bytespositiveaccbyte=(acc*10)+fromIntegral(byte-c2w'0')negativeaccbyte=(acc*10)-fromIntegral(byte-c2w'0')