HOOGZx'..0033551/045uuww2 8QR_ aaa >>JLNNQRTVY]aagjnrtwyy|}b+,==BBYYaac %%**1167::@@BBJKQRYY[\^agirrtwyzd!#%(6>>FFRRnp}}e !')*88:;>BFFIMPRTTWY^bddffiinsxy}}f '9IIOPSSaaffnng+,88:=?BWWYYffhippxxh!!1167>EQQWW^^yyi !!#%',89;;ABFTXY]]ccffhjnprrxy~k 1167BBgiyyl !%''-6;;ABEEIIKLUY[[dfiimnrrtuxy~m "&78IIYdyyn #%(,116;@BEOWYcfhjmmoptz|}o  !-:<=@@BBIIOPRSYYaaddffjjxxz{p  !&&88<=CEIIMMPRZ\_afmqr|r  !''+,28<=DEINPRTTYY\\^^aaffhjlsvw{{s %%*,11679:@@DEHHMMOSUUXYbbhikmst! &'+,88:;?EGHJNTUWWYYabddffhjlmorxx{{~u +,116799<=CESS[]cceflmyyvNNssw !!RRx #$))FFOPSS]]y &&==VVYY`az VVyy#;+%j()%->%Allt%AnyS%ArithExceptionF%ArrayException9%AsyncException,%Bool$ BufferMode$ BufferState$ ByteString$CChar?$CClock $CDev#CDouble#CFloat)#CIno"CInt"CIntMaxQ"CIntPtr "CLDouble!CLLongh!CLong !CMode COff CPidH CPtrdiff CSCharCShortp CSigAtomic(CSizeCSsizeCTimefCUCharCUIntCUIntMaxCUIntPtrFCULLongCULongCUShortnCWchar&ChanCharComplex ConsoleEventConstr ConstrRepDataRepDataTypeDouble!DynamicE12E6Errno ExceptionExitCodeFDTypeFdFixityFloat!GeneralCategoryHandle HandlePosn HandleTypeHashDataIO IOErrorType IOExceptionIOModeIdtInsertspIntInt16Int32}Int64,Int8IntPtrIntegerSLexemeEMaybeOrderingPQSemQSemNReadPReadPrecqSTMXSeekMode> StableName3TVar(ThreadId TimeoutTyConTypeRepUniqueVersionWeakWorduWord16$Word32Word64Word81WordPtrZipList[::][]v TraversableFoldableMonadFix Applicative Alternative MonadPlusFunctorMonadFunctorMonadFunctor Applicative ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataEqOrdNumEnumIntegralBitsShowRealBoundedIxRead PrintfArgStorableDataNumEnumIntegralBitsShowRealBoundedIxReadOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq Typeable1EqOrdShowReadTypeableOrdEqDataDataEqTypeableDataShowEqOrdTypeable Typeable1 Typeable1ShowReadEnumIxOrdEq Typeable1FunctorMonadFunctorMonad MonadPlusFunctorMonad MonadPlusTypeableTypeableMonad MonadPlus MonoidDataReadShowBoundedEnumIxOrdEq TraversableFoldableMonadFix Applicative AlternativeFunctorMonad MonadPlusShowEqRead PrintfArgBitsDataReadEqOrdNumEnumShowIxRealIntegral ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgStorableDataEqOrdShowNumEnumIntegralReadBitsRealBoundedIx PrintfArgStorableDataShowNumEnumIntegralReadBitsRealBoundedIxOrdEq PrintfArgStorableDataShowNumRealEnumIntegralBoundedIxReadBitsOrdEq PrintfArgBitsStorableDataReadShowNumBoundedEnumIxRealIntegralEqOrdEqFunctor ApplicativeShowReadEnumIxOrdEqEqShowEqShowMonadFix ApplicativeFunctorMonadShowEqShowEqShowDataEqShowIxBoundedShowReadEnumOrdEq PrintfArgStorableDataEqOrdNumReal FractionalRealFracFloating RealFloatShowEnumReadShowEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqEqShowReadOrdEqShowEqEq HasResolution HasResolutionTypeableShow PrintfArgStorableDataEqOrdNumReal FractionalFloatingRealFrac RealFloatShowEnumReadTypeableDataShowShowEqShowEqShowEqReadShowEnumOrdEqTypeable Typeable1 PrintfArgIsCharStorableDataReadShowBoundedEnumIxEqOrd Typeable1 ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeable RealFloatRealFracFloating FractionalRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableRealStorableEnumNumOrdEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqIsStringDataReadShowTypeableEqOrdMonoidIsStringShowReadDataTypeableEqOrdMonoidEqShowReadOrdEq StorableDataReadShowBoundedEnumIxOrdEqShowOrdEqShowOrdEqShowOrdEqMonoidBoundedShowReadOrdEqMonoidBoundedShowReadOrdEqArrow ArrowChoice ArrowApply ArrowLoop MonoidDataReadShowBoundedEnumIxEqOrd%4 ByteCount3+CDir.+CDirent)+CFLock$+CGroup+CLconv+CPasswd+ CSigaction+CSigset +CStat+CString* CStringLen*CTermios*CTm*CTms*CUtimbuf*CUtsname*CWString* CWStringLen* ClockTick*ConIndex*DeviceID* EpochTimey*FDr*FileIDk*FileModec* FileOffset\*FilePathO*FinalizerEnvPtr* FinalizerPtr)Generic)GenericB)GenericM)GenericQ)GenericR)GenericT)HandlePosition)IOError)IPr)Limit)Microv)Picog)Preca)ProcessGroupIDZ) ProcessIDS)Rational@) RawBuffer)ReadS(STRep( SampleVar(ShowS(String{([]Char[]Char[]CharaMVar(,)IntMVarasaState#s(#,#)State#saa[]Char[](,)a[]CharMutableByteArray# RealWorldRatioIntegerCPidCPidIntFixedE12FixedE6CLong(,)IntInt IOExceptionIntegeraammararmamaacacaaFunPtrPtraIO()envaFunPtrPtrenvPtraIO()[]CharCOffCModeCInoCIntCTimeCDevIntCClock(,)PtrCWcharIntPtrCWchar()()()()()(,)PtrCCharIntPtrCChar()()()()()()()()()CSize(:܀[azbvcjdpfe*cf+]g[hXi$RjQkQlNmKnHoEpAqIAr;sZ5tA2uu/v:/w+z+i+p+l+i+s+t+ZipList#0/1/3.6.8.e.o-r),a,i5,t<,eC,b,hu,mT,o[,db,ei,IOModea|,n,d,l,e, HandleTypeu,f,f,e,r, BufferStatep,a-mr-p,e,d-a@-m-o-n-a#-d*- WrappedMonadrG-rN-oU-w\- WrappedArrowoy-n-a-d- WrappedMonadr-r-o-w- WrappedArrowr-d-Word#.1z.3c.66.8'.p.t.r.WordPtrWord84=.Word64#R.Word64#2j.Word326.Word16Word#a.k.Weak#.Weak##.Word84.#.Word642/# /Word326/#$/Word16WordeA/rH/sO/iV/o]/nd/Versionn80p/s/e/r/e/r/r/o/r/ IOErrorTypep/e/r/c/a/s/e/l0e0t0t0e0r#0GeneralCategoryd1ie1sI0a0uU0p\0pc0oj0rq0tx0e0d0o0p0e0r0a0t0i0o0n0 IOErrorTypet0i0s0f0i0e1d1c1o1n1s#1t*1r11a81i?1nF1tM1sT1 IOErrorTypeq1tq1Unitu1e1Uniquee1f1r1f1l1o1w1ArithExceptioni1n1e1d1e2l 2e2m2e2n&2t-2ArrayExceptionh4i 4r3v3y\2ci3ph2eo2a2r{2e2p2TypeRepb2l2e2Typeable1V32C3303435 36272 Typeable7 Typeable6 Typeable5 Typeable4 Typeable3 Typeable2 Typeable1op3nw3TyCona3r3TVara3u3e3Boolv3e3r3s3a3b3l3e3 Traversablem4t4l4e&4c-4a44s;4eB4lI4eP4tW4t^4ee4rl4GeneralCategorye4e4x4p4i4r4e4d4 IOErrorTyper4e4a4d4i)5k4i4l5l5e5d5AsyncExceptiond05ThreadId#G5 ThreadId##:a:e9hb9p8tR6u5y5m5s5t5e5m5e5r5r5o5r5 IOErrorTypeb5o5l5LexememE6r6r 6o6g6a"6t)6e06GeneralCategorySumSTa7m~7oI7rr6e6i~6n6g6Stringc6r6e6p6DataRepo6n6s6t6r6 ConstrRepa67f'7p7t 7STretSTRepSTRefm=7FDTyperP7aW7b^7le7el7StorableSTMb88c7r7t7e7#7State#r7a7y7STArrayk7o7v7e8r8f8l8o8w$8AsyncExceptionl?8eF8n8pR8tY8r`8 StablePtr#x8 StablePtr#a8m8e8 StableNamea8c8eM9i8n8g8c8o8m8b8i9n9i9n9g9m#9a*9r19k89GeneralCategoryGeneralCategoryo9un9tu9d|9o9w9n9 ConsoleEventw9Shows9ShowSeC:m9i9c9l9o9s9e:d :h:a:n:d%:l,:e3: HandleTypekJ:f}:mV:o]:dd:ek:SeekModer:o:m:e:n:d:SeekModem:p:l:e:v:a:r: SampleVarIntegera@e8;i;g;h%;t,;Eitheraf>c=gQ=l=q<s;t];ud;rk;nr;iy;n;o;r;d;e;r;ArgOrdero;u;r;c;e;bp<e'<v;a;n;i;s<h<e<d< IOErrorTypex.<h5<a<<uC<sJ<tQ<eX<d_< IOErrorTypeuw<s~<y< IOErrorTypea<u<i<r<e<o<r<d<e<r<ArgOrderr<g<ArgDescra =t=i=v =e'=s.=e5=e<=kC=SeekModeuX=l_=af=rm=ft=i{=l=e=FDTypec&>s=u=p=d=e=r=r=o=r= Exceptione=l=e=r>r >o>r> Exceptiono->n4>e;>rB>rI>oP>rW> Exceptiond ?lr>Realf>w>o>r>l>d> RealWorldl>r>a>c>RealFraco>a>t> RealFloatReadbL@h@m?p?s?w9?r@?iG?tN?eU?h?ma?oh?do?ev?IOModea?n?d?l?e? HandleTypeReadSReadPr?e?c?ReadPreco?d@e @IOModea @n'@d.@l5@e<@ HandleTypeuS@fZ@fa@eh@ro@ BufferStatet@w@b@d@e@v@i@c@e@FDTypeu@f@f@e@r@ RawBufferLexemeiAoARation)Aa0Al7ARationalsPAeWAm^AQSemnqAQSemNaDeDiCoCrAsAtAuAnAcALexemerAPtr ByteStringeCiBoAcBdZBt BoBcBoBl&Be-Br4Br;BoBBrIB IOErrorTypeuaBchBtoBProducteBsBsBgBiBdB ProcessIDrBoBuBpBiBdBProcessGroupIDnHCv CaCtCeCu%Cs,Ce3CGeneralCategorytOCfVCaCtbCyiCppCewC PrintfTyperCgC PrintfArgcCfCiCxCFixityPrecoClCPoolcDo DPicorDm&DiNDu2Dt9De@DArgOrdersUDs\DicDojDnqDdxDeDnDiDeDdD IOErrorTyper"EtDtDeDrDnDmDaDtDcDhDfDaEi ElE Exceptiona)Eg0Er7Ea>EpEEhLEsSEeZEpaEahEroEavEt}EoErEGeneralCategoryOpaquebHpGrcGtFvEeErEfElEoEwEArithExceptionh FeFrFe6GlFnFpkFs3Fy:FmAFbHFoOFlVFGeneralCategoryurFnyFcFtFuFaFtFiFoFnFGeneralCategoryuFmFbFeFrFGeneralCategoryeGt GtGeGr!GGeneralCategoryr=GrDGoKGrRG IOErrorTypedjGOrde|GrGiGnGgGOrderingaHe2HtGaHdGiGoGnGOptDescreGsGcGrHOptDescrrHg$HArgDescrn9Hp@HuGHnNHcUHt\HucHajHtqHixHoHnHGeneralCategoryqHuHeHOpaquejHeHcHtHObjecteKoIuHmINumaeKbKmJn JrIsIt6IabIhBIiIInPIgWIMaybesiIspIiwIg~InIeIdIGeneralCategoryuIcIhItIhIiInIgI IOErrorTypeeIpIDataRepsmJtJeJr&Jm-Ji4Jn;JaBJtIJiPJoWJn^J ExceptionptJa{JcJiJnJgJmJaJrJkJGeneralCategoryeJtJhJoJdJeJrJrKoKrK Exceptionu$Kf+Kf2Ke9Kr@KiGKnNKgUK BufferModerlKgsKArgDescrsKtKeKdKaKtKoKmKiKcKaKlKlKyK ExceptionaNihNo+Mu=Lv LaLrLMVar#.LMVar#tDLavLvPLaWLr^L#eLMutVar#b}LlLeLaLbLyLtLeLaLrLrLaLyL#LMutableByteArray#rLrLaMy M#M MutableArray#dMn7MaaMoCMiJMdQMMonoiddhMMonadfMpMlMuMsM MonadPlusiMxMMonadFixiMfMiMeMrMl0NsMyMmNb NoNlNGeneralCategorye7Nt>NtENeLNrSNGeneralCategorycoNrvNo}NMicrotNyNbNeNMaybehNsNyNmNbNoNlNGeneralCategoryaQePi-Po$OtOOrderinggPsOw5OeYpXrXiXnXtYf YtYyYp"Ye)Y HPrintfTypeaEYpLYoSYvZYeaYrhYfoYlvYo}YwYAsyncExceptionnZrAZsYh ZrYeYsYoYlYuYtYiYoYnY HasResolutiontZaZb Zl'Ze.Z HashTabledHZwOZaVZr]ZedZfkZarZuyZlZtZ IOErrorTypedZlZeZHandle_m[p [rZtZyZpZeZ HandleTypeHandlero[s[i9[n%[ HandlePosnt@[iG[oN[nU[HandlePosition_t[Handle__e[m[q[t[Ordering GenericQ' GenericM'n[e[r[a\i[c[Generic'\b\m\q[\rI\t\GenericT'6\ GenericT'GenericRGenericQ'r\ GenericQ'GenericM'\ GenericM'GenericBGeneric'l\c\a\t\e\g\o]r ]y]GeneralCategory #cacdbfai_l^o]r]uZ]na]c]pm]tt]r{]FunPtrt]o]r]Functora]c]t]i]o]n]a]l] Fractionall^r ^e8^m^a^t#^GeneralCategoryi?^gF^nM^pT^t[^rb^ ForeignPtrc{^o^n^t^e^n^t^s^ForeignPtrContentsd^a^b^l^e^Foldableo_a _t_Float#_cp_iP_r5_e<_pC_DataRepnW_g^_Floatingow_n~_s_t_r_ ConstrRepFloat#l`n%`r`x_e_i_t_y_Fixityd_Fixeds`t`Firsta,`l3`ip`q?`uF`oM`tT`e[`GeneralCategoryzw`e~`r`e`p`t`r` FinalizerPtrn`v`p`t`r`FinalizerEnvPtre`haiamqao:apaaat!ah(aFilePathfAafHasOaeVat]a FileOffsetoxadaeaFileModedaFileIDaanadalaeaHandleebf'bgaeanaebr bibcbFFFormatiabo3br:bmAbaHbtObFFFormatxhbeobdvbFFFormatxbpbobnbebnbtbFFFormatFDFdtbybpbebFDTypelcscecBoolFloat 1\f6Pfi$fmenieoVepeqdrdx^ccedijctqcc>decfcscucccccecscscExitCodeaciclcucrcecExitCodexccde dpdtdi!do(dn/d ExceptionoEddLdeSdExitCodeeldpsdtzdidodnd Exceptionrdndodrdcdadldld ExceptionodErrnoOrderingEqoec eh'et.ei5emjDataRephVjp]judjnkjcrjtyjujajtjijojnjGeneralCategoryDouble#vavcvvduf^ug2uhtiUtj!tlwrmSroYpposntmukwkcks'kt.kr5kimrEmCUIntPtra^mxemCUIntMaxh~mamrmCUCharemimmmCTmsmCTmsmmemCTimermmmimons nCTermioscohoinsnt:nanrFniMnnTng[nCStringlqnexnnn CStringLentnCStatinznenCSsizegnznenCSizeaosneot oCSigsetcWot'oo.om5oirmrnjpiqn^qsptprpoplpGeneralCategorycp ConsoleEventoqtpConstrpConstrrpeppq ConstrReplqe%qe,qv3qe:qnAqtHq ConsoleEventeeqclqtsqozqrqpquqnqcqtquqaqtqiqoqnqGeneralCategorynqdqeqxqConIndexprlre&rx-rComplexfErCOffoZrdarehrCModecsdslsorclsnVssrer ConsoleEventdsprurnrcrtrurartrirosnsGeneralCategoryh#sa*sn1sd8sl?seFs HandleTypeg]sCLongksstzsiscsks ClockTickosnsgsCLLongosusbslsesCLDoubleotn tvtCLconvm(tp/tb6tu=tfDtCJmpBufn\totthtCIntmtptttrtCIntPtratxtCIntMaxCInoatutntkt ByteStringn$uruChar#uChar#Chanr9uo@uuGupNuCGroupiulupouovus}uCFposouaucukuCFLocktuCFloatlueuCFileeavi(vouuvb vlvevCDoubler/vCDireBvnIvtPvCDirentvhvCDevhvlvovcvkvCClockavrvCChartvcvhvHandlerCharirzlLyoxrxuwywtwewawcfws/wt6wr=wiDwnKwgRw ByteStringomwutwn{wtw ByteCountrwrwawyw#w ByteArray#fwfwewrwBufferlaxm8xsxtxaxtxe#x BufferStateo?xdFxeMx BufferModeihxsoxtvx BufferListcxnxixlx BufferListoxnxsx BufferListexaxkx ConsoleEvento7yu ynydyeyd&yBoundedl>yBooloSycZykayb*zemydtyiyoynydyeyaydymyvyayry Exceptionnydyeyfyiynyiytze zlzyz Exceptionu1zf8zf?zeFzrMziTzn[zgbz BufferModetyzszBitsbTd0ln~p5~r{szs${yznzczezxzczezpztzizo{n {AsyncExceptione+{r2{t9{i@{oG{nN{fU{a\{ic{lj{eq{dx{ Exceptiong}ih}r{a|o{w{Arrowa|c|lX|m(|p|z{e{r{o{ ArrowZerol|u|s| ArrowPluso/|n6|a=|dD| ArrowMonado_|of|pm| ArrowLooph|o|i|c|e| ArrowChoicep|p|l|y| ArrowApplyy|Array#X}e}x}c}e}p$}t+}i2}o9}n@}ArrayExceptionArray#to}hv}e}}x}c}e}p}t}i}o}n}ArithExceptiond~o}r}d}e}r}ArgOrdere~s~c~r#~ArgDescrp<~e~lH~iO~cV~a]~td~ik~vr~ey~ Applicativen~d~h~m~o~d~e~IOModea~n~d~l~e~ HandleTypeyAnyglrst&e-r4n;aBtIiPvWe^ Alternativeezadyexists IOErrorTypeAllcrepDataRepon str! ConstrRepd7r>#EAddr#s[obliuptwe~seekSeekMode:][]:ǀ]΀[::]*+::+:::*:)()'ˈׄ!Boolqc[C<.' ByteString$ywutsrd\ZYXSPOND=91/($Charxg630InteE2Int64fF5Word8G874a{i()IOWord8PtrFunPtr ByteString ByteString(,)|j]WM) ByteStringacc(,)aMaybe ByteString(,)VU()IOhI    ByteStringIO TRLJH ByteString[]vn`@#CIntIO CSizeIO CULongIOCharMaybekChar[]%IntMaybe}l^>*Int[]oaA-Int64Maybe~m_?Int64[]pbBWord8 ForeignPtrWord8IOWord8MaybeWord8[]&aIO;:a[]z ByteStringChar(,)Maybe ByteStringInt(,)Maybe  ByteStringInteger(,)Maybe! ByteStringWord8(,)Maybe"CharChar(,)[]+Word8Word8(,)[],a ByteString(,)IOQIntIntWord8 ForeignPtr(,,)()PtrIOWord8PtrIOa ForeignPtrIOK Hэ{Œ{.҉ BoolCharCharvBoolWord8Word8CharCharCharyxwWord8Word8Word8a ByteStringaaCharCharzaCharaaWord8Word8aWord8aaa ByteStringiaaChar{aaWord8Characc(,)CharaccWord8acc(,)Word8accBoolChar rqponmlkjBoolWord8 ~}| ByteString ByteStringh ByteStringChars ByteStringWord8CharCharutWord8Word8aChar(,)MaybeaUaWord8(,)MaybeaV()IOWord8PtrSRIntIOWord8PtrTaIOCCharPtr;aIntInt(,,)IOWord8PtrQaIOIntCCharPtr(,): Addr#L ByteString~}|{zzyxwvtsrqponmlkjifedcba`_^]XWNMIFEDCBA@?>;:9876543210//..--,,++**))('&%$#"!CIntCSize  CULong  CharyuYOGFEDCBA@?>=<1HandleJIHIntVUTSRQPONMLKJ43Int64ZYXW76Word8gfedcba`_^]\[ZP9 a {iVUacc  ()IO ByteString[]$CCharPtr Char[] RealWorldMutableByteArray#Word8 ForeignPtrWord8Ptr      Word8[]aIOaPtrCharChar(,)[]Word8Word8(,)[]IntCCharPtr(,)mbC(ݢpeZK6+֡iZOD ݠwhY>ߟПiJ#ܞўƞnSH5& ߝĝY2' ؜͜œpeZO<1"ۛ}^OD9*ޚϚtaR? ٙΙzo`Q. ۘИtDE$%stwe43()mTSU&'*+TV/Cb, oq!^$  MZ[wxSuvy~a+ionpUVr#qpvxYz;M=H\ W *h"f59Qa):E]!?14 56723}ebcjlkiFKCStringjGL CStringLenX 0AFG<8=B rsW]^ >?@#lRQ"y9RY_%&D\dfIg87<.:`'(-N}d2  1 NO;.>J ktuOPXFilePathStringP  FilePath 6H`{c/0hJI RawBufferA~CStringK@CCStringLB CStringLen_gmn,-|<μnBλ|^@"ĺ}Y/չuM3sK̷T*ܶnL*̵^FشrB"̳fF$ҲV8Ʊz\<(vL&ޯtN.rb>Эd>ʬxX@ pN.rL,ҩfF$¨T Ƨv@"ܦX:zipwith zipWithmSTzipBziplQR writefilef writeFilekOPwordswordsNw2cw2cMuseascstringlen¦useAsCStringLenjL useascstring useAsCStringiKunzipunziphIJunwords.unwordsHunsafeuseascstringlenZunsafeUseAsCStringLenGunsafeuseascstringunsafeUseAsCStringF unsafetake unsafeTakeE unsafetailէ unsafeTailDunsafepackmalloccstringunsafePackMallocCStringCunsafepackcstringlen9unsafePackCStringLenBunsafepackcstringfinalizersunsafePackCStringFinalizerAunsafepackcstringunsafePackCString@unsafepackaddresslenۨunsafePackAddressLen?unsafepackaddress unsafePackAddress> unsafeindex4 unsafeIndex= unsafeheadU unsafeHead<unsafefinalizeyunsafeFinalize; unsafedrop unsafeDrop: unsafecreate unsafeCreate9unsafeݩUnsafeunpackunpackg78unlinesunlines6unfoldrn9unfoldrNf5unfoldrXunfoldre34uncons}unconsd12 transpose transposec/0 toforeignptrѪ toForeignPtr.tochunkstoChunks- takewhile takeWhileb+,take7takea)*tailsXtails`'(tailytail_%& splitwith splitWith^#$splitatƫsplitAt]!"splitsplit\ spanendspanEnd[span)spanZsortIsortYsnocasnocXsmallchunksizesmallChunkSize singleton singletonWscanr1լscanr1VscanrscanrUscanl1 scanl1Tscanl&scanlSreverseJreverseR replicater replicateQrepeatrepeat  readinteger readInteger readintܭreadInt readfilereadFileP  putstrln#putStrLnOputstrIputStrNpsiPS partition partitionMpackcstringlenpackCStringLenL packcstringЮ packCStringKpackpackJnullforeignptrnullForeignPtrnull7nullInotelemZnotElemHminimumminimumGmemsetmemsetmemcpy_ptr_baoffǯmemcpy_ptr_baoffmemcpymemcpymemcmpmemcmpmemchrmemchrmaximum2maximumF mapaccumrZ mapAccumRE mapaccuml mapAccumLDmapmapCmallocbytestringӰmallocByteStringlineslineslengthlengthBlazy1LazylastElastAiteratehiterate issuffixof isSuffixOf@ isspaceword8 isSpaceWord8 isspacechar8ױ isSpaceChar8 isprefixof isPrefixOf? isinfixof$ isInfixOf> invariantF invariant interspersef intersperse=internalInternal intercalate intercalate<interact߲interact;inlineperformioinlinePerformIOinits.inits:initOinit9indexpindex8 hputstrln hPutStrLn7hputstrhPutStr6hputճhPut5hgetnonblockinghGetNonBlocking4hgetline/hGetLine3 hgetcontentsS hGetContents2hget{hGet1headhead0groupbygroupBy/~groupgroup.}getlinegetLine- getcontents( getContents,|fusionQFusionfromforeignptrqfromForeignPtr fromchunks fromChunks{ foldrchunks foldrChunkszfoldr1'صfoldr1'+foldr1foldr1*yfoldr'foldr')foldr4foldr(x foldlchunks\ foldlChunkswfoldl1'zfoldl1''vfoldl1foldl1&ufoldl'öfoldl'%tfoldlfoldl$sfindsubstringsfindSubstrings# findsubstring< findSubstring" findindicesd findIndices!r findindex findIndex qfindfindpfilter׷filteroemptyEmptymemptyn elemindices- elemIndicesl elemindexend\ elemIndexEnd elemindex elemIndexkelemelemj dropwhile˸ dropWhileidropdrophdefaultchunksizedefaultChunkSizegcycle=cyclefcreateandtrim'`createAndTrim' createandtrim createAndTrimcreatecreatecountcountecopy޹copydcons'cons'cconsconsb concatmap= concatMapaconcatdconcat` chunkoverhead chunkOverhead_chunkChunk]chunk^checkinvariant׺checkInvariant\char8Char8c_strlenc_strlen c_reverse0 c_reverse c_minimumN c_minimum c_maximuml c_maximum c_intersperse c_interspersec_free_finalizerc_free_finalizerc_countڻc_count~c2wc2w} bytestring  ByteStringz{|Z[ bytestringbreaksubstringUbreakSubstringybreakend{breakEndx breakbyte breakBytebreakbreak vwY appendfileݼ appendFile tuXappendappend rsWany&any pqVallDall noU!GͼNrڱ)xϮ1 (Ӡ՟*٘6ϔw^=߇t>CUҁi~}|=|{zyxtw vtsrpoomkihg"gfmecmb`1`_]O\x[Y^XvW~VUUvT4ShQNMKJ JHGFEB@?>p=<U;9875437321!10/- *)("'&y%$+$##j""^! A3H#    2 b{,P+zKWRZF'M|xr{&b<w?!q3;u B˿+h3P3AUQHVZbf©g§!TUe١<L5WՙSȕn:Đɏ'|jvςP}zyxvtsr3rlq4pnm[lkjihhg[d7b_^I^]\ZXW4VQNYLIGECB9=/9f8I764W321)1{0.-u+)(' '[&X%`$h#"4"`! / E3I^5\  W  r 3'V 3 ]Ni].RsQo[7C 2i\:zipWith zipWith :: (Char -> Char -> a) ->  ByteString ->  ByteString -> [a]CharChara ByteString ByteString[]azipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two ByteStrings to produce the list of corresponding sums. zipzip ::  ByteString ->  ByteString -> [(Char, Char)]vB ByteString ByteString[](,)CharChar4O(n) zip takes two ByteStrings and returns a list of corresponding pairs of Chars. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of unpack operations, and so space usage may be large for multi-megabyte ByteStrings  writeFile writeFile :: FilePath ->  ByteString -> IO ()3FilePath ByteStringIO()%Write a ByteString to a file. wordswords ::  ByteString ->  [ByteString] ByteString[] ByteStringwords breaks a ByteString up into a list of words, which were delimited by Chars representing white space. And
tokens isSpace = words
unwordsunwords ::  [ByteString] ->  ByteString[] ByteString ByteStringSThe unwords function is analogous to the unlines function, on words. unpackunpack ::  ByteString -> [Char]{ ByteString[]Char=O(n) Converts a ByteString to a String. unlinesunlines ::  [ByteString] ->  ByteStringI([] ByteString ByteStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each. unfoldrunfoldr :: (a -> Maybe (Char, a)) -> a ->  ByteString\,aMaybe(,)Charaa ByteStringO(n) The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call. unconsuncons ::  ByteString -> Maybe (Char, ByteString)rA ByteStringMaybe(,)Char ByteStringYO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty.  transpose transpose ::  [ByteString] ->  [ByteString]M&[] ByteString[] ByteStringaThe transpose function transposes the rows and columns of its ByteString argument. toChunkstoChunks ::  ByteString ->  [ByteString]& ByteString[] ByteStringUO(n) Convert a lazy ByteString into a list of strict ByteString  takeWhile takeWhile :: (Char -> Bool) ->  ByteString ->  ByteStringCharBool ByteString ByteStringtakeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p. taketake :: Int64 ->  ByteString ->  ByteStringG%Int64 ByteString ByteStringO(n\c)/ take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs. tailstails ::  ByteString ->  [ByteString]xW ByteString[] ByteStringUO(n) Return all final segments of the given ByteString, longest first. tailtail ::  ByteString ->  ByteString5 ByteString ByteStringZO(1) Extract the elements after the head of a ByteString, which must be non-empty.  splitWith splitWith :: (Char -> Bool) ->  ByteString ->  [ByteString]1CharBool ByteString[] ByteStringKO(n) Splits a ByteString into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
splitWith (=='a') "aabbaca" == ["","","bb","c",""]
splitAtsplitAt :: Int64 ->  ByteString -> (ByteString, ByteString)#Int64 ByteString(,) ByteString ByteStringlO(n\c)/ splitAt n xs is equivalent to (take n xs, drop n xs). splitsplit :: Char ->  ByteString ->  [ByteString]Char ByteString[] ByteStringO(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
split 'a'  "aXaXaXa"    == ["","X","X","X"]
split 'x'  "x"          == ["",""]
and
intercalate [c] . split c == id
split == splitWith . (==)
As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original. spanspan :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString)tCharBool ByteString(,) ByteString ByteStringspan p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs) snocsnoc ::  ByteString -> Char ->  ByteString ByteStringChar ByteStringvO(n) Append a Char to the end of a ByteString. Similar to cons, this function performs a memcpy. smallChunkSizesmallChunkSize :: Int}wInt9Currently set to 4k, less the memory management overhead  singleton singleton :: Char ->  ByteStringChar ByteString;O(1) Convert a Char into a ByteString scanl scanl :: (Char -> Char -> Char) -> Char ->  ByteString ->  ByteString CharCharCharChar ByteString ByteStringscanl is similar to foldl, but returns a list of successive reduced values from the left. This function will fuse.
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
Note that
last (scanl f z xs) == foldl f z xs.
reversereverse ::  ByteString ->  ByteStringn ByteString ByteString]O(n) reverse xs returns the elements of xs in reverse order.  replicate replicate :: Int64 -> Char ->  ByteStringdHInt64Char ByteString{O(n) replicate n x is a ByteString of length n with x the value of every element. repeatrepeat :: Char ->  ByteString?*Char ByteString`repeat x is an infinite ByteString, with x the value of every element.  readInteger readInteger ::  ByteString -> Maybe (Integer, ByteString)?  ByteStringMaybe(,)Integer ByteStringreadInteger reads an Integer from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. readIntreadInt ::  ByteString -> Maybe (Int, ByteString)q ByteStringMaybe(,)Int ByteStringreadInt reads an Int from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. readFilereadFile :: FilePath ->  IO ByteStringFilePathIO ByteStringmRead an entire file lazily into a ByteString. Use 'text mode' on Windows to interpret newlines putStrLnputStrLn ::  ByteString -> IO () ByteStringIO()7Write a ByteString to stdout, appending a newline byte putStrputStr ::  ByteString -> IO ()R9 ByteStringIO()Write a ByteString to stdout packpack :: [Char] ->  ByteString[]Char ByteString>O(n) Convert a String into a ByteString. nullnull ::  ByteString -> BoolmX ByteStringBool0O(1) Test whether a ByteString is empty. notElemnotElem :: Char ->  ByteString -> BoolChar ByteStringBool9O(n) notElem is the inverse of elem minimumminimum ::  ByteString -> Char ByteStringCharBminimum returns the minimum value from a ByteString maximummaximum ::  ByteString -> CharT? ByteStringCharBmaximum returns the maximum value from a ByteString  mapAccumR  mapAccumR :: (acc -> Char -> (acc, Char)) -> acc ->  ByteString -> (acc, ByteString)v+accChar(,)accCharacc ByteString(,)acc ByteStringThe mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.  mapAccumL  mapAccumL :: (acc -> Char -> (acc, Char)) -> acc ->  ByteString -> (acc, ByteString)n#accChar(,)accCharacc ByteString(,)acc ByteStringThe mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString. mapmap :: (Char -> Char) ->  ByteString ->  ByteStringCharChar ByteString ByteStringvO(n) map f xs is the ByteString obtained by applying f to each element of xs lineslines ::  ByteString ->  [ByteString] ByteString[] ByteStringlines breaks a ByteString up into a list of ByteStrings at newline Chars. The resulting strings do not contain newlines. As of bytestring 0.9.0.3, this function is stricter than its list cousin. lengthlength ::  ByteString -> Int64) ByteStringInt64SO(n\c)/ length returns the length of a ByteString as an Int64 lastlast ::  ByteString -> Char ByteStringCharRO(1) Extract the last element of a packed string, which must be non-empty. iterateiterate :: (Char -> Char) -> Char ->  ByteStringCharCharChar ByteStringiterate f x returns an infinite ByteString of repeated applications of f to x:
iterate f x == [x, f x, f (f x), ...]
 isPrefixOf isPrefixOf ::  ByteString ->  ByteString -> Bool ByteString ByteStringBoolO(n) The isPrefixOf function takes two ByteStrings and returns True iff the first is a prefix of the second.  invariant invariant ::  ByteString -> Bool ByteStringBoolThe data type invariant: Every ByteString is either Empty or consists of non-null ByteStrings. All functions must preserve this, and the QC properties must check this.  intersperse intersperse :: Char ->  ByteString ->  ByteString Char ByteString ByteStringO(n) The intersperse function takes a Char and a ByteString and `intersperses' that Char between the elements of the ByteString. It is analogous to the intersperse function on Lists.  intercalate intercalate ::  ByteString ->  [ByteString] ->  ByteStringS ByteString[] ByteString ByteStringO(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list. interactinteract :: (ByteString -> ByteString) -> IO () ByteString ByteStringIO()The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. initsinits ::  ByteString ->  [ByteString]F% ByteString[] ByteStringXO(n) Return all initial segments of the given ByteString, shortest first. initinit ::  ByteString ->  ByteString ByteString ByteStringSO(n\c)/ Return all the elements of a ByteString except the last one. indexindex ::  ByteString -> Int64 -> Char ByteStringInt64CharKO(1) ByteString index (subscript) operator, starting from 0. hPuthPut :: Handle ->  ByteString -> IO ()tHandle ByteStringIO()<Outputs a ByteString to the specified Handle. hGetNonBlockinghGetNonBlocking :: Handle -> Int ->  IO ByteStringdBHandleIntIO ByteStringhGetNonBlocking is similar to hGet, except that it will never block waiting for data to become available, instead it returns only whatever data is available.  hGetContents hGetContents :: Handle ->  IO ByteStringeHandleIO ByteStringRead entire handle contents lazily into a ByteString. Chunks are read on demand, using the default chunk size. Once EOF is encountered, the Handle is closed. hGethGet :: Handle -> Int ->  IO ByteStringHandleIntIO ByteString[Read n bytes into a ByteString, directly from the specified Handle. headhead ::  ByteString -> CharcN ByteStringCharPO(1) Extract the first element of a ByteString, which must be non-empty. groupBygroupBy :: (Char -> Char -> Bool) ->  ByteString ->  [ByteString]_*CharCharBool ByteString[] ByteStringKThe groupBy function is the non-overloaded version of group. groupgroup ::  ByteString ->  [ByteString] ByteString[] ByteStringThe group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test.  getContents getContents ::  IO ByteString IO ByteStringGgetContents. Equivalent to hGetContents stdin. Will read lazily  fromChunks fromChunks ::  [ByteString] ->  ByteString[] ByteString ByteStringUO(c) Convert a list of strict ByteString into a lazy ByteString  foldrChunks  foldrChunks :: (ByteString -> a -> a) -> a ->  ByteString -> a ByteStringaaa ByteStringaCConsume the chunks of a lazy ByteString with a natural right fold. foldr1foldr1 :: (Char -> Char -> Char) ->  ByteString -> Char}CharCharChar ByteStringCharfoldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty ByteStrings foldr foldr :: (Char -> a -> a) -> a ->  ByteString -> aCharaaa ByteStringafoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a packed string, reduces the packed string using the binary operator, from right to left.  foldlChunks  foldlChunks :: (a -> ByteString -> a) -> a ->  ByteString -> a6 a ByteStringaa ByteStringa_Consume the chunks of a lazy ByteString with a strict, tail-recursive, accumulating left fold. foldl1'foldl1' :: (Char -> Char -> Char) ->  ByteString -> Char-  CharCharChar ByteStringCharA'foldl1\'' is like foldl1, but strict in the accumulator. foldl1foldl1 :: (Char -> Char -> Char) ->  ByteString -> Char  CharCharChar ByteStringCharfoldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty ByteStrings. foldl' foldl' :: (a -> Char -> a) -> a ->  ByteString -> a  aCharaa ByteStringa8'foldl\'' is like foldl, but strict in the accumulator. foldl foldl :: (a -> Char -> a) -> a ->  ByteString -> a  aCharaa ByteStringafoldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right.  findIndices findIndices :: (Char -> Bool) ->  ByteString -> [Int64]E  CharBool ByteString[]Int64The findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.  findIndex findIndex :: (Char -> Bool) ->  ByteString ->  Maybe Int64uHCharBool ByteStringMaybeInt64The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate. findfind :: (Char -> Bool) ->  ByteString ->  Maybe Char{CharBool ByteStringMaybeCharO(n) The find function takes a predicate and a ByteString, and returns the first element in matching the predicate, or Nothing if there is no such element. filterfilter :: (Char -> Bool) ->  ByteString ->  ByteStringCharBool ByteString ByteStringO(n) filter, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. emptyempty ::  ByteString ByteString(O(1) The empty ByteString EmptyEmpty ::  ByteString1$ ByteString elemIndices elemIndices :: Char ->  ByteString -> [Int64]Char ByteString[]Int64O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.  elemIndex elemIndex :: Char ->  ByteString ->  Maybe Int64Char ByteStringMaybeInt64O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal (by memchr) to the query element, or Nothing if there is no such element. elemelem :: Char ->  ByteString -> Bool)Char ByteStringBooltO(n) elem is the ByteString membership predicate. This implementation uses memchr(3).  dropWhile dropWhile :: (Char -> Bool) ->  ByteString ->  ByteString7CharBool ByteString ByteStringbdropWhile p xs returns the suffix remaining after takeWhile p xs. dropdrop :: Int64 ->  ByteString ->  ByteStringInt64 ByteString ByteStringO(n\c)/ drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs. defaultChunkSizedefaultChunkSize :: Int Int:Currently set to 32k, less the memory management overhead cyclecycle ::  ByteString ->  ByteString ByteString ByteStringcycle ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString. countcount :: Char ->  ByteString -> Int64Char ByteStringInt64count returns the number of times its argument appears in the ByteString
count      == length . elemIndices
count '\n' == length . lines
But more efficiently than using length on the intermediate list. copycopy ::  ByteString ->  ByteString ByteString ByteString*O(n) Make a copy of the ByteString with its own storage. This is mainly useful to allow the rest of the data pointed to by the ByteString to be garbage collected, for example if a large string has been read in, and only a small part of it is needed in the rest of the program. cons'cons' :: Char ->  ByteString ->  ByteStringoChar ByteString ByteStringO(1) Unlike cons, 'cons\'' is strict in the ByteString that we are consing onto. More precisely, it forces the head and the first chunk. It does this because, for space efficiency, it may coalesce the new byte onto the first 'chunk' rather than starting a new 'chunk'. So that means you can't use a lazy recursive contruction like this:
let xs = cons\' c xs in xs
You can however use cons, as well as repeat and cycle, to build infinite lazy ByteStrings. conscons :: Char ->  ByteString ->  ByteStringChar ByteString ByteString9O(1) cons is analogous to '(:)' for lists.  concatMap concatMap :: (Char -> ByteString) ->  ByteString ->  ByteStringChar ByteString ByteString ByteStringDMap a function over a ByteString and concatenate the results concatconcat ::  [ByteString] ->  ByteString ~ [] ByteString ByteString/O(n) Concatenate a list of ByteStrings.  chunkOverhead chunkOverhead :: Int!!IntFThe memory management overhead. Currently this is tuned for GHC only. chunkchunk ::  ByteString ->  ByteString ->  ByteString!! ByteString ByteString ByteStringHSmart constructor for Chunk. Guarantees the data type invariant. ChunkChunk ::  ByteString ->  ByteString ->  ByteString"" ByteString ByteString ByteStringcheckInvariantcheckInvariant ::  ByteString ->  ByteString8## ByteString ByteString,In a form that checks the invariant lazily.  ByteStringdata  ByteString#A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable  ByteStringdata  ByteString$A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable breakbreak :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString)&%CharBool ByteString(,) ByteString ByteStringPbreak p is equivalent to span (not . p).  appendFile appendFile :: FilePath ->  ByteString -> IO ()&&FilePath ByteStringIO()&Append a ByteString to a file. appendappend ::  ByteString ->  ByteString ->  ByteString'o' ByteString ByteString ByteString&O(n\c)/ Append two ByteStrings anyany :: (Char -> Bool) ->  ByteString -> Bool>((CharBool ByteStringBoolApplied to a predicate and a ByteString, any determines if any element of the ByteString satisfies the predicate. allall :: (Char -> Bool) ->  ByteString -> Bool@))CharBool ByteStringBoolApplied to a predicate and a ByteString, all determines if all elements of the ByteString satisfy the predicate. zipWith zipWith :: (Word8 -> Word8 -> a) ->  ByteString ->  ByteString -> [a]*I*Word8Word8a ByteString ByteString[]azipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two ByteStrings to produce the list of corresponding sums. zipWith zipWith :: (Char -> Char -> a) ->  ByteString ->  ByteString -> [a]',+CharChara ByteString ByteString[]azipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two ByteStrings to produce the list of corresponding sums. zipzip ::  ByteString ->  ByteString -> [(Word8, Word8)]-- ByteString ByteString[](,)Word8Word8O(n) zip takes two ByteStrings and returns a list of corresponding pairs of bytes. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of unpack operations. zipzip ::  ByteString ->  ByteString -> [(Char, Char)]C// ByteString ByteString[](,)CharChar4O(n) zip takes two ByteStrings and returns a list of corresponding pairs of Chars. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of unpack operations, and so space usage may be large for multi-megabyte ByteStrings  writeFile writeFile :: FilePath ->  ByteString -> IO ()10FilePath ByteStringIO()%Write a ByteString to a file.  writeFile writeFile :: FilePath ->  ByteString -> IO ()11FilePath ByteStringIO()%Write a ByteString to a file. wordswords ::  ByteString ->  [ByteString]E2$2 ByteString[] ByteStringrwords breaks a ByteString up into a list of words, which were delimited by Chars representing white space. w2cw2c :: Word8 -> Char32Word8CharLConversion between Word8 and Char. Should compile to a no-op. useAsCStringLenuseAsCStringLen ::  ByteString -> (CStringLen -> IO a) -> IO a33 ByteString CStringLenIOaIOaO(n) construction Use a ByteString with a function requiring a CStringLen. As for useAsCString this function makes a copy of the original ByteString.  useAsCString useAsCString ::  ByteString -> (CString -> IO a) -> IO a`545 ByteStringCStringIOaIOaO(n) construction Use a ByteString with a function requiring a null-terminated CString. The CString will be freed automatically. This is a memcpy(3). unzipunzip :: [(Word8, Word8)] -> (ByteString, ByteString)6{6[](,)Word8Word8(,) ByteString ByteStringO(n) unzip transforms a list of pairs of bytes into a pair of ByteStrings. Note that this performs two pack operations. unzipunzip :: [(Char, Char)] -> (ByteString, ByteString)77[](,)CharChar(,) ByteString ByteStringunzip transforms a list of pairs of Chars into a pair of ByteStrings. Note that this performs two pack operations. unwordsunwords ::  [ByteString] ->  ByteString88[] ByteString ByteStringSThe unwords function is analogous to the unlines function, on words. unsafeUseAsCStringLenunsafeUseAsCStringLen ::  ByteString -> (CStringLen -> IO a) -> IO a99 ByteString CStringLenIOaIOaRO(1) construction Use a ByteString with a function requiring a CStringLen. This function does zero copying, and merely unwraps a ByteString to appear as a CStringLen. It is unsafe:
  • After calling this function the CStringLen shares the underlying byte buffer with the original ByteString. Thus modifying the CStringLen, either in C, or using poke, will cause the contents of the ByteString to change, breaking referential transparency. Other ByteStrings created by sharing (such as those produced via take or drop) will also reflect these changes. Modifying the CStringLen will break referential transparency. To avoid this, use useAsCStringLen, which makes a copy of the original ByteString.
unsafeUseAsCStringunsafeUseAsCString ::  ByteString -> (CString -> IO a) -> IO a== ByteStringCStringIOaIOaO(1) construction Use a ByteString with a function requiring a CString. This function does zero copying, and merely unwraps a ByteString to appear as a CString. It is unsafe in two ways:
  • After calling this function the CString shares the underlying byte buffer with the original ByteString. Thus modifying the CString, either in C, or using poke, will cause the contents of the ByteString to change, breaking referential transparency. Other ByteStrings created by sharing (such as those produced via take or drop) will also reflect these changes. Modifying the CString will break referential transparency. To avoid this, use useAsCString, which makes a copy of the original ByteString.
  • CStrings are often passed to functions that require them to be null-terminated. If the original ByteString wasn't null terminated, neither will the CString be. It is the programmers responsibility to guarantee that the ByteString is indeed null terminated. If in doubt, use useAsCString.
 unsafeTake unsafeTake :: Int ->  ByteString ->  ByteString CBInt ByteString ByteStringA variety of take which omits the checks on n so there is an obligation on the programmer to provide a proof that 0 <= n <= length xs.  unsafeTail unsafeTail ::  ByteString ->  ByteString,DD ByteString ByteStringA variety of tail for non-empty ByteStrings. unsafeTail omits the check for the empty case. As with unsafeHead, the programmer must provide a separate proof that the ByteString is non-empty. unsafePackMallocCStringunsafePackMallocCString :: CString ->  IO ByteStringEsECStringIO ByteStringO(n) Build a ByteString from a malloced CString. This value will have a free(3) finalizer associated to it. This funtion is unsafe. If the original CString is later modified, this change will be reflected in the resulting ByteString, breaking referential transparency. This function is also unsafe if you call its finalizer twice, which will result in a double free error, or if you pass it a CString not allocated with malloc. unsafePackCStringLenunsafePackCStringLen ::  CStringLen ->  IO ByteStringHG CStringLenIO ByteStringO(1) Build a ByteString from a CStringLen. This value will have no finalizer associated with it, and will not be garbage collected by Haskell. This operation has O(1) complexity as we already know the final size, so no strlen(3) is required. This funtion is unsafe. If the original CStringLen is later modified, this change will be reflected in the resulting ByteString, breaking referential transparency. unsafePackCStringFinalizer unsafePackCStringFinalizer ::  Ptr Word8 -> Int -> IO () ->  IO ByteStringJJPtrWord8IntIO()IO ByteStringO(1) Construct a ByteString given a Ptr Word8 to a buffer, a length, and an IO action representing a finalizer. This function is not available on Hugs. This function is unsafe, it is possible to break referential transparency by modifying the underlying buffer pointed to by the first argument. Any changes to the original buffer will be reflected in the resulting ByteString. unsafePackCStringunsafePackCString :: CString ->  IO ByteStringLLCStringIO ByteStringO(n) Build a ByteString from a CString. This value will have no finalizer associated to it, and will not be garbage collected by Haskell. The ByteString length is calculated using strlen(3), and thus the complexity is a O(n). This function is unsafe. If the CString is later modified, this change will be reflected in the resulting ByteString, breaking referential transparency. unsafePackAddressLenunsafePackAddressLen :: Int -> Addr# ->  IO ByteString8OOIntAddr#IO ByteStringO(1) unsafePackAddressLen provides constant-time construction of ByteStrings which is ideal for string literals. It packs a null-terminated sequence of bytes into a ByteString, given a raw 'Addr\#' to the string, and the length of the string. This function is unsafe in two ways:
  • the length argument is assumed to be correct. If the length argument is incorrect, it is possible to overstep the end of the byte array.
  • if the underying Addr# is later modified, this change will be reflected in resulting ByteString, breaking referential transparency.
If in doubt, don't use these functions. unsafePackAddressunsafePackAddress :: Addr# ->  IO ByteStringKR/RAddr#IO ByteStringO(n) Pack a null-terminated sequence of bytes, pointed to by an Addr# (an arbitrary machine address assumed to point outside the garbage-collected heap) into a ByteString. A much faster way to create an Addr# is with an unboxed string literal, than to pack a boxed string. A unboxed string literal is compiled to a static char [] by GHC. Establishing the length of the string requires a call to strlen(3), so the Addr# must point to a null-terminated buffer (as is the case with string# literals in GHC). Use unsafePackAddressLen if you know the length of the string statically. An example:
literalFS = unsafePackAddress "literal"#
This function is unsafe. If you modify the buffer pointed to by the original Addr# this modification will be reflected in the resulting ByteString, breaking referential transparency. Note this also won't work if you Add# has embedded '\0' characters in the string (strlen will fail).  unsafeIndex unsafeIndex ::  ByteString -> Int -> Word8VV ByteStringIntWord8Unsafe ByteString index (subscript) operator, starting from 0, returning a Word8 This omits the bounds check, which means there is an accompanying obligation on the programmer to ensure the bounds are checked in some other way.  unsafeHead unsafeHead ::  ByteString -> Word8 XW ByteStringWord8A variety of head for non-empty ByteStrings. unsafeHead omits the check for the empty case, so there is an obligation on the programmer to provide a proof that the ByteString is non-empty. unsafeFinalizeunsafeFinalize ::  ByteString -> IO ()LY3Y ByteStringIO()Explicitly run the finaliser associated with a ByteString. References to this value after finalisation may generate invalid memory references. This function is unsafe, as there may be other ByteStrings referring to the same underlying pages. If you use this, you need to have a proof of some kind that all ByteStrings ever generated from the underlying byte array are no longer live.  unsafeDrop unsafeDrop :: Int ->  ByteString ->  ByteStringj[J[Int ByteString ByteStringA variety of drop which omits the checks on n so there is an obligation on the programmer to provide a proof that 0 <= n <= length xs.  unsafeCreate unsafeCreate :: Int -> (Ptr Word8 -> IO ()) ->  ByteString\\IntPtrWord8IO() ByteStringA way of creating ByteStrings outside the IO monad. The Int argument gives the final size of the ByteString. Unlike createAndTrim the ByteString is not reallocated if the final size is less than the estimated size. unpackunpack ::  ByteString -> [Word8] ^] ByteString[]Word89O(n) Converts a ByteString to a '[Word8]'. unpackunpack ::  ByteString -> [Char]^^ ByteString[]Char=O(n) Converts a ByteString to a String. unlinesunlines ::  [ByteString] ->  ByteString`_?_[] ByteString ByteStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each. unfoldrN unfoldrN :: Int -> (a -> Maybe (Char, a)) -> a -> (ByteString, Maybe a)`_`IntaMaybe(,)Charaa(,) ByteStringMaybeaO(n) Like unfoldr, unfoldrN builds a ByteString from a seed value. However, the length of the result is limited by the first argument to unfoldrN. This function is more efficient than unfoldr when the maximum length of the result is known. The following equation relates unfoldrN and unfoldr:
unfoldrN n f s == take n (unfoldr f s)
unfoldrunfoldr :: (a -> Maybe (Word8, a)) -> a ->  ByteStringbbaMaybe(,)Word8aa ByteStringO(n) The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is a prepending to the ByteString and b is used as the next element in a recursive call. unfoldrunfoldr :: (a -> Maybe (Char, a)) -> a ->  ByteStringddaMaybe(,)Charaa ByteString!O(n), where n is the length of the result. The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is the next character in the string, and b is the seed value for further production. Examples:
unfoldr (\x -> if x <= '9' then Just (x, succ x) else Nothing) '0' == "0123456789"
unconsuncons ::  ByteString -> Maybe (Word8, ByteString)gtg ByteStringMaybe(,)Word8 ByteStringYO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty. unconsuncons ::  ByteString -> Maybe (Char, ByteString)h^h ByteStringMaybe(,)Char ByteStringYO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty.  transpose transpose ::  [ByteString] ->  [ByteString]jiCi[] ByteString[] ByteStringaThe transpose function transposes the rows and columns of its ByteString argument.  transpose transpose ::  [ByteString] ->  [ByteString]Mj&j[] ByteString[] ByteStringaThe transpose function transposes the rows and columns of its ByteString argument.  toForeignPtr toForeignPtr ::  ByteString -> (ForeignPtr Word8, Int, Int)Skk ByteString(,,) ForeignPtrWord8IntInt7O(1) Deconstruct a ForeignPtr from a ByteString toChunkstoChunks ::  ByteString ->  [ByteString]lk ByteString[] ByteStringUO(n) Convert a lazy ByteString into a list of strict ByteString  takeWhile takeWhile :: (Word8 -> Bool) ->  ByteString ->  ByteStringllWord8Bool ByteString ByteStringtakeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.  takeWhile takeWhile :: (Char -> Bool) ->  ByteString ->  ByteString?nnCharBool ByteString ByteStringtakeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p. taketake :: Int64 ->  ByteString ->  ByteStringqoOoInt64 ByteString ByteStringO(n\c)/ take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs. taketake :: Int ->  ByteString ->  ByteStringppInt ByteString ByteStringO(1) take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs. tailstails ::  ByteString ->  [ByteString]qq ByteString[] ByteStringUO(n) Return all final segments of the given ByteString, longest first. tailstails ::  ByteString ->  [ByteString]rr ByteString[] ByteStringUO(n) Return all final segments of the given ByteString, longest first. tailtail ::  ByteString ->  ByteString^sCs ByteString ByteStringZO(1) Extract the elements after the head of a ByteString, which must be non-empty. tailtail ::  ByteString ->  ByteString tt ByteString ByteStringO(1) Extract the elements after the head of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString.  splitWith splitWith :: (Word8 -> Bool) ->  ByteString ->  [ByteString]^u.uWord8Bool ByteString[] ByteStringmO(n) Splits a ByteString into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
splitWith (=='a') "aabbaca" == ["","","bb","c",""]
splitWith (=='a') []        == []
 splitWith splitWith :: (Char -> Bool) ->  ByteString ->  [ByteString]mw>wCharBool ByteString[] ByteStringKO(n) Splits a ByteString into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
splitWith (=='a') "aabbaca" == ["","","bb","c",""]
splitAtsplitAt :: Int64 ->  ByteString -> (ByteString, ByteString)_y*yInt64 ByteString(,) ByteString ByteStringlO(n\c)/ splitAt n xs is equivalent to (take n xs, drop n xs). splitAtsplitAt :: Int ->  ByteString -> (ByteString, ByteString)nz;zInt ByteString(,) ByteString ByteStringiO(1) splitAt n xs is equivalent to (take n xs, drop n xs). splitsplit :: Word8 ->  ByteString ->  [ByteString]a{9{Word8 ByteString[] ByteStringO(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
split 'a'  "aXaXaXa"    == ["","X","X","X",""]
split 'x'  "x"          == ["",""]
and
intercalate [c] . split c == id
split == splitWith . (==)
As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original. splitsplit :: Char ->  ByteString ->  [ByteString]}}Char ByteString[] ByteStringO(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
split 'a'  "aXaXaXa"    == ["","X","X","X",""]
split 'x'  "x"          == ["",""]
and
intercalate [c] . split c == id
split == splitWith . (==)
As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original. spanEndspanEnd :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString)v:CharBool ByteString(,) ByteString ByteStringspanEnd behaves like span but from the end of the ByteString. We have
spanEnd (not.isSpace) "x y z" == ("x y ","z")
and
spanEnd (not . isSpace) ps
   == 
let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x) 
spanspan :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)<Word8Bool ByteString(,) ByteString ByteStringspan p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs) spanspan :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString)|@CharBool ByteString(,) ByteString ByteStringspan p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs) sortsort ::  ByteString ->  ByteStringsX ByteString ByteString@O(n) Sort a ByteString efficiently, using counting sort. snocsnoc ::  ByteString -> Word8 ->  ByteString3 ByteStringWord8 ByteString?O(n\c)/ Append a byte to the end of a ByteString snocsnoc ::  ByteString -> Char ->  ByteStringυ ByteStringChar ByteStringvO(n) Append a Char to the end of a ByteString. Similar to cons, this function performs a memcpy.  singleton singleton :: Word8 ->  ByteStringΆWord8 ByteString<O(1) Convert a Word8 into a ByteString  singleton singleton :: Char ->  ByteStringp[Char ByteString;O(1) Convert a Char into a ByteString scanr1scanr1 :: (Char -> Char -> Char) ->  ByteString ->  ByteStringMCharCharChar ByteString ByteStringPscanr1 is a variant of scanr that has no starting value argument. scanr scanr :: (Char -> Char -> Char) -> Char ->  ByteString ->  ByteStringSCharCharCharChar ByteString ByteString*scanr is the right-to-left dual of scanl. scanl1scanl1 :: (Char -> Char -> Char) ->  ByteString ->  ByteStringCharCharChar ByteString ByteStringscanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl scanl :: (Word8 -> Word8 -> Word8) -> Word8 ->  ByteString ->  ByteStringj1Word8Word8Word8Word8 ByteString ByteStringscanl is similar to foldl, but returns a list of successive reduced values from the left. This function will fuse.
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
Note that
last (scanl f z xs) == foldl f z xs.
scanl scanl :: (Char -> Char -> Char) -> Char ->  ByteString ->  ByteString.CharCharCharChar ByteString ByteStringscanl is similar to foldl, but returns a list of successive reduced values from the left:
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
Note that
last (scanl f z xs) == foldl f z xs.
reversereverse ::  ByteString ->  ByteStringv ByteString ByteString]O(n) reverse xs returns the elements of xs in reverse order. reversereverse ::  ByteString ->  ByteString\A ByteString ByteStringiO(n) reverse xs efficiently returns the elements of xs in reverse order.  replicate replicate :: Int64 -> Word8 ->  ByteStringE(Int64Word8 ByteString{O(n) replicate n x is a ByteString of length n with x the value of every element.  replicate replicate :: Int -> Char ->  ByteString: IntChar ByteStringO(n) replicate n x is a ByteString of length n with x the value of every element. The following holds:
replicate w c = unfoldr w (\u -> Just (u,u)) c
This implemenation uses memset(3) repeatrepeat :: Word8 ->  ByteStringWord8 ByteString`repeat x is an infinite ByteString, with x the value of every element.  readInteger readInteger ::  ByteString -> Maybe (Integer, ByteString)d ByteStringMaybe(,)Integer ByteStringreadInteger reads an Integer from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. readIntreadInt ::  ByteString -> Maybe (Int, ByteString)ʔ ByteStringMaybe(,)Int ByteStringreadInt reads an Int from the beginning of the ByteString. If there is no integer at the beginning of the string, it returns Nothing, otherwise it just returns the int read, and the rest of the string. readFilereadFile :: FilePath ->  IO ByteString9FilePathIO ByteStringsRead an entire file lazily into a ByteString. The Handle will be held open until EOF is encountered. readFilereadFile :: FilePath ->  IO ByteString!FilePathIO ByteStringRead an entire file strictly into a ByteString. This is far more efficient than reading the characters into a String and then using pack. It also may be more efficient than opening the file and reading it using hGet. putStrLnputStrLn ::  ByteString -> IO ()x_ ByteStringIO()7Write a ByteString to stdout, appending a newline byte putStrLnputStrLn ::  ByteString -> IO () ByteStringIO()7Write a ByteString to stdout, appending a newline byte putStrputStr ::  ByteString -> IO () ByteStringIO()Write a ByteString to stdout putStrputStr ::  ByteString -> IO ()6 ByteStringIO()Write a ByteString to stdout PS PS :: ForeignPtr Word8 -> Int -> Int ->  ByteString ForeignPtrWord8IntInt ByteString partition partition :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)nWord8Bool ByteString(,) ByteString ByteStringO(n) The partition function takes a predicate a ByteString and returns the pair of ByteStrings with elements which do and do not satisfy the predicate, respectively; i.e.,
partition p bs == (filter p xs, filter (not . p) xs)
packCStringLenpackCStringLen ::  CStringLen ->  IO ByteString-  CStringLenIO ByteStringO(n). Construct a new ByteString from a CStringLen. The resulting ByteString is an immutable copy of the original CStringLen. The ByteString is a normal Haskell value and will be managed on the Haskell heap.  packCString packCString :: CString ->  IO ByteStringCStringIO ByteStringO(n). Construct a new ByteString from a CString. The resulting ByteString is an immutable copy of the original CString, and is managed on the Haskell heap. The original CString must be null terminated. packpack :: [Word8] ->  ByteString[]Word8 ByteString:O(n) Convert a '[Word8]' into a ByteString. packpack :: String ->  ByteStringString ByteStringO(n) Convert a String into a ByteString For applications with large numbers of string literals, pack can be a bottleneck. nullForeignPtrnullForeignPtr :: ForeignPtr Word8 ForeignPtrWord86The 0 pointer. Used to indicate the empty Bytestring. nullnull ::  ByteString -> Bool1 ByteStringBool0O(1) Test whether a ByteString is empty. nullnull ::  ByteString -> Bool ByteStringBool0O(1) Test whether a ByteString is empty. notElemnotElem :: Word8 ->  ByteString -> BoolgKWord8 ByteStringBool9O(n) notElem is the inverse of elem notElemnotElem :: Char ->  ByteString -> BoolChar ByteStringBool9O(n) notElem is the inverse of elem minimumminimum ::  ByteString -> Word8 ByteStringWord8NO(n) minimum returns the minimum value from a ByteString minimumminimum ::  ByteString -> ChareP ByteStringCharBminimum returns the minimum value from a ByteString memset memset ::  Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8)PPtrWord8Word8CSizeIOPtrWord8memcpy_ptr_baoff memcpy_ptr_baoff :: Ptr a ->  RawBuffer -> CInt -> CSize ->  IO (Ptr ())Ptra RawBufferCIntCSizeIOPtr()memcpy memcpy ::  Ptr Word8 ->  Ptr Word8 -> CSize -> IO ()PtrWord8PtrWord8CSizeIO()memcmp memcmp ::  Ptr Word8 ->  Ptr Word8 -> CSize -> IO CIntc1PtrWord8PtrWord8CSizeIOCIntmemchr memchr ::  Ptr Word8 -> Word8 -> CSize -> IO (Ptr Word8) ٨PtrWord8Word8CSizeIOPtrWord8maximummaximum ::  ByteString -> Word8pZ ByteStringWord8NO(n) maximum returns the maximum value from a ByteString maximummaximum ::  ByteString -> Char   ByteStringCharBmaximum returns the maximum value from a ByteString  mapAccumR  mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc ->  ByteString -> (acc, ByteString)FaccWord8(,)accWord8acc ByteString(,)acc ByteStringThe mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.  mapAccumR  mapAccumR :: (acc -> Char -> (acc, Char)) -> acc ->  ByteString -> (acc, ByteString)>accChar(,)accCharacc ByteString(,)acc ByteStringThe mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.  mapAccumL  mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc ->  ByteString -> (acc, ByteString):accWord8(,)accWord8acc ByteString(,)acc ByteStringThe mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new ByteString.  mapAccumL  mapAccumL :: (acc -> Char -> (acc, Char)) -> acc ->  ByteString -> (acc, ByteString)2accChar(,)accCharacc ByteString(,)acc ByteStringThe mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list. mapmap :: (Word8 -> Word8) ->  ByteString ->  ByteStringֲWord8Word8 ByteString ByteStringwO(n) map f xs is the ByteString obtained by applying f to each element of xs. mapmap :: (Char -> Char) ->  ByteString ->  ByteString۳CharChar ByteString ByteStringvO(n) map f xs is the ByteString obtained by applying f to each element of xs mallocByteStringmallocByteString :: Int -> IO (ForeignPtr a)մIntIO ForeignPtrahWrapper of mallocForeignPtrBytes with faster implementation for GHC 6.5 builds newer than 060606 lineslines ::  ByteString ->  [ByteString] ByteString[] ByteStringlines breaks a ByteString up into a list of ByteStrings at newline Chars. The resulting strings do not contain newlines. lengthlength ::  ByteString -> Int64{ ByteStringInt64SO(n\c)/ length returns the length of a ByteString as an Int64 lengthlength ::  ByteString -> IntB. ByteStringIntOO(1) length returns the length of a ByteString as an Int. lastlast ::  ByteString -> Word8ٷ ByteStringWord8]O(n\c)/ Extract the last element of a ByteString, which must be finite and non-empty. lastlast ::  ByteString -> Char ByteStringCharRO(1) Extract the last element of a packed string, which must be non-empty. iterateiterate :: (Word8 -> Word8) -> Word8 ->  ByteStringdWord8Word8Word8 ByteStringiterate f x returns an infinite ByteString of repeated applications of f to x:
iterate f x == [x, f x, f (f x), ...]
 isSuffixOf isSuffixOf ::  ByteString ->  ByteString -> Bool ByteString ByteStringBoolO(n) The isSuffixOf function takes two ByteStrings and returns True iff the first is a suffix of the second. The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
 isSuffixOf isSuffixOf ::  ByteString ->  ByteString -> Bool ByteString ByteStringBoolHO(n) The isSuffixOf function takes two ByteStrings and returns True iff the first is a suffix of the second. The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
However, the real implemenation uses memcmp to compare the end of the string only, with no reverse required..  isSpaceWord8 isSpaceWord8 :: Word8 -> BoolƽWord8BoolaSelects words corresponding to white-space characters in the Latin-1 range ordered by frequency.  isSpaceChar8 isSpaceChar8 :: Char -> BoolxCharBool4Selects white-space characters in the Latin-1 range  isPrefixOf isPrefixOf ::  ByteString ->  ByteString -> BoolE$ ByteString ByteStringBoolO(n) The isPrefixOf function takes two ByteStrings and returns True iff the first is a prefix of the second.  isPrefixOf isPrefixOf ::  ByteString ->  ByteString -> BoolQ0 ByteString ByteStringBoolO(n) The isPrefixOf function takes two ByteStrings and returns True iff the first is a prefix of the second.  isInfixOf isInfixOf ::  ByteString ->  ByteString -> Bool[: ByteString ByteStringBoolCheck whether one string is a substring of another. isInfixOf p s is equivalent to not (null (findSubstrings p s)).  intersperse intersperse :: Word8 ->  ByteString ->  ByteStringoMWord8 ByteString ByteStringThe intersperse function takes a Word8 and a ByteString and `intersperses' that byte between the elements of the ByteString. It is analogous to the intersperse function on Lists.  intersperse intersperse :: Char ->  ByteString ->  ByteStringChar ByteString ByteStringO(n) The intersperse function takes a Char and a ByteString and `intersperses' that Char between the elements of the ByteString. It is analogous to the intersperse function on Lists.  intercalate intercalate ::  ByteString ->  [ByteString] ->  ByteString= ByteString[] ByteString ByteStringO(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list.  intercalate intercalate ::  ByteString ->  [ByteString] ->  ByteStringz ByteString[] ByteString ByteStringO(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list. interactinteract :: (ByteString -> ByteString) -> IO () ByteString ByteStringIO()The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. interactinteract :: (ByteString -> ByteString) -> IO ()[ ByteString ByteStringIO()The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. inlinePerformIOinlinePerformIO :: IO a -> aIOaainitsinits ::  ByteString ->  [ByteString]Z9 ByteString[] ByteStringXO(n) Return all initial segments of the given ByteString, shortest first. initsinits ::  ByteString ->  [ByteString]$ ByteString[] ByteStringXO(n) Return all initial segments of the given ByteString, shortest first. initinit ::  ByteString ->  ByteString ByteString ByteStringSO(n\c)/ Return all the elements of a ByteString except the last one. initinit ::  ByteString ->  ByteString ByteString ByteStringO(1) Return all the elements of a ByteString except the last one. An exception will be thrown in the case of an empty ByteString. indexindex ::  ByteString -> Int64 -> Word8 ByteStringInt64Word8KO(c) ByteString index (subscript) operator, starting from 0. indexindex ::  ByteString -> Int -> ChardJ ByteStringIntCharKO(1) ByteString index (subscript) operator, starting from 0.  hPutStrLn hPutStrLn :: Handle ->  ByteString -> IO ()4Handle ByteStringIO()9Write a ByteString to a handle, appending a newline byte hPutStrhPutStr :: Handle ->  ByteString -> IO ()Handle ByteStringIO()/A synonym for hPut, for compatibility hPutStrhPutStr :: Handle ->  ByteString -> IO ()}Handle ByteStringIO()/A synonym for hPut, for compatibility hPuthPut :: Handle ->  ByteString -> IO ()H'Handle ByteStringIO()<Outputs a ByteString to the specified Handle. hPuthPut :: Handle ->  ByteString -> IO ()Handle ByteStringIO()<Outputs a ByteString to the specified Handle. hGetNonBlockinghGetNonBlocking :: Handle -> Int ->  IO ByteStringHandleIntIO ByteStringhGetNonBlocking is similar to hGet, except that it will never block waiting for data to become available, instead it returns only whatever data is available. hGetNonBlockinghGetNonBlocking :: Handle -> Int ->  IO ByteStringHandleIntIO ByteStringhGetNonBlocking is identical to hGet, except that it will never block waiting for data to become available, instead it returns only whatever data is available. hGetLinehGetLine :: Handle ->  IO ByteStringHandleIO ByteStringRead a line from a handle  hGetContents hGetContents :: Handle ->  IO ByteStringHandleIO ByteStringRead entire handle contents lazily into a ByteString. Chunks are read on demand, using the default chunk size. Once EOF is encountered, the Handle is closed.  hGetContents hGetContents :: Handle ->  IO ByteStringHandleIO ByteStringRead entire handle contents strictly into a ByteString. This function reads chunks at a time, doubling the chunksize on each read. The final buffer is then realloced to the appropriate size. For files > half of available memory, this may lead to memory exhaustion. Consider using readFile in this case. As with hGet, the string representation in the file is assumed to be ISO-8859-1. The Handle is closed once the contents have been read, or if an exception is thrown. hGethGet :: Handle -> Int ->  IO ByteStringD"HandleIntIO ByteString[Read n bytes into a ByteString, directly from the specified Handle. hGethGet :: Handle -> Int ->  IO ByteStringHandleIntIO ByteStringRead a ByteString directly from the specified Handle. This is far more efficient than reading the characters into a String and then using pack. First argument is the Handle to read from, and the second is the number of bytes to read. headhead ::  ByteString -> Word8j ByteStringWord8PO(1) Extract the first element of a ByteString, which must be non-empty. headhead ::  ByteString -> Char, ByteStringCharPO(1) Extract the first element of a ByteString, which must be non-empty. groupBygroupBy :: (Word8 -> Word8 -> Bool) ->  ByteString ->  [ByteString],Word8Word8Bool ByteString[] ByteStringKThe groupBy function is the non-overloaded version of group. groupBygroupBy :: (Char -> Char -> Bool) ->  ByteString ->  [ByteString]#CharCharBool ByteString[] ByteStringKThe groupBy function is the non-overloaded version of group. groupgroup ::  ByteString ->  [ByteString] ByteString[] ByteStringThe group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test. groupgroup ::  ByteString ->  [ByteString] ByteString[] ByteStringThe group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test. It is about 40% faster than groupBy (==) getLinegetLine ::  IO ByteStringIO ByteStringRead a line from stdin.  getContents getContents ::  IO ByteStringp]IO ByteStringGgetContents. Equivalent to hGetContents stdin. Will read lazily  getContents getContents ::  IO ByteStringIO ByteStringgetContents. Read stdin strictly. Equivalent to hGetContents stdin The Handle is closed after the contents have been read. fromForeignPtr fromForeignPtr :: ForeignPtr Word8 -> Int -> Int ->  ByteStringG ForeignPtrWord8IntInt ByteString1O(1) Build a ByteString from a ForeignPtr  fromChunks fromChunks ::  [ByteString] ->  ByteString[] ByteString ByteStringUO(c) Convert a list of strict ByteString into a lazy ByteString foldr1'foldr1' :: (Char -> Char -> Char) ->  ByteString -> CharCharCharChar ByteStringCharA strict variant of foldr1 foldr1foldr1 :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8mWord8Word8Word8 ByteStringWord8foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty ByteStrings foldr1foldr1 :: (Char -> Char -> Char) ->  ByteString -> CharCharCharChar ByteStringCharfoldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty ByteStrings foldr' foldr' :: (Char -> a -> a) -> a ->  ByteString -> aCharaaa ByteStringa''foldr\'' is a strict variant of foldr foldr foldr :: (Word8 -> a -> a) -> a ->  ByteString -> amWord8aaa ByteStringafoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left. foldr foldr :: (Char -> a -> a) -> a ->  ByteString -> aCharaaa ByteStringafoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a packed string, reduces the packed string using the binary operator, from right to left. foldl1'foldl1' :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8S&Word8Word8Word8 ByteStringWord8A'foldl1\'' is like foldl1, but strict in the accumulator. foldl1'foldl1' :: (Char -> Char -> Char) ->  ByteString -> Char,CharCharChar ByteStringChar"A strict version of foldl1 foldl1foldl1 :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8Word8Word8Word8 ByteStringWord8foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty ByteStrings. This function is subject to array fusion. foldl1foldl1 :: (Char -> Char -> Char) ->  ByteString -> Char/CharCharChar ByteStringCharfoldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty ByteStrings. foldl' foldl' :: (a -> Word8 -> a) -> a ->  ByteString -> aH$aWord8aa ByteStringa?'foldl\'' is like foldl, but strict in the accumulator. foldl' foldl' :: (a -> Char -> a) -> a ->  ByteString -> aaCharaa ByteStringa8'foldl\'' is like foldl, but strict in the accumulator. foldl foldl :: (a -> Word8 -> a) -> a ->  ByteString -> aaWord8aa ByteStringafoldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. foldl foldl :: (a -> Char -> a) -> a ->  ByteString -> a=aCharaa ByteStringafoldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. findSubstringsfindSubstrings ::  ByteString ->  ByteString -> [Int]s ByteString ByteString[]IntVFind the indexes of all (possibly overlapping) occurances of a substring in a string.  findSubstring findSubstring ::  ByteString ->  ByteString ->  Maybe Intc ByteString ByteStringMaybeIntGet the first index of a substring in another string, or Nothing if the string is not found. findSubstring p s is equivalent to listToMaybe (findSubstrings p s).  findIndices findIndices :: (Word8 -> Bool) ->  ByteString -> [Int64]Word8Bool ByteString[]Int64The findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.  findIndices findIndices :: (Char -> Bool) ->  ByteString -> [Int]CharBool ByteString[]IntThe findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.  findIndex findIndex :: (Word8 -> Bool) ->  ByteString ->  Maybe Int64@Word8Bool ByteStringMaybeInt64The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.  findIndex findIndex :: (Char -> Bool) ->  ByteString ->  Maybe IntzOCharBool ByteStringMaybeIntThe findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate. findfind :: (Word8 -> Bool) ->  ByteString ->  Maybe Word8Word8Bool ByteStringMaybeWord8 O(n) The find function takes a predicate and a ByteString, and returns the first element in matching the predicate, or Nothing if there is no such element.
find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing
findfind :: (Char -> Bool) ->  ByteString ->  Maybe CharO#CharBool ByteStringMaybeCharO(n) The find function takes a predicate and a ByteString, and returns the first element in matching the predicate, or Nothing if there is no such element. filterfilter :: (Word8 -> Bool) ->  ByteString ->  ByteStringlWord8Bool ByteString ByteStringO(n) filter, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. filterfilter :: (Char -> Bool) ->  ByteString ->  ByteStringCharBool ByteString ByteStringO(n) filter, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. emptyempty ::  ByteString ByteString(O(1) The empty ByteString emptyempty ::  ByteString ByteString(O(1) The empty ByteString  elemIndices elemIndices :: Word8 ->  ByteString -> [Int64]Word8 ByteString[]Int64O(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).  elemIndices elemIndices :: Char ->  ByteString -> [Int]Char ByteString[]IntO(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.  elemIndexEnd elemIndexEnd :: Char ->  ByteString ->  Maybe Int+Char ByteStringMaybeInt3O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs == 
(-) (length xs - 1) `fmap` elemIndex c (reverse xs)
 elemIndex elemIndex :: Word8 ->  ByteString ->  Maybe Int64Word8 ByteStringMaybeInt64O(n) The elemIndex function returns the index of the first element in the given ByteString which is equal to the query element, or Nothing if there is no such element. This implementation uses memchr(3).  elemIndex elemIndex :: Char ->  ByteString ->  Maybe Int^ ; Char ByteStringMaybeIntO(n) The elemIndex function returns the index of the first element in the given ByteString which is equal (by memchr) to the query element, or Nothing if there is no such element. elemelem :: Word8 ->  ByteString -> Bool  Word8 ByteStringBoolGO(n) elem is the ByteString membership predicate. elemelem :: Char ->  ByteString -> Bool[ @ Char ByteStringBooltO(n) elem is the ByteString membership predicate. This implementation uses memchr(3).  dropWhile dropWhile :: (Word8 -> Bool) ->  ByteString ->  ByteStringk A Word8Bool ByteString ByteStringbdropWhile p xs returns the suffix remaining after takeWhile p xs.  dropWhile dropWhile :: (Char -> Bool) ->  ByteString ->  ByteStringg > CharBool ByteString ByteStringbdropWhile p xs returns the suffix remaining after takeWhile p xs. dropdrop :: Int64 ->  ByteString ->  ByteStringI'Int64 ByteString ByteStringO(n\c)/ drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs. dropdrop :: Int ->  ByteString ->  ByteStringiIInt ByteString ByteStringO(1) drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs. cyclecycle ::  ByteString ->  ByteStringtY ByteString ByteStringcycle ties a finite ByteString into a circular one, or equivalently, the infinite repetition of the original ByteString. createAndTrim'createAndTrim' :: Int -> (Ptr Word8 -> IO (Int, Int, a)) -> IO (ByteString, a)IntPtrWord8IO(,,)IntIntaIO(,) ByteStringa createAndTrim createAndTrim :: Int -> (Ptr Word8 -> IO Int) ->  IO ByteStringLIntPtrWord8IOIntIO ByteStringGiven the maximum size needed and a function to make the contents of a ByteString, createAndTrim makes the ByteString. The generating function is required to return the actual final size (<= the maximum size), and the resulting byte array is realloced to this size. createAndTrim is the main mechanism for creating custom, efficient ByteString functions, using Haskell or C functions to fill the space. createcreate :: Int -> (Ptr Word8 -> IO ()) ->  IO ByteStringIntPtrWord8IO()IO ByteStringVCreate ByteString of size l and use action f to fill it's contents. countcount :: Word8 ->  ByteString -> Int64qWord8 ByteStringInt64count returns the number of times its argument appears in the ByteString
count = length . elemIndices
But more efficiently than using length on the intermediate list. countcount :: Char ->  ByteString -> IntChar ByteStringIntcount returns the number of times its argument appears in the ByteString
count = length . elemIndices
Also
count '\n' == length . lines
But more efficiently than using length on the intermediate list. copycopy ::  ByteString ->  ByteString ByteString ByteString*O(n) Make a copy of the ByteString with its own storage. This is mainly useful to allow the rest of the data pointed to by the ByteString to be garbage collected, for example if a large string has been read in, and only a small part of it is needed in the rest of the program. copycopy ::  ByteString ->  ByteString| ByteString ByteString*O(n) Make a copy of the ByteString with its own storage. This is mainly useful to allow the rest of the data pointed to by the ByteString to be garbage collected, for example if a large string has been read in, and only a small part of it is needed in the rest of the program. cons'cons' :: Word8 ->  ByteString ->  ByteStringC!Word8 ByteString ByteStringO(1) Unlike cons, 'cons\'' is strict in the ByteString that we are consing onto. More precisely, it forces the head and the first chunk. It does this because, for space efficiency, it may coalesce the new byte onto the first 'chunk' rather than starting a new 'chunk'. So that means you can't use a lazy recursive contruction like this:
let xs = cons\' c xs in xs
You can however use cons, as well as repeat and cycle, to build infinite lazy ByteStrings. conscons :: Word8 ->  ByteString ->  ByteStringWord8 ByteString ByteString9O(1) cons is analogous to '(:)' for lists. conscons :: Char ->  ByteString ->  ByteStringtSChar ByteString ByteStringmO(n) cons is analogous to (:) for lists, but of different complexity, as it requires a memcpy.  concatMap concatMap :: (Word8 -> ByteString) ->  ByteString ->  ByteStringYWord8 ByteString ByteString ByteStringDMap a function over a ByteString and concatenate the results  concatMap concatMap :: (Char -> ByteString) ->  ByteString ->  ByteStrings D Char ByteString ByteString ByteStringDMap a function over a ByteString and concatenate the results concatconcat ::  [ByteString] ->  ByteString+! ![] ByteString ByteString/O(n) Concatenate a list of ByteStrings. concatconcat ::  [ByteString] ->  ByteString!![] ByteString ByteString/O(n) Concatenate a list of ByteStrings. c_strlenc_strlen :: CString -> IO CSizef"M"CStringIOCSize c_reverse  c_reverse ::  Ptr Word8 ->  Ptr Word8 -> CULong -> IO ()#"PtrWord8PtrWord8CULongIO() c_minimum c_minimum ::  Ptr Word8 -> CULong -> IO Word8#u#PtrWord8CULongIOWord8 c_maximum c_maximum ::  Ptr Word8 -> CULong -> IO Word8'$$PtrWord8CULongIOWord8 c_intersperse  c_intersperse ::  Ptr Word8 ->  Ptr Word8 -> CULong -> Word8 -> IO ()$$PtrWord8PtrWord8CULongWord8IO()c_free_finalizerc_free_finalizer :: FunPtr (Ptr Word8 -> IO ())u%P%FunPtrPtrWord8IO()c_count c_count ::  Ptr Word8 -> CULong -> Word8 ->  IO CULong&%PtrWord8CULongWord8IOCULongc2wc2w :: Char -> Word8g&W&CharWord8Unsafe conversion between Char and Word8. This is a no-op and silently truncates to 8 bits Chars > '\255'. It is provided as convenience for ByteString construction.  ByteStringdata  ByteStringV'A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable  ByteStringdata  ByteStringN(A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable  ByteStringdata  ByteStringF)A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable breakSubstringbreakSubstring ::  ByteString ->  ByteString -> (ByteString, ByteString)** ByteString ByteString(,) ByteString ByteString$Break a string on a substring, returning a pair of the part of the string prior to the match, and the rest of the string. The following relationships hold:
break (== c) l == breakSubstring (singleton c) l
and:
findSubstring s l ==
   if null s then Just 0
             else case breakSubstring s l of
                      (x,y) | null y    -> Nothing
                            | otherwise -> Just (length x)
For example, to tokenise a string, dropping delimiters:
tokenise x y = h : if null t then [] else tokenise x (drop (length x) t)
    where (h,t) = breakSubstring x y
To skip to the first occurence of a string:
snd (breakSubstring x y) 
To take the parts of a string before a delimiter:
fst (breakSubstring x y) 
breakEndbreakEnd :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString).f.CharBool ByteString(,) ByteString ByteStringsbreakEnd behaves like break but from the end of the ByteString breakEnd p == spanEnd (not.p) breakbreak :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)//Word8Bool ByteString(,) ByteString ByteStringPbreak p is equivalent to span (not . p). breakbreak :: (Char -> Bool) ->  ByteString -> (ByteString, ByteString)00CharBool ByteString(,) ByteString ByteStringPbreak p is equivalent to span (not . p).  appendFile appendFile :: FilePath ->  ByteString -> IO ()11FilePath ByteStringIO()&Append a ByteString to a file.  appendFile appendFile :: FilePath ->  ByteString -> IO ()Y262FilePath ByteStringIO()&Append a ByteString to a file. appendappend ::  ByteString ->  ByteString ->  ByteString 32 ByteString ByteString ByteString&O(n\c)/ Append two ByteStrings appendappend ::  ByteString ->  ByteString ->  ByteString33 ByteString ByteString ByteString#O(n) Append two ByteStrings anyany :: (Word8 -> Bool) ->  ByteString -> Boolh4D4Word8Bool ByteStringBoolO(n) Applied to a predicate and a ByteString, any determines if any element of the ByteString satisfies the predicate. anyany :: (Char -> Bool) ->  ByteString -> Boolv5S5CharBool ByteStringBoolApplied to a predicate and a ByteString, any determines if any element of the ByteString satisfies the predicate. allall :: (Word8 -> Bool) ->  ByteString -> Boolz6V6Word8Bool ByteStringBoolO(n) Applied to a predicate and a ByteString, all determines if all elements of the ByteString satisfy the predicate. allall :: (Char -> Bool) ->  ByteString -> Bool7k7CharBool ByteStringBoolApplied to a predicate and a ByteString, all determines if all elements of the ByteString satisfy the predicate. zipWith zipWith :: (Word8 -> Word8 -> a) ->  ByteString ->  ByteString -> [a]88Word8Word8a ByteString ByteString[]azipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two ByteStrings to produce the list of corresponding sums. zipzip ::  ByteString ->  ByteString -> [(Word8, Word8)]\:&: ByteString ByteString[](,)Word8Word8O(n) zip takes two ByteStrings and returns a list of corresponding pairs of bytes. If one input ByteString is short, excess elements of the longer ByteString are discarded. This is equivalent to a pair of unpack operations.  writeFile writeFile :: FilePath ->  ByteString -> IO ();;FilePath ByteStringIO()%Write a ByteString to a file. useAsCStringLenuseAsCStringLen ::  ByteString -> (CStringLen -> IO a) -> IO a<|< ByteString CStringLenIOaIOaO(n) construction Use a ByteString with a function requiring a CStringLen. As for useAsCString this function makes a copy of the original ByteString.  useAsCString useAsCString ::  ByteString -> (CString -> IO a) -> IO a >= ByteStringCStringIOaIOaO(n) construction Use a ByteString with a function requiring a null-terminated CString. The CString will be freed automatically. This is a memcpy(3). unzipunzip :: [(Word8, Word8)] -> (ByteString, ByteString)d?'?[](,)Word8Word8(,) ByteString ByteStringO(n) unzip transforms a list of pairs of bytes into a pair of ByteStrings. Note that this performs two pack operations. unpackunpack ::  ByteString -> [Word8][@?@ ByteString[]Word89O(n) Converts a ByteString to a '[Word8]'. unfoldrN unfoldrN :: Int -> (a -> Maybe (Word8, a)) -> a -> (ByteString, Maybe a)fAAIntaMaybe(,)Word8aa(,) ByteStringMaybeaO(n) Like unfoldr, unfoldrN builds a ByteString from a seed value. However, the length of the result is limited by the first argument to unfoldrN. This function is more efficient than unfoldr when the maximum length of the result is known. The following equation relates unfoldrN and unfoldr:
unfoldrN n f s == take n (unfoldr f s)
unfoldrunfoldr :: (a -> Maybe (Word8, a)) -> a ->  ByteStringC_CaMaybe(,)Word8aa ByteString%O(n), where n is the length of the result. The unfoldr function is analogous to the List 'unfoldr'. unfoldr builds a ByteString from a seed value. The function takes the element and returns Nothing if it is done producing the ByteString or returns Just (a,b), in which case, a is the next byte in the string, and b is the seed value for further production. Examples:
   unfoldr (\x -> if x <= 5 then Just (x, x + 1) else Nothing) 0
== pack [0, 1, 2, 3, 4, 5]
unconsuncons ::  ByteString -> Maybe (Word8, ByteString)GFF ByteStringMaybe(,)Word8 ByteStringYO(1) Extract the head and tail of a ByteString, returning Nothing if it is empty.  transpose transpose ::  [ByteString] ->  [ByteString]"GF[] ByteString[] ByteStringaThe transpose function transposes the rows and columns of its ByteString argument.  takeWhile takeWhile :: (Word8 -> Bool) ->  ByteString ->  ByteStringHGWord8Bool ByteString ByteStringtakeWhile, applied to a predicate p and a ByteString xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p. taketake :: Int ->  ByteString ->  ByteStringMI-IInt ByteString ByteStringO(1) take n, applied to a ByteString xs, returns the prefix of xs of length n, or xs itself if n > length xs. tailstails ::  ByteString ->  [ByteString]{JZJ ByteString[] ByteStringUO(n) Return all final segments of the given ByteString, longest first. tailtail ::  ByteString ->  ByteString8KK ByteString ByteStringO(1) Extract the elements after the head of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString.  splitWith splitWith :: (Word8 -> Bool) ->  ByteString ->  [ByteString]vLFLWord8Bool ByteString[] ByteStringmO(n) Splits a ByteString into components delimited by separators, where the predicate returns True for a separator element. The resulting components do not contain the separators. Two adjacent separators result in an empty component in the output. eg.
splitWith (=='a') "aabbaca" == ["","","bb","c",""]
splitWith (=='a') []        == []
splitAtsplitAt :: Int ->  ByteString -> (ByteString, ByteString)NSNInt ByteString(,) ByteString ByteStringiO(1) splitAt n xs is equivalent to (take n xs, drop n xs). splitsplit :: Word8 ->  ByteString ->  [ByteString]yOQOWord8 ByteString[] ByteStringO(n) Break a ByteString into pieces separated by the byte argument, consuming the delimiter. I.e.
split '\n' "a\nb\nd\ne" == ["a","b","d","e"]
split 'a'  "aXaXaXa"    == ["","X","X","X",""]
split 'x'  "x"          == ["",""]
and
intercalate [c] . split c == id
split == splitWith . (==)
As for all splitting functions in this library, this function does not copy the substrings, it just constructs new ByteStrings that are slices of the original. spanEndspanEnd :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)RQWord8Bool ByteString(,) ByteString ByteStringspanEnd behaves like span but from the end of the ByteString. We have
spanEnd (not.isSpace) "x y z" == ("x y ","z")
and
spanEnd (not . isSpace) ps
   == 
let (x,y) = span (not.isSpace) (reverse ps) in (reverse y, reverse x) 
spanspan :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)SSWord8Bool ByteString(,) ByteString ByteStringspan p xs breaks the ByteString into two segments. It is equivalent to (takeWhile p xs, dropWhile p xs) sortsort ::  ByteString ->  ByteStringTT ByteString ByteString@O(n) Sort a ByteString efficiently, using counting sort. snocsnoc ::  ByteString -> Word8 ->  ByteStringUxU ByteStringWord8 ByteString<O(n) Append a byte to the end of a ByteString  singleton singleton :: Word8 ->  ByteString>V(VWord8 ByteString<O(1) Convert a Word8 into a ByteString scanr1scanr1 :: (Word8 -> Word8 -> Word8) ->  ByteString ->  ByteString"WVWord8Word8Word8 ByteString ByteStringPscanr1 is a variant of scanr that has no starting value argument. scanr scanr :: (Word8 -> Word8 -> Word8) -> Word8 ->  ByteString ->  ByteString0XWWord8Word8Word8Word8 ByteString ByteString*scanr is the right-to-left dual of scanl. scanl1scanl1 :: (Word8 -> Word8 -> Word8) ->  ByteString ->  ByteStringYXWord8Word8Word8 ByteString ByteStringscanl1 is a variant of scanl that has no starting value argument. This function will fuse.
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl scanl :: (Word8 -> Word8 -> Word8) -> Word8 ->  ByteString ->  ByteStringfZ-ZWord8Word8Word8Word8 ByteString ByteStringscanl is similar to foldl, but returns a list of successive reduced values from the left. This function will fuse.
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
Note that
last (scanl f z xs) == foldl f z xs.
reversereverse ::  ByteString ->  ByteString[[ ByteString ByteStringiO(n) reverse xs efficiently returns the elements of xs in reverse order.  replicate replicate :: Int -> Word8 ->  ByteString\\IntWord8 ByteStringO(n) replicate n x is a ByteString of length n with x the value of every element. The following holds:
replicate w c = unfoldr w (\u -> Just (u,u)) c
This implemenation uses memset(3) readFilereadFile :: FilePath ->  IO ByteString8^^FilePathIO ByteStringURead an entire file strictly into a ByteString. This is far more efficient than reading the characters into a String and then using pack. It also may be more efficient than opening the file and reading it using hGet. Files are read using 'binary mode' on Windows, for 'text mode' use the Char8 version of this function. putStrLnputStrLn ::  ByteString -> IO ()__ ByteStringIO()7Write a ByteString to stdout, appending a newline byte putStrputStr ::  ByteString -> IO ()`y` ByteStringIO()Write a ByteString to stdout  partition partition :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)la/aWord8Bool ByteString(,) ByteString ByteStringO(n) The partition function takes a predicate a ByteString and returns the pair of ByteStrings with elements which do and do not satisfy the predicate, respectively; i.e.,
partition p bs == (filter p xs, filter (not . p) xs)
packCStringLenpackCStringLen ::  CStringLen ->  IO ByteStringbb CStringLenIO ByteStringO(n). Construct a new ByteString from a CStringLen. The resulting ByteString is an immutable copy of the original CStringLen. The ByteString is a normal Haskell value and will be managed on the Haskell heap.  packCString packCString :: CString ->  IO ByteStringkdMdCStringIO ByteStringO(n). Construct a new ByteString from a CString. The resulting ByteString is an immutable copy of the original CString, and is managed on the Haskell heap. The original CString must be null terminated. packpack :: [Word8] ->  ByteStringee[]Word8 ByteStringO(n) Convert a '[Word8]' into a ByteString. For applications with large numbers of string literals, pack can be a bottleneck. In such cases, consider using packAddress (GHC only). nullnull ::  ByteString -> Boolff ByteStringBool0O(1) Test whether a ByteString is empty. notElemnotElem :: Word8 ->  ByteString -> Boolg|gWord8 ByteStringBool9O(n) notElem is the inverse of elem minimumminimum ::  ByteString -> Word85hh ByteStringWord8O(n) minimum returns the minimum value from a ByteString This function will fuse. An exception will be thrown in the case of an empty ByteString. maximummaximum ::  ByteString -> Word8@i*i ByteStringWord8O(n) maximum returns the maximum value from a ByteString This function will fuse. An exception will be thrown in the case of an empty ByteString.  mapAccumR  mapAccumR :: (acc -> Word8 -> (acc, Word8)) -> acc ->  ByteString -> (acc, ByteString)j~jaccWord8(,)accWord8acc ByteString(,)acc ByteStringThe mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a ByteString, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new ByteString.  mapAccumL  mapAccumL :: (acc -> Word8 -> (acc, Word8)) -> acc ->  ByteString -> (acc, ByteString)lzlaccWord8(,)accWord8acc ByteString(,)acc ByteStringThe mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a ByteString, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list. mapmap :: (Word8 -> Word8) ->  ByteString ->  ByteStringkn@nWord8Word8 ByteString ByteStringO(n) map f xs is the ByteString obtained by applying f to each element of xs. This function is subject to array fusion. lengthlength ::  ByteString -> IntjoVo ByteStringIntOO(1) length returns the length of a ByteString as an Int. lastlast ::  ByteString -> Word8pp ByteStringWord8O(1) Extract the last element of a ByteString, which must be finite and non-empty. An exception will be thrown in the case of an empty ByteString.  isSuffixOf isSuffixOf ::  ByteString ->  ByteString -> Bool;qq ByteString ByteStringBoolHO(n) The isSuffixOf function takes two ByteStrings and returns True iff the first is a suffix of the second. The following holds:
isSuffixOf x y == reverse x `isPrefixOf` reverse y
However, the real implemenation uses memcmp to compare the end of the string only, with no reverse required..  isPrefixOf isPrefixOf ::  ByteString ->  ByteString -> Bool sr ByteString ByteStringBoolO(n) The isPrefixOf function takes two ByteStrings and returns True iff the first is a prefix of the second.  isInfixOf isInfixOf ::  ByteString ->  ByteString -> Boolts ByteString ByteStringBoolCheck whether one string is a substring of another. isInfixOf p s is equivalent to not (null (findSubstrings p s)).  intersperse intersperse :: Word8 ->  ByteString ->  ByteString+u uWord8 ByteString ByteStringO(n) The intersperse function takes a Word8 and a ByteString and `intersperses' that byte between the elements of the ByteString. It is analogous to the intersperse function on Lists.  intercalate intercalate ::  ByteString ->  [ByteString] ->  ByteStringvyv ByteString[] ByteString ByteStringO(n) The intercalate function takes a ByteString and a list of ByteStrings and concatenates the list after interspersing the first argument between each element of the list. interactinteract :: (ByteString -> ByteString) -> IO ()ww ByteString ByteStringIO()The interact function takes a function of type ByteString -> ByteString as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device. initsinits ::  ByteString ->  [ByteString]lyKy ByteString[] ByteStringXO(n) Return all initial segments of the given ByteString, shortest first. initinit ::  ByteString ->  ByteString,zz ByteString ByteStringO(1) Return all the elements of a ByteString except the last one. An exception will be thrown in the case of an empty ByteString. indexindex ::  ByteString -> Int -> Word80{{ ByteStringIntWord8KO(1) ByteString index (subscript) operator, starting from 0.  hPutStrLn hPutStrLn :: Handle ->  ByteString -> IO ()|{Handle ByteStringIO()9Write a ByteString to a handle, appending a newline byte hPutStrhPutStr :: Handle ->  ByteString -> IO ()||Handle ByteStringIO()/A synonym for hPut, for compatibility hPuthPut :: Handle ->  ByteString -> IO ()d}C}Handle ByteStringIO()<Outputs a ByteString to the specified Handle. hGetNonBlockinghGetNonBlocking :: Handle -> Int ->  IO ByteString3~~HandleIntIO ByteStringhGetNonBlocking is identical to hGet, except that it will never block waiting for data to become available, instead it returns only whatever data is available. hGetLinehGetLine :: Handle ->  IO ByteStringK.HandleIO ByteStringRead a line from a handle  hGetContents hGetContents :: Handle ->  IO ByteStringHandleIO ByteStringRead entire handle contents strictly into a ByteString. This function reads chunks at a time, doubling the chunksize on each read. The final buffer is then realloced to the appropriate size. For files > half of available memory, this may lead to memory exhaustion. Consider using readFile in this case. As with hGet, the string representation in the file is assumed to be ISO-8859-1. The Handle is closed once the contents have been read, or if an exception is thrown. hGethGet :: Handle -> Int ->  IO ByteStringK)HandleIntIO ByteStringRead a ByteString directly from the specified Handle. This is far more efficient than reading the characters into a String and then using pack. First argument is the Handle to read from, and the second is the number of bytes to read. headhead ::  ByteString -> Word8 ByteStringWord8O(1) Extract the first element of a ByteString, which must be non-empty. An exception will be thrown in the case of an empty ByteString. groupBygroupBy :: (Word8 -> Word8 -> Bool) ->  ByteString ->  [ByteString]Word8Word8Bool ByteString[] ByteStringKThe groupBy function is the non-overloaded version of group. groupgroup ::  ByteString ->  [ByteString] ByteString[] ByteStringThe group function takes a ByteString and returns a list of ByteStrings such that the concatenation of the result is equal to the argument. Moreover, each sublist in the result contains only equal elements. For example,
group "Mississippi" = ["M","i","ss","i","ss","i","pp","i"]
It is a special case of groupBy, which allows the programmer to supply their own equality test. It is about 40% faster than groupBy (==) getLinegetLine ::  IO ByteStringÇIO ByteStringRead a line from stdin.  getContents getContents ::  IO ByteString6#IO ByteStringgetContents. Read stdin strictly. Equivalent to hGetContents stdin The Handle is closed after the contents have been read. foldr1'foldr1' :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8X+Word8Word8Word8 ByteStringWord8L'foldr1\'' is a variant of foldr1, but is strict in the accumulator. foldr1foldr1 :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8BWord8Word8Word8 ByteStringWord8foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty ByteStrings An exception will be thrown in the case of an empty ByteString. foldr' foldr' :: (Word8 -> a -> a) -> a ->  ByteString -> a}Word8aaa ByteStringa?'foldr\'' is like foldr, but strict in the accumulator. foldr foldr :: (Word8 -> a -> a) -> a ->  ByteString -> atPWord8aaa ByteStringafoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from right to left. foldl1'foldl1' :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8ٍWord8Word8Word8 ByteStringWord8'foldl1\'' is like foldl1, but strict in the accumulator. An exception will be thrown in the case of an empty ByteString. foldl1foldl1 :: (Word8 -> Word8 -> Word8) ->  ByteString -> Word8ˎWord8Word8Word8 ByteStringWord8foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty ByteStrings. This function is subject to array fusion. An exception will be thrown in the case of an empty ByteString. foldl' foldl' :: (a -> Word8 -> a) -> a ->  ByteString -> a{WaWord8aa ByteStringa'foldl\'' is like foldl, but strict in the accumulator. However, for ByteStrings, all left folds are strict in the accumulator. foldl foldl :: (a -> Word8 -> a) -> a ->  ByteString -> araWord8aa ByteStringafoldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a ByteString, reduces the ByteString using the binary operator, from left to right. This function is subject to array fusion. findSubstringsfindSubstrings ::  ByteString ->  ByteString -> [Int] ByteString ByteString[]IntVFind the indexes of all (possibly overlapping) occurances of a substring in a string.  findSubstring findSubstring ::  ByteString ->  ByteString ->  Maybe Int ByteString ByteStringMaybeIntGet the first index of a substring in another string, or Nothing if the string is not found. findSubstring p s is equivalent to listToMaybe (findSubstrings p s).  findIndices findIndices :: (Word8 -> Bool) ->  ByteString -> [Int]e<Word8Bool ByteString[]IntThe findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.  findIndex findIndex :: (Word8 -> Bool) ->  ByteString ->  Maybe IntgWord8Bool ByteStringMaybeIntThe findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate. findfind :: (Word8 -> Bool) ->  ByteString ->  Maybe Word8ɗWord8Bool ByteStringMaybeWord8 O(n) The find function takes a predicate and a ByteString, and returns the first element in matching the predicate, or Nothing if there is no such element.
find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing
filterfilter :: (Word8 -> Bool) ->  ByteString ->  ByteStringkAWord8Bool ByteString ByteStringO(n) filter, applied to a predicate and a ByteString, returns a ByteString containing those characters that satisfy the predicate. This function is subject to array fusion. emptyempty ::  ByteStringl_ ByteString(O(1) The empty ByteString  elemIndices elemIndices :: Word8 ->  ByteString -> [Int]Word8 ByteString[]IntO(n) The elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. This implementation uses memchr(3).  elemIndexEnd elemIndexEnd :: Word8 ->  ByteString ->  Maybe IntpLWord8 ByteStringMaybeInt3O(n) The elemIndexEnd function returns the last index of the element in the given ByteString which is equal to the query element, or Nothing if there is no such element. The following holds:
elemIndexEnd c xs == 
(-) (length xs - 1) `fmap` elemIndex c (reverse xs)
 elemIndex elemIndex :: Word8 ->  ByteString ->  Maybe Int. Word8 ByteStringMaybeIntO(n) The elemIndex function returns the index of the first element in the given ByteString which is equal to the query element, or Nothing if there is no such element. This implementation uses memchr(3). elemelem :: Word8 ->  ByteString -> BoolnWord8 ByteStringBoolGO(n) elem is the ByteString membership predicate.  dropWhile dropWhile :: (Word8 -> Bool) ->  ByteString ->  ByteStringmCWord8Bool ByteString ByteStringbdropWhile p xs returns the suffix remaining after takeWhile p xs. dropdrop :: Int ->  ByteString ->  ByteStringK+Int ByteString ByteStringO(1) drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs. countcount :: Word8 ->  ByteString -> Int`EWord8 ByteStringIntcount returns the number of times its argument appears in the ByteString
count = length . elemIndices
But more efficiently than using length on the intermediate list. copycopy ::  ByteString ->  ByteString~c ByteString ByteString*O(n) Make a copy of the ByteString with its own storage. This is mainly useful to allow the rest of the data pointed to by the ByteString to be garbage collected, for example if a large string has been read in, and only a small part of it is needed in the rest of the program. conscons :: Word8 ->  ByteString ->  ByteString(Word8 ByteString ByteStringmO(n) cons is analogous to (:) for lists, but of different complexity, as it requires a memcpy.  concatMap concatMap :: (Word8 -> ByteString) ->  ByteString ->  ByteString= Word8 ByteString ByteString ByteStringDMap a function over a ByteString and concatenate the results concatconcat ::  [ByteString] ->  ByteStringԦ[] ByteString ByteString/O(n) Concatenate a list of ByteStrings.  ByteStringdata  ByteString\A space-efficient representation of a Word8 vector, supporting many efficient operations. A ByteString contains 8-bit characters only. Instances of Eq, Ord, Read, Show, Data, Typeable breakSubstringbreakSubstring ::  ByteString ->  ByteString -> (ByteString, ByteString)ۨ ByteString ByteString(,) ByteString ByteString$Break a string on a substring, returning a pair of the part of the string prior to the match, and the rest of the string. The following relationships hold:
break (== c) l == breakSubstring (singleton c) l
and:
findSubstring s l ==
   if null s then Just 0
             else case breakSubstring s l of
                      (x,y) | null y    -> Nothing
                            | otherwise -> Just (length x)
For example, to tokenise a string, dropping delimiters:
tokenise x y = h : if null t then [] else tokenise x (drop (length x) t)
    where (h,t) = breakSubstring x y
To skip to the first occurence of a string:
snd (breakSubstring x y) 
To take the parts of a string before a delimiter:
fst (breakSubstring x y) 
breakEndbreakEnd :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)}Word8Bool ByteString(,) ByteString ByteStringsbreakEnd behaves like break but from the end of the ByteString breakEnd p == spanEnd (not.p)  breakByte breakByte :: Word8 ->  ByteString -> (ByteString, ByteString)حWord8 ByteString(,) ByteString ByteStringbreakByte breaks its ByteString argument at the first occurence of the specified byte. It is more efficient than break as it is implemented with memchr(3). I.e.
break (=='c') "abcd" == breakByte 'c' "abcd"
breakbreak :: (Word8 -> Bool) ->  ByteString -> (ByteString, ByteString)CWord8Bool ByteString(,) ByteString ByteStringbreak p is equivalent to span (not . p). Under GHC, a rewrite rule will transform break (==) into a call to the specialised breakByte:
break ((==) x) = breakByte x
break (==x) = breakByte x
 appendFile appendFile :: FilePath ->  ByteString -> IO ()ܰFilePath ByteStringIO()&Append a ByteString to a file. appendappend ::  ByteString ->  ByteString ->  ByteString ByteString ByteString ByteString#O(n) Append two ByteStrings anyany :: (Word8 -> Bool) ->  ByteString -> BoolZ6Word8Bool ByteStringBoolO(n) Applied to a predicate and a ByteString, any determines if any element of the ByteString satisfies the predicate. allall :: (Word8 -> Bool) ->  ByteString -> BooljFWord8Bool ByteStringBoolO(n) Applied to a predicate and a ByteString, all determines if all elements of the ByteString satisfy the predicate. Unsafemodule Data.ByteString.Unsafe:4A module containing unsafe ByteString operations. This exposes the ByteString representation and low level construction functions. Modules which extend the ByteString system will need to use this module while ideally most users will be able to make do with the public interface modules. Lazymodule Data.ByteString.LazyA time and space-efficient implementation of lazy byte vectors using lists of packed Word8 arrays, suitable for high performance use, both in terms of large data quantities, or high speed requirements. Byte vectors are encoded as lazy lists of strict Word8 arrays of bytes. They provide a means to manipulate large byte vectors without requiring the entire vector be resident in memory. Some operations, such as concat, append, reverse and cons, have better complexity than their Data.ByteString equivalents, due to optimisations resulting from the list spine structure. And for other operations lazy ByteStrings are usually within a few percent of strict ones, but with better heap usage. For data larger than the available memory, or if you have tight memory constraints, this module will be the only option. The default chunk size is 64k, which should be good in most circumstances. For people with large L2 caches, you may want to increase this to fit your cache. This module is intended to be imported qualified, to avoid name clashes with Prelude functions. eg.
import qualified Data.ByteString.Lazy as B
Original GHC implementation by Bryan O'Sullivan. Rewritten to use Data.Array.Unboxed.UArray by Simon Marlow. Rewritten to support slices and use Foreign.ForeignPtr.ForeignPtr by David Roundy. Polished and extended by Don Stewart. Lazy variant by Duncan Coutts and Don Stewart. Internalmodule Data.ByteString.Lazy.Internal8A module containing semi-public ByteString internals. This exposes the ByteString representation and low level construction functions. Modules which extend the ByteString system will need to use this module while ideally most users will be able to make do with the public interface modules. Internalmodule Data.ByteString.Internal 8A module containing semi-public ByteString internals. This exposes the ByteString representation and low level construction functions. Modules which extend the ByteString system will need to use this module while ideally most users will be able to make do with the public interface modules. Fusionmodule Data.ByteString.FusionStream fusion for ByteStrings. See the paper Stream Fusion: From Lists to Streams to Nothing at All, Coutts, Leshchinskiy and Stewart, 2007. Char8module Data.ByteString.Lazy.Char8WManipulate lazy ByteStrings using Char operations. All Chars will be truncated to 8 bits. It can be expected that these functions will run at identical speeds to their Data.Word.Word8 equivalents in Data.ByteString.Lazy. This module is intended to be imported qualified, to avoid name clashes with Prelude functions. eg.
import qualified Data.ByteString.Lazy.Char8 as C
Char8module Data.ByteString.Char8@Manipulate ByteStrings using Char operations. All Chars will be truncated to 8 bits. It can be expected that these functions will run at identical speeds to their Word8 equivalents in Data.ByteString. More specifically these byte strings are taken to be in the subset of Unicode covered by code points 0-255. This covers Unicode Basic Latin, Latin-1 Supplement and C0+C1 Controls. See: This module is intended to be imported qualified, to avoid name clashes with Prelude functions. eg.
import qualified Data.ByteString.Char8 as B
The Char8 interface to bytestrings provides an instance of IsString for the ByteString type, enabling you to use string literals, and have them implicitly packed to ByteStrings. Use -XOverloadedStrings to enable this. bytestringpackage  bytestringP3Fast, packed, strict and lazy byte arrays with a list interface A time and space-efficient implementation of byte vectors using packed Word8 arrays, suitable for high performance use, both in terms of large data quantities, or high speed requirements. Byte vectors are encoded as strict Word8 arrays of bytes, and lazy lists of strict chunks, held in a ForeignPtr, and can be passed between C and Haskell with little effort. Test coverage data for this library is available at: http://code.haskell.org/~dons/tests/bytestring/hpc_index.html  ByteStringmodule Data. ByteStringA time and space-efficient implementation of byte vectors using packed Word8 arrays, suitable for high performance use, both in terms of large data quantities, or high speed requirements. Byte vectors are encoded as strict Word8 arrays of bytes, held in a ForeignPtr, and can be passed between C and Haskell with little effort. This module is intended to be imported qualified, to avoid name clashes with Prelude functions. eg.
import qualified Data.ByteString as B
Original GHC implementation by Bryan O'Sullivan. Rewritten to use Data.Array.Unboxed.UArray by Simon Marlow. Rewritten to support slices and use ForeignPtr by David Roundy. Polished and extended by Don Stewart. rX@)Data ByteStringFusionData ByteStringLazyChar8Data ByteStringLazyInternalData ByteStringLazyData ByteStringChar8Data ByteStringUnsafeData ByteStringInternalData ByteString bytestring0.9.1.0Hhttp://hackage.haskell.org/packages/archive/bytestring/0.9.1.0/doc/html/Ehttp://hackage.haskell.org/cgi-bin/hackage-scripts/package/bytestring