HOOG p]x5!$%&' 4477ee  FF* + - ./0CCqq__KKMM1DDQQrutt  WWMMOOUU\\2 kkDEuu]]jj3 uu44]]rryy4vv  55^^sszz5  66tt{{6 FFttvv 77\\^^uu||788vv}}8ww__:<#..= !#$&'))> ""%+//\,,^++-0_"{{OOLLjj  //CHWWY[a1owwz}  (,/<@LN`bll|}     ##**08:;AAIMSSVVXX``cdkkoorrz} ,,b^12DDn''*+..5599EEPQffvv%%4466>@IJLLQRXYggqq''))HHSSrrww>@CCTUZZ\\mm""AANNc349:@DPPRSUVYY\\himmootwz|""&(0022=>ABJJMN[[`ahhjkmm    !!))99@CFFKKRSZZffrrxx{|~    %%**--0033<<?@VW\\`fyy&d59EFHHMOST^^ddmmvwyy~~CIJNRjj~    !!##*+02::FFIIKKMMVVXXabeg''./EQYY\\xx}}''1177=@EEQS=e2259;=DGIIMPSVYY\\``cfhimnppssuwy  0225589;;A{}}!!##''))02446<>MPPV\^_bcegkkorytf58MMddffmmuv~~$$((++./NOTWYZll|++;@GGORYY[[``gi$$02BBGMOOilssww!!((FFJKRRZZ`bfj{{'.;;NNUVhikg67:;=>STuu11EEMMcc/55>ERRYYcdooyz##<=[[`acfikuwyy}}((0099GGZZ__jjttvvy| ));;BhU44RRUV\\bbll  ;;==GGUV[[cgnn  &&-`VWYYbbxx99>@DDPP[[^x~~AAGZggjjxi58<>EGIIMMPQUVYY\\abdehimmooqsuv  ''+,08;;>>ABEEGGIJMMOOXX[[^^cchn|| '',/335578<<?@DDFLNPRRXY[[`1j11k222twz}&&//MM@@JJMMRRWW,Dyy))AACCHHRS]]FFl2258:GMMPQ[[]]__ddtx&+-.99;<@@HJLN`bll|} ++02446689;=@@DDFFIMRRUU[[^_cckkmmzz|}    0199GH@m88==NN^^ggmmww~~ ##'',-67>>HMSX[[ggrrwx   --44KKXXddZ\\ghmmoquuxz~~$$**.//n5:=>FJMOQQUVYY^^abdehlppuwyy|| "#'',-1188=CIJMX]^cchhkkpp    !!))++0578?@BBDEHHKKNPRRUUXY\\``bceo2467::@FIINOQQTVY`dfhimmty||~""$$&&((,-125;ABMORRT[]ahhjkpp   !!$&))++2289;;@@BCEHMMRRXXZZ\]``ccfgiikkxxÊp6799;;>>EFKQUVYY[[]]__ffhi %..88:;==?CKLZ[hhkkopxx   $%)),/22;;EEHHNU\\``cd ""q\\ssyy""..77kk::optt%%01VYyz##DEr5;>>BCEGIIQ`cemmuuwwz~    ""%%''+/225588:;CCGGLMOOTXZZ]acgllttzz    #%**5588;;??AAIIKLNPSVXY``cdffnqxхs14::<<DFSSVV__ainors  ""++..88BBJJLMaamm}}  &'19<=BBELTUW^fgllprxx}++--0033<=t22679:=>DGIIPQUVYYcfhmpsvvz|  %(,..1288ACGGKLNNUXZ[^^bcffhnp{ !()-/113688>EKLNUX\_`bdfgjlpu22FF__gguuyy~ ''99<=SWbbfflm    !!$%)+1178=@QUYY``ggkk ')++22PPTWttww'(1147=BVZ__v279GGPPww0037LLXXbg;;KKKLRSXXghkkmmqq$%))88IIxx*+@CXXllw.Z`pp//;;dgnn&&-/;;LL]]``AD]tcx02Dmppxx+EEQQUVYYhi88ABIIh{  ^^eh$$OO__hhkknnyBFJJXY[[ffhimmvv!%*+225588>CKLPQZZcg%%))PPVVXXccqq "")),,..124488==?@HMRSYY\\^_ghJJTUPz58``ss55'',/<<[[ZZ38p|""+ dq_HHi()C_->_All^Any^ArithException^ArrayException^AsyncException^Bool^ BufferModep^ BufferStatel^CChar$^CClock]CDev]CDoubleg]CFloat]CIno\CInt~\CIntMax6\CIntPtr[CLDouble[CLLongM[CLong[CModeZCOffuZCPid-ZCPtrdiffYCSCharYCShortUY CSigAtomic YCSizeXCSsize}XCTimeKXCUCharXCUIntWCUIntMaxsWCUIntPtr+WCULLongVCULongVCUShortSVCWchar VChanVCharUComplexU ConsoleEventUConstrU ConstrRepUDataRepyUDataTypeeUDoubleUDynamicTE12TE6TErrnoT ExceptionTExitCodeTFDTypeTFdnTFixityeTFloatTGeneralCategorySHandleS HandlePosnS HandleTypeSHashDataSIOS IOErrorTypeS IOExceptionSIOModenSIdYSInsertsUSIntSInt16RInt32bRInt64RInt8QIntPtrxQInteger8QLexeme*QMaybePOrderingPPPQSemPQSemNPReadPoPReadPrecVPSTM=PSeekMode#P StableNamePTVar PThreadIdOTimeoutOTyConOTypeRepOUniqueOVersionOWeakOWordZOWord16 OWord32NWord64gNWord8NWordPtrMZipListM[::]M[][M 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 ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqEqShowReadOrdEq StorableDataReadShowBoundedEnumIxOrdEqShowOrdEqShowOrdEqShowOrdEqMonoidBoundedShowReadOrdEqMonoidBoundedShowReadOrdEqArrow ArrowChoice ArrowApply ArrowLoop MonoidDataReadShowBoundedEnumIxEqOrdu_4 ByteCountdCDirdCDirentdCFLockdCGroupdCLconvdCPasswdd CSigactiondCSigsetdCStatdCString}d CStringLenbdCTermios]dCTmXdCTmsSdCUtimbufNdCUtsnameIdCWString9d CWStringLend ClockTickdConIndexdDeviceIDd EpochTimecFDcFileIDcFileModec FileOffsetcFilePathcFinalizerEnvPtrc FinalizerPtrcGenericocGenericBkcGenericM[cGenericQPcGenericREcGenericTuuEurLucSueZubueuvkuarunyuiusuhueudu IOErrorTypexuhuauuusutueudu IOErrorTypeuusvy v IOErrorTypeanvu(vi/vr6ve=voDvrKvdRveYvr`vArgOrderruvg|vArgDescravtvivvvevsvevevkvSeekModeuvlvavrvfviwlwewFDTypecwslwu,wp3wd:weAwrHwrOwoVwr]w Exceptioneswlzwewrwrwowrw Exceptionownwewrwrwowrw ExceptiondxlwRealf?xwxoxrxl%xd,x RealWorldlkxrKxaRxcYxRealFracorxayxtx RealFloatReadbyhym~ypJys;ywxrxixtxexhymxoxdxexIOModeaynydyl$ye+y HandleTypeReadSReadPr^yeeyclyReadPrecoydyeyIOModeaynydylyey HandleTypeuyfyfyeyry BufferStatetzwzbMzdze%zv,zi3zc:zeAzFDTypeuTzf[zfbzeizrpz RawBufferLexemeizozRationzazlzRationalszezmzQSemnzQSemNa~e}im}oQ}rY{tE{u+{n2{c9{LexemerL{Ptre}in|oj{c{d{t{{o{c{o{l{e{r{r{o{r{ IOErrorTypeu{c{t{Producte{s{s|g,|i|d| ProcessIDr3|o:|uA|pH|iO|dV|ProcessGroupIDn|vz|a|t|e|u|s|e|GeneralCategoryt|f|a|t|y|p|e| PrintfTyper}g } PrintfArgcC}f)}i0}x7}FixityPrecoX}l_}Poolct}o{}Picor}m}i}u}t}e}ArgOrders}s}i}o}n}d}e}n}i}e~d ~ IOErrorTyper~t)~t0~e7~r>~nE~mL~aS~tZ~ca~hh~fo~av~i}~l~ Exceptiona~g~r~a~p~h~s~e~p~a~r~a~t~o~r~GeneralCategoryOpaqueb1prԀttv6e=rDfKlRoYw`ArithExceptionh{erelon7psymbolGeneralCategoryunctuat ion"GeneralCategoryu>mEbLeSrZGeneralCategoryevt}terGeneralCategoryrrorÀ IOErrorTypedۀOrdering Orderinga et,adYi=oDnKOptDescre`sgcnruOptDescrrgArgDescrnpuncƁt́uԁaہtionGeneralCategoryque!Opaquej8e?cFtMObjecteounmuNumaքbm9n}rbstaӂhingȂMaybesڂsignedGeneralCategoryu c'h.t5h<iCnJgQ IOErrorTypeeippDataRepsރterminatioȃnσ Exceptionpacingmark$GeneralCategorye@tGhNoUd\ecrjrqoxr ExceptionufferingƄ BufferModer݄gArgDescrstedato#m*i1c8a?lFlMyT Exceptionaiهouv~arMVar#MVar#tavaȅrυ#օMutVar#bleabbytea$r+r2a9y@#GMutableByteArray#rirpawy~# MutableArray#d:na҆oid†MonoiddنMonadfplus MonadPlusi!x(MonadFixiAfHiOeVr]lsiypmwb~olGeneralCategoryetterćGeneralCategorycroMicrot&y beMaybeh-s4y;mBbIoPlWGeneralCategorya eoiotOrderinggwswercaˆsɈeЈl׈eވtterGeneralCategorysof$p+r2e9c@iGsNiUo\ncArithExceptiono~ff ConsoleEventmRneb seĉpˉa҉rىatorGeneralCategoryuffe&r-i4n;gB BufferModeiYt`LimitftxemeLexemeternuȊmϊb֊e݊rGeneralCategorytEitherstLastl/e6i=sDlKiRKleisli#uosvt}MaybeInteger #A1(368dđgl(no^pJsx؋Ixc%strin gIsStringh,a3r:IsCharrQIPrIOagemr~efIORefodeIOModerx̌cӌeڌption IOExceptionro r'IOErrort=yDpKeR IOErrorTypernrua|yIOArrayadFf,i؏lϏrƏt#vaōl̍iӍdڍargumen t IOErrorTypeInt #136a8Sc!epxr]edpkDataReptrIntPtrgݎrrupteŎd̎ IOErrorTypee ralIntegralrIntegero(n/s6t=rD ConstrRepInt84hInt64#|Int64#2Int326Int16Int#:+::+:tߏialquo teGeneralCategoryi3x:FixityeMxTo[ubtiopfwb~oundsArrayExceptionppÐrʐoѐpؐrߐiatety pe IOErrorTypel/e6g=aDlKoRpYe`rgantui|on IOErrorTypenoreHandlereˑnґtّLexeme#Int84#Int642#Int326/#6Int16Inta ep[rbiinptwf~type HPrintfTypeapoĒv˒eҒrْflowAsyncExceptionn rsh|r&e-s4o;lBuItPiWo^ne HasResolutiontable HashTabledwaǓrΓeՓfܓault IOErrorTypedleHandle_ޔp|rktByIpPeW HandleTypeHandlerosin HandlePosntionƔHandlePosition_Handle__e9m*qt Ordering GenericQ' GenericM'n@eGrNaDiZcaGeneric'2b mq̕rtGenericT' GenericT'GenericRGenericQ' GenericQ'GenericM'  GenericM'GenericBGeneric'lKcRaYt`eggnour|yGeneralCategory #aqd4fOi#lnonr"u˖nҖcpޖtrFunPtrto rFunctora)c0t7i>oEnLaSlZ Fractionall9rzematGeneralCategoryignpŗt̗rӗ ForeignPtrcontentsForeignPtrContentsd@aGbNlUe\Foldableoua|tFloat#cirepDataRepnȘgϘFloatingonstr ConstrRepFloat#lbnryx9eciEtLySFixitydjFixedstFirstaliquotře̙GeneralCategoryzere&pt r FinalizerPtrn-v4p;tBrIFinalizerEnvPtreih i mopathFilePathffseǚtΚ FileOffsetodeFileModedFileIDa'n.d5l<eCHandleefg`egnneur|icFFFormatiқormatFFFormatxٛedFFFormatxpo nent&FFFormatFDFdtLySpZeaFDTypelxseBoolFloat 16ikn՞ožp~qirxʜcѝi֜tݜcecf+successExitCodea2i9l@uGrNeUExitCodexjcqexption ExceptionodeExitCodee؝pߝtion ExceptionrnSo!r(c/a6l=lD ExceptionoZErrnoOrderingEqochtime EpochTimefɞLexemecdumEnumoEndolos%i,n3g:mAaHrOkVGeneralCategorytrhyerEitherE62E12#aeߡiJouyܟnave/ioer ror IOErrorTypex6c=eDpKtRiYo`ng Exceptionm}icDynamicaplexhĠaˠnҠd٠leHandlelDualuble$Double#9Double#rvVi]ddekbryyzeroArithExceptionectošr̡yӡFDTypeacffn/viceidDeviceIDo6r=mDaKlRArithExceptionamutl{tHandlerimalnumbǢe΢rբGeneralCategorydlock  Exceptionst(a/DataDatarwtPyWp^eeDataTypee~pDataRephpunctuǣaΣtգiܣonGeneralCategoryDouble# acdfgVhijhlmopsftuwbcˤsntur|ingCWStringlen CWStringLenhҤa٤rCWcharciWlrsxtiJsn#a*m1e8CUtsnamemQbXu_ffCUtimbufhortCUShortrencyȥsϥy֥mݥbolGeneralCategoryl1ong!CULongo8n?gFCULLongn^teCUIntmp~trCUIntPtraxCUIntMaxhŦa̦rӦCUChare1imCTmsCTmsme"CTimer8m?iFoMsTCTermioschΨistaڧringCStringlenƧ CStringLentCStatizeCSsizeg7z!e(CSizeabsCeJtQCSigsetctnoum|ic CSigAtomiction CSigactionoըrܨtCShortharCSCharasi^t)r0d7i>fEfLCPtrdiffdeCPidszswdCPasswdfmXni*nstǩrΩoթlܩGeneralCategoryc ConsoleEvento^tConstr(Constrr=eDpK ConstrRepleelesvzent ConsoleEventectorȪpϪu֪nݪctuationGeneralCategoryn1d8e?xFConIndexp_lfemxtComplexfCOffodeCModecCdloԫcnse ConsoleEventdcpunct$u+a2t9i@oGnNGeneralCategoryhjaqnxdle HandleTypegCLongktiȬcϬk֬ ClockTickongCLLongoub#l*e1CLDoubleoJnQvXCLconvmopvb}ufCJmpBufnotCIntmpǭtέrխCIntPtraxCIntMaxCInoanHr&Char#9Char#Chanr]odukprCGroupilposCFposoaڮcîkʮCFLocktCFloatleCFileeiLou&b-l4e;CDoublerSCDirefnmttCDirentvCDevh˯lockCClockaүrٯCChartchHandlerChariZl4oruy4t;eBa}cNoUu\nctj ByteCountrray# ByteArray#ff°eɰrаBufferlIm state  BufferStateo'd.e5 BufferModeiPsWt^ BufferListcn|il BufferListons BufferListeƱaͱkԱ ConsoleEventoundedBoundedl&Boolo;cBkIbeUd\iohnodve}admvar ExceptionndIJe˲fҲiٲnitely Exceptionuf f'e.r5i<nCgJ BufferModetashBitsb<dlnpross yncexócʳeѳpسt߳ionAsyncExceptionert!i(o/n6f=aDiKlReYd` ExceptiongiPraеowArrowachl@mpzeǴrδoմ ArrowZerolus ArrowPlusona%d, ArrowMonadoGoNpU ArrowLoophoovi}ce ArrowChoicepply ArrowApplyy׵Array#@excep tio!n(ArrayExceptionArray#tWh^eexlcsezptionArithExceptiondorȶd϶eֶrݶArgOrderescr ArgDescrp$evl0i7c>aEtLiSvZea Applicativen}dhmodeIOModeandƷlͷeԷ HandleTypeyAnyglr[tern#a*t1i8v?eF Alternativeebaidpywe~xists IOErrorTypeAllcr˸eҸpٸDataReponstr  ConstrRepdr&#-Addr#sCoJlQuXt_efsmete{kSeekMode:][]:][::]*+й:׹:+:::*:)()'4]-U!~X*pR&5^0U 4wGenericTa*Inta'aa)raxmtaMaybeGenericMaacakama mGenericMar[]awrmauMaybear[]GenericQaChar[]Char[] _W5[<Char[]a(,)[]Char[]81AllAnyArithException,ArrayException&AsyncException-Bool%#SLL. BufferMode/CCharCInt0Char-Constr ConstrRep;.'DataRep=1DataType($DynamicErrno2 Exception*3ExitCode/4FDType5FdFixity6GeneralCategory7 GenericT'Handle8 IOErrorType9 IOException+)IOMode:IntXTMK<;Int320.=IntPtrInteger>Lexeme=/?Orderingk@SeekModeATyConT0TypeRepVPUnitBVersion>CWordPtraKmlGF9854.-+(o><421YXWVU6321|]\[ZNGFEDb JI>_OcqnUNKdti`mZYqu[r|z7res`u9()IO ExceptionIO()IOaPtrFunPtrbamKleislicba WrappedArrowc()sSTIntInt(,)]IntInteger(,)^aa(,)Xab(,)_am WrappedMonadasSTzba:*:ba:+:`ba ArrowMonadbbaConstcbaEitherebba(cbaoia)da(,)Wdbarpqpnmra(,){yasSTRefsSTwc'c(,)bajTypeRep[]TyCon(,)Qdca(,)dma(,)Vq[]a(,)Xy[]acc(,)fa()IO@&tlNMLKJA"    "   vqpigea`WV ()Ptr()ReadP()f()m D?,^ArithExceptionMaybeAsyncExceptionMaybeBoolIO rT  BufferModeIOCDevIOCInoIOCIntIO CModeIOCPidIO CSsizeIOCTimeIOCharIOCharReadPCharReadPrec"Char[] {zZO&ConstrMaybeConstr[]DynamicMaybeErrnoIOFDTypeIO HandleIO,HandleMaybe HandlePosnIO IOExceptionMaybeIOModeIOIntIOsRIntMaybeInt[]![Int64IOIntegerIOIntegerRatiouLexemeReadPLexemeReadPrec#PoolIOQSemIO#QSemNIO$ThreadIdIOsTypeRepMaybeUTypeRep[]SUniqueIOVersionReadPaArgDescra5aArgOrder4aComplexbYaDatalaDualdaEndoaFirstaFunPtraIO-m;:98#!  ~{xwUaLastaMaybe $ n@^aOptDescraProductqaPtr\:baRatioaReadP vaReadPrec (%$a StablePtraSumxaZipListAa[]"gE763210,"}|3*KJGFEDJacxwaf|{*amihA@   %+b ForeignPtr_bFunPtrdbIO 76\ZcbMaybeypbPtrfb[]H:bf<;~}bmBbt=cGeneric'cIO^}yc[]LcfMcmjd[]OdfPdmse[]Qf[]Rg[]Sh[]Tm GenericM'r GenericQ'\rIO-rmedcbau[]]yMaybe gfedcba(,,,,,,)[]Rfedcba(,,,,,)[]Qedcba(,,,,)[]Pdcba(,,,)[]OCInoCDevFDType(,,)IOcba(,,)[]NdcbEitheraocd(,)bd(,)aecdEitherbdEitherahc'c(,)b'b(,)akc'cEitherb'bEitheraldc(,)db(,)addcEitherdbEitheragfa ExceptionEitherIOta IOExceptionEitherIOuabEitherIOba(,)[]Mvalkey HashTableIOvChar[]Char(,)[]Char[]String(,)[]Char[]a(,)[]IntInt[](,)?g[]f[]e[]d[]c[]b[]a[](,,,,,,) f[]e[]d[]c[]b[]a[](,,,,,) e[]d[]c[]b[]a[](,,,,) d[]c[]b[]a[](,,,)c[]b[]a[](,,)a[]a[](,))b[]a[](,)b[]b[](,) Char[][]Char[][]Char[][]a[](,,,)Q Char[][]Char[][]a[](,,)P&()PtrIOCCharPtrIOCWcharPtrIOChar[]IOIH Char[]MaybeChar[]ReadPChar[]ReadPrec Char[][]YaChanIORa ForeignPtrIOjhaIORefIOfaMVarIOhaMaybeIO%aMaybefyaPtrIO~iIHGFEDCB@! ?a StableNameIOja StablePtrIOka[]IOr&HSa[]MaybeIa[]ReadP'a[]ReadPrec!a[][]/CBa[]fza[]m +acMaybeusatfatmbMaybeIObPtrIOb[]m]bcMaybevbtfbtmc[]mCkWeakIOvMaybeIOvWeakIOvalMaybeIOocbcba(,)a'bat'cMaybetvk(,)WeakIOvalkey(,)[]IOnaMVarInt(,)MVarIOgHandleChar[](,)IOIntCCharPtr(,)IOIntCWcharPtr(,)IOaChar[](,)ReadPChar[]a[](,)[]c[]b[](,)mChar[][]IO aIORefWeakIOat'cMayberChar[]Char[](,)[]IO2M) )(r(N(0(('''XkFQ.8fL2O(3|T4lresresba`tsacIOcIObPtra^Char[]Char[]a_Char[]a(,)[]Char[]InthgfedcbaTgfedcbaSfedcbaRra5a4a3a2a1aedcbaQra4a3a2a1bdcbaPOra3a2a1c Boolaa210/Orderingaa6543aaa987abaGFEbbaJIHcbaNMLKcbbnra2a1drrrxrrr'|{rr'rzysstda(,)daWqa(,)daXr'a(,)da{yyacc(,)xaccfdma(,)daVgca(,)gaambaA@?bmbaBcmbaDCBoolCharBoola)('&%$#"! BoolrwCharInt Exception ExceptionGenericTa* IOException IOExceptionIntCharInt32keyvaa.-,+)(abkbaqn>=<;:bbml.caUcbqpoUqdcrnddtmaZYqa[qb[qdurax\ra1erbr'a|zua]9 rca(,)drdcaasSTaba(,)abIOaPtrInt\()IO ExceptionBoolma Char[]a&MaybeGenericMaaIO ExceptionaIO IOException~aIOaaIObaIO exceptionaReadPIntacaama     bIOPoolbIOabMaybe ExceptionbMaybeab[]abfabma j^]bmbihcmbjdmdsmGenericMarGenericQarIOHandle-rcrrmauMaybeaba(,)IOaba(,)Maybebgcb(,)maaPtrIOarcrbccba(,)qdturesb[]`Char[]Char[]aIOCCharPtr:aIOCWcharPtr;bIOaPtr76ZccIObPtr^dtdttChar[]a(,)[]Char[]dtmdtsaIOIntCCharPtr(,)8aIOIntCWcharPtr(,)9:AllAnyArithExceptionArrayExceptionAsyncExceptionBool BufferMode CCharCIntCModeCOffCSizeChar  Constr  ConstrRepDataType DoubleDynamicErrno) Exception M{ExitCodeFdFixity GenericT'Handle      HandlePosn IOErrorType IOException IOMode-,Int8KGFDC<9876543210/.-,+*)('&%$#"!  UInt32Int64IntPtr:Integer?>=<;  Pool IHGFEDCBA@QSemJQSemNKSeekMode ThreadIdNMLTyConPOTypeRep WVVUUTSRQUniqueXVersion[ZYWordPtr\a|{zyqnnmljih][XWVNGFEA@?>62.-,(  8 accfbkkgNJIHBd {yutsXWV exceptionNgxikkeyrqpor|{zysvvalrqx~}|{zyxwvutsrqponmlkjihgfedcba`_^]IH?9543]xx_654}}]WMLaaaReadPbacxbaf~bam()IOaPtrenvPtrFunPtrji()IOaPtrFunPtrhggfedcbatfedcbatedcbatdcbatbamKleislicba WrappedArrowcbata RealWorldSTaa(,)MLKJam WrappedMonadasSTasSTRefb()abba(,)KONbaConst[baEitherUbatcbarpnmlkjiihgfedcc'bajc'b'alkdbaodcapqpomvalkey HashTablerqponL()IOsa()Ptr ()mBool[]BooltCCharPtr CWcharPtrChar[]X<;:98765543210/.-,+*)('&%$##""!!       Constr[]=$HandleMaybe)IntMaybeInt[]>IntegerRatioTypeRep[]PaArgDescraArgOrderQPaChanWVUTSRaComplexZYXaDual\aEndo]aFirst^aFixeda ForeignPtrigcba`_aFunPtrfedaIO'&%#" ~}|{{zyxwvutaIORefaLastaMVar aMaybe ^oaProductaPtr#tsrDCB&jhaRatioaReadPv'aReadPrec(a StableNamea StablePtraSumaZipLista[]Y`_TSRQOLIHDC:876432110/#"!  ~tIE*)^]\[ZYXWVUTSRQPONMLLKKJJIIHHGFEDCBA@?Vacwvaf PM<;~}|{{zyam ,+atZYJB=95%$a1medcbaa2mdcbaa3mcbaa4mbaa5mabIO}yxbMaybebPtrb[]TSRQOLFEDC@?`_RQPONMbcxwbfPM}|bmbtGAcGeneric'kcIO}yc[] TSRQORQPONcfPcloseReadPd[]TSRQRQPOdme[]TSRRQPendReadPenvPtrjif[]TSRQg[]TRgcxm GenericM'lmtopenReadPr GenericQ'msepReadPvWeakx[]f gfedcba(,,,,,,)[]fedcba(,,,,,)[]edcba(,,,,)[]dcba(,,,)[]cba(,,)[]dc(,)db(,)aaba(,)[]ybatcutvalkey(,)[]vaMVarInt(,)MVarIntCCharPtr(,)HIntCWcharPtr(,)I()IOMaybe()PtrPtrChar[]Maybe)Char[][]>QPaMaybe[]aOptDescr[]QPaPtrIOaReadP[]aReadPrec[]a[][]Da[]taftam[]ammamtatcsrdtm|A6~~~~~~~n~_~T~E~:~/~$~~~~}}}}}}}}}w}f}T}>}3}(}} }||||||d|Q|.||{{{{|{e{V{zzzz{zkz`zUzFz'zz zyyyyyyqyayQyAy1y"yyyxxxxxxxx{xXxMxBx7x,x!xxxwwwwwwwwjwWwLw8w)wwwwvvvvvvvvvzvkv\vEv'vvvvuuuuuuuu{upueuVuKu@u5u*uuuutttttttttftVtCt2t!tttssssssjsMs:s#ssrrrrrrrr{rlrRrGrI!IIHHHHHHVHKH>>>>>u>b>D>&>>>======}=n=U=F=7====<<<<<<<d<C</<<<<;;;;;;;};T;';;;::::::y:S:5:::999999Dataa|DatadDataa{Datad/GenericQTypeablerGenericQREqkey6Datad Typeable1t8Datad Typeable1t5DatadMonadm Typeable1tArrowafcArrowaArrowabTypeableaTypeablebDataaOrdauMonadm MonadPlusmTypeableaTypeablebMonadmTypeableaTypeablebCMonadmMonadmMonadmMonadmMonadmShowSDataaGenericQ<TypeableaTypeableb;Monoidm Traversablet:FoldabletMonoidmzDatad}DatadyDatadMonadm ApplicativefX+ ApplicativefW~J@<>Foldablet=02Foldablet13MonadmMonadmAFoldabletMonadm7FoldabletMonadm8Monadm9Monadm^_[- Traversabletm,SFunctorf Applicativef4?Foldablet56@&2Foldablet'3E]w>TypeableaTypeableb01(NGenericQ2GenericQGenericTN^GenericQStringFoldablet!FoldabletvxB$"#9xFilePathStringFilePathStringStringStringString MonadPlusmGenericQ{MonadmFoldabletMonadmMonadm TraversabletkwMonadmMonadmMonadm; MonadPlusmTypeableaTypeableb:MonadmTypeableaTypeableb MonadPlusmGenericMRs MonadPlusmGenericM3MonadmGenericMDataa MonadPlusm~DataaMonadmMonadFixmMonadmMonadm ApplicativefFoldablet Applicativef TraversabletvDatadbGenericFoldabletNumaOrdaStringNumaOrdaStringPrGenericQ *GenericQMonadmGenericQGenericQKReadSDIOError|!{dStringDataaString RealaReadSJReadSStorableatDataxTypeableyGenericQTypeableaTypeablebS MonadPlusmGenericQIaIntegralibIntegrali^cIntegrali Typeable exception)TypeableaGenericQ+IntegralaShowSANuma1RealaShowS0ShowaShowS' RealFloataShowS)*-IntegralaShowSStorablea9TypeableaTypeablebqIntegralbNumar FractionalaIntegralbhIIntegralbRealFracaIntegralaNumb FractionalbRealaKIntegralbRealaEnuma~ RealFloata;Reala#/Ordaace=Numa!MonoidaIntegralag FractionalabFloatingadesBitsa|OrdaDataaijmnktyzOrdahlfxEqakDataaEnuma\IntegralaRealFracaRational 7 RealFloataiIntegralbRealaIntegrala4 RealFloatas5Numa Fractionalatuz{}67;CDFloatinga>EnumaBitsa,Typeablea RealFloataFIntegrala HasResolutiona BitsaBitsaStorablea RealFloataEnumaDataaBitsa_wGenericQTypeableaDataaYDataaDataaNumaReadSStringStringString RealFloataNumaIntegralaBitsaYEqaFoldabletxDataaZMonadmlFunctorf ApplicativefStorableaStorableaZEqaOrdaEqaEqaEqaStorableaEnuma#ShowaStringDataaString EqaPGRealaRational%StorableaEqaStorableaEqaStorableaTypeableaTypeablebSShowaOStorablea SampleVarN RealFloataIntegralbRealFraca RealFloata RealFloatai[String\StringShowS56X><=9#String Typeable exceptionml-Storablea+Storablea()Storablea*,Storablea/0Storablea1.StorableaV'Storablea RealFloataNuma RealFloataDataaReadaReadSStorablea2ShowaShowS RealFloataEEnumaBitsa~ConIndexMonadmMonadmA:3PrecStorableaStorableaStorableaIOErrorIOErrorIOErrorIOErrorIOErrorStringFilePathIOErrorFilePathIOErrorStringIOErrorStringIOErrorFilePathIOErrorIOErrorFilePathIOErrorStringShowa HPrintfTyperStringString String   IOErrorXStringOTypeableaPTypeableaQConIndexConIndexUStringString>StringStringXDataaConIndexkStringString$ShowSl]]^_`abA-ghijFDCStatBFDCFDGFDnDpFDEFD.ShowS ReadSWNuma`Y]WI]Monadmy MonadPlusm HasResolutionaStringed.FoldabletMonoidm9 Typeable7t8Typeablea Typeable7t7 Typeable6t6Typeablea Typeable6t5 Typeable5t4Typeablea Typeable5t3 Typeable4t2Typeablea Typeable4t1 Typeable3t0Typeablea Typeable3t/ Typeable2t.Typeablea Typeable2tKFoldabletMonadmIMonadm TraversabletC ApplicativefFoldabletB Applicativef Traversablet$0FoldabletOrdaFoldabletNuma- Typeable1t:Typeablea Typeable1tFoldabletiFoldabletEFoldablet MonadPlusmFoldabletMonadmMonadm Traversablet AlternativefFoldablet ApplicativefFoldablet Applicativef TraversabletFoldabletMonadm7DatadMonadm Typeable1t MonadPlusmTypeableaTypeablebp}MonadmZDataaMonadmo|Monadm=MonadmTypeableaTypeablebC MonadPlusmEMonadmlMonadmp Applicativefo Applicativef` Applicativefn Applicativefv Alternativef Alternativefh AlternativefuDataa4TypeableaTypeablebYTypeableaTypeablebDataa Typeable2t[ Typeable2t Typeable2t'Dataa Typeable1tZ Typeable1t Typeable1t'sArrowarArrowa ArrowChoiceaArrowa~Arrowab ArrowChoicea_Arrowa^Arrowaq ArrowPlusa ArrowChoicea ArrowChoicea ArrowApplyaArrowa'Arrowak  ArrowLoopa`Numi_IntegralaJMonadmHMonadmStorablea,ShowaShowSStorablea%1Orda?Numa+Monoida]Z^{zyxVwUvEqaDEqadaEqa-Orda\Eqa@vEqa} StorableaZString3ShowSStringCWStringStringCStringString CWStringLenString CStringLenString PrintfTyperStringStringVString[StringReadaStringTIsStringaStringString8String7~StringString_`FilePathceFilePathRIOErrorString TyString.IOErrorStringStringStringAString?MonadmStringStringNumaFilePathStringNumaFilePathStringFilePathStringyToFilePathStringFilePathStringdgFilePathStringStringStringSjStringStringRealFracaReadS ReadaReadS NumaReadSDataaReadSReadSReadSReadaReadSStringNumaStringNumaStringNumaStringbStringNumaStringReadaStringStringKFilePathStringlStringFilePathStringStringStringCWStringStringCStringString CWStringLenString CStringLenStringwjD MonadPlusm!Monadm MonadmRLOJMString^StringUTSRQQPPuONLsN?rM\HReadSGvX{EReadS'(efop]StringaIntegrala RealFloataRational FractionalaRational;RationalStorablea{StorableaStorableaStorableaStorablea|StorableaOPStorableaQ$Storablea4StorableazStorableaJTNStorablebLCWStringStringCStringCStringCStringCStringCStatCStringCStringCStringStringCDirCString@CDirCDirentyCStatxCStatwCStatCDirvCStatuCStatUCDirentCDirCDirentCStringqQ*&%&( RealFloataShowSString8B SampleVarL SampleVar SampleVar% SampleVaro>p:Typeable exceptionIOErrorM?IOError FGV  GenericQGenericMFinalizerEnvPtrFinalizerEnvPtrK FinalizerPtr FinalizerPtrMaLnkh~ RealFloata RealFloata RealFloata=o#sStringrString8UIxaIxaIxaIxa CWStringLenString CStringLenString,MonoidaFloatingaBoundedaKH x )Precnq"*[  L"<=UXfopqruW4!<T|HV$R&     SHstBG MonadPlusm Alternativefu ArrowZeroaArrowa ArrowApplyanStringReada#mReadaString?Numa"wlqString`[tReadaQFjqg}tYiprStringfStringmStringStorablea SampleVarStorableaM FinalizerPtr_!Www"">>JNWWoo||    ?   ""+.0488<@DDGGMMSSYY[\`ackrsxxzz|    !))+/279<>@BBJKZbegijlqvw  $$),./9:>?BBDEHZ`agmw;HHMMPPSU\\`acfhhosyy}}  &&))++2488>>A%.00:BDEIIOTbbjjlmwwc  ##%%*+--/0335589;=BDGMRRXZ^acmqsu{BDEGGIINORRZZ__bbdepprrux(+--02::<>@BITVVXXZnpp;*,..114479==@@CDPPTTgknnqryy{{   #$''+/>>IITU__rruuww))--1:>>VVYZ`acfllq  ##%%''--01335589<<?@BBESZZ\\ilnnu    !"$'++113477:@FFHHKKQSZ[]_cx!"(*,.02;>@CVVYfiikknnpp   &+--002488<=?@NQVW[  ""++37=BLOQRV[__eelmrrttvvx~8;;@BEEGGLTVWZZddfg&jj"IIPPRSyz||--22DEWXZZddffkl~^PPTT\\aaddffhhnnqr~~!&&()-/44;;AACCIIKMZ[__aafgijnpyz    %&*+//::??LNPPRRTUYYhhjjlloowwb  #+//35<=BCGMOOQQYY\\`acfiltuwwyz}}##()-/11447799?ACHJJZZ\\_bhhlpttvvx!$&&)/38;;?EHZgmooqBBIIOTVVZZmmY!#**..114588==ADGJMMRSYuwxz{}~8:<>AGGIIKKP_ffhhkkmmrrtuwz##%.9>@BDGLNPPRRTVZZemop]]__hhtt{{    002299CC[bdfkkoo/    !'++-/DDHHKQV[]_depquu{{((::AAOTggjj[..0199@DKLNPRRXY[\^bghmmqrvvyz}}!(),066:<>@IOXY__ddfgijmmpprry{    '.129;ABDFIPWXZZcgjjllpp\]J]:],]]]\\\\\\\|\j\X\F\8\$\\[[[[[[[[l[Z[H[6["[[ZZZZZZZjZXZFZ6Z(ZZZYYYYYpY4YXXXXtXZXS"SSRRRRxRJR6RRRQQQQQPQ"QQPPPPtPTP6P(P POOOOxO^OHO0OONNNNNnNPN8NNMMMMMfMHM0MMLLLLxLPL0LLKKKbKDK(K KJJJJJ|JbJHJ2JJJIIIIIpIXI*IHHHHHHlHRH8H&H HGGGGGpGVG*GGFFFFF^F>FFEEEEtEVE"EDDDDiD?DDCCCCkCGC#CCBBB|B^BLB8B"BBAAAAzAbABA"AA@@@@@n@X@F@2@@@????r?X?>?"??>>>>~>T>@>">>====`=>="=<<<<z<X<<<<;;;;;v;R;:; ;:::::f:H:0::99999r9B9&998888`8@8*887777~7^7<7&77666~6U67665555s5Q5/554444h4V4:4&44333333|3h3T3833 32222v2^2B2"221111d1:1100000^09000/////h/F/*/ /....v.T.@. ..----~-f-L-$--,,,,,v,R,8, ,,+++++j+<+ +****z*`*>*"**))))l)H)())((((x(V(>((((''''w']'='!'&&&&{&_&A&%&%%%%{%Y%G%1%%$$$$s$W$1$$#####e#K#-# #""""S"3""!!!!!q!O!-! !      i S 3 #  ycI5w]5}Y;# sW;];}aG)mQ;%}aK)o]C' qS9}[C! yQ-f<pR8v<"pH.~R<p@     p V > (      V       h L ,      h T @ (      r P 6  w[;'oWAy_;#qS+I{]?mM7fH&jN, ~hB `F4"rP0vT4tV8" vJ4vP.b6hH*`J4rXF(hL4h>gG/kOgG%i?s_E1]/a; w_E/kM~fH.pZ<& hN2nP0rV: pJ$kI'uO+}[9eC+wQ3rFrX<tZB nNZD,jL.pN4_=aE'u_+sY=#q]=%gI' z^>&zfD(`@Z\&DJdB( oW9dF b@*xZ<tL2 lD*fB(nN0xZB\. ֿx\D,zZ4ֽfN:& ̼Z6 »tX0ܺpXB(̹fH&޸tbL.طķtT8ȶ||||||||||Y zipwithm_ zipWithM_zipwithmնzipWithMzipwith7zipWith7zipwith6 zipWith6zipwith5)zipWith5zipwith4EzipWith4zipwith3azipWith3XzipwithzipWithW~ziplistZipList|}zip7zip7{zip6ͷzip6zzip5zip5yzip4zip4xzip3 zip3Vwzip zipUv zeroarrow< zeroArrowuyieldVyieldtxorjxors writestref writeSTRefrwritesamplevarwriteSampleVar writemodeθ WriteModeqwritelist2chanwriteList2Chan writeioref writeIORefp writefile4 writeFileTo writechanV writeChan wrappedmonadw WrappedMonadn wrappedarrow WrappedArrowm wrapmonad WrapMonadl wraparrowڹ WrapArrowkwordswordsSj wordptrtoptr wordPtrToPtriwordptr4WordPtrhword8LWord8gword64cWord64fword32{Word32eword16Word16dwordWord\c withprognameɺ withProgNamebwithpoolwithPoolwithmvarwithMVarwithmany!withManywithforeignptrCwithForeignPtrawithfileewithFile`withcwstringlenwithCWStringLen withcwstring withCWStringwithcstringlenջwithCStringLen withcstring withCStringwithcastringlen withCAStringLen withcastringG withCAStringwithbinaryfilemwithBinaryFile_ witharraylen0 withArrayLen0 witharraylen withArrayLen witharray0ۼ withArray0 witharray withArraywithargswithArgs^with/withwhenCwhen]weakWWeak[ waitqsemnt waitQSemNwaitqsemwaitQSemvoidvoid versiontagsĽ versionTags\ versionbranch versionBranch[versionVersionZYZutils(UtilsY usererrortypeF userErrorType usererrorsi userErrorsX usererror userErrorR usageinfo usageInfouppercaseletterξUppercaseLetterWupdateupdateVunzip7unzip7Uunzip6unzip6Tunzip57unzip5Sunzip4Ounzip4Runzip3gunzip3QQunzipunzipPP unwrapmonad unwrapMonadO unwraparrowĿ unwrapArrowNunwordsunwordsOMuntiluntilN unsafesttoio unsafeSTToIOunsafeperformioBunsafePerformIOM unsafeiotostm unsafeIOToSTunsafeinterleavestunsafeInterleaveSTunsafeinterleaveiounsafeInterleaveIOunsafeforeignptrtoptrunsafeForeignPtrToPtrL unsafecoerce/ unsafeCoerceKunsafeMUnsafeXunlinesfunlinesLJunlessunlessIunitUnitGHuniqueUniqueWFunionbyunionByEunionunionDungtunGTungqunGQungm%unGM ungetchan> unGetChan ungeneric'] unGeneric'unfoldrzunfoldrC underflow UnderflowBundefinedelementUndefinedElementA undefined undefinedKuncurryuncurryJ@unblockunblock?types2TypesUV typereptyconS typeRepTyCon> typerepkeyu typeRepKey= typerepargs typeRepArgs<typerepTypeRep; typeofdefault typeOfDefault:typeof7typeOf79typeof6defaulttypeOf6Default8typeof66typeOf67typeof5defaultWtypeOf5Default6typeof5xtypeOf55typeof4defaulttypeOf4Default4typeof4typeOf43typeof3defaulttypeOf3Default2typeof3typeOf31typeof2defaulttypeOf2Default0typeof2>typeOf2/typeof1default_typeOf1Default.typeof1typeOf1-typeoftypeOf, typeable7 Typeable7+ typeable6 Typeable6* typeable5 Typeable5) typeable4 Typeable4( typeable3, Typeable3' typeable2J Typeable2& typeable1h Typeable1%typeableTypeableT$ tyconuqname tyconUQname tyconstring tyConString# tyconmodule tyconModuletyconTyCon"twinsTwinsStuple4TupleR trytakemvarP tryTakeMVar tryputmvarq tryPutMVartryjusttryJust!trytry truncatetruncateItrueTrueH traverse_ traverse_traversetraverse traversable0 TraversableQ transposeT transposetracenTracePtracetouppertoUppertouchforeignptrtouchForeignPtrtotitletoTitle torational toRationalGtolowertoLowertolist(toList tointegerG toIntegerFtoenumbtoEnumEtodynytoDyntoconstrtoConstrtobooltoBooltitlecaseletterTitlecaseLettertimeoutTimeoutOtimeoutthrowtothrowTothrowio4throwIO throwifnullR throwIfNull throwifneg_t throwIfNeg_ throwifneg throwIfNegthrowif_throwIf_throwifthrowIfthrowerrnopathifnullthrowErrnoPathIfNullthrowerrnopathifminus1_,throwErrnoPathIfMinus1_throwerrnopathifminus1ethrowErrnoPathIfMinus1throwerrnopathif_throwErrnoPathIf_throwerrnopathifthrowErrnoPathIfthrowerrnopaththrowErrnoPaththrowerrnoifretrymayblock_#throwErrnoIfRetryMayBlock_throwerrnoifretrymayblockbthrowErrnoIfRetryMayBlockthrowerrnoifretry_throwErrnoIfRetry_throwerrnoifretrythrowErrnoIfRetrythrowerrnoifnullretrymayblockthrowErrnoIfNullRetryMayBlockthrowerrnoifnullretry@throwErrnoIfNullRetrythrowerrnoifnullqthrowErrnoIfNull throwerrnoifminus1retrymayblock_ throwErrnoIfMinus1RetryMayBlock_throwerrnoifminus1retrymayblockthrowErrnoIfMinus1RetryMayBlockthrowerrnoifminus1retry_;throwErrnoIfMinus1Retry_throwerrnoifminus1retryvthrowErrnoIfMinus1Retrythrowerrnoifminus1_throwErrnoIfMinus1_throwerrnoifminus1throwErrnoIfMinus1 throwerrnoif_ throwErrnoIf_ throwerrnoif- throwErrnoIf throwerrnoO throwErrno throwdyntoo throwDynTo throwdynthrowDyn throwthrow threadwaitwritethreadWaitWrite threadwaitreadthreadWaitRead  threadkilled ThreadKilledthreadid5ThreadId threaddelayT threadDelaytextoTextNtestbittestBittanhtanhDtantanC takewhile takeWhileBtakemvartakeMVartaketakeAtailstailstail/tail@ synthesizeM synthesizesymboliSymbolswapmvarswapMVar surrogate SurrogatesumSumsum?succsucc>subtractsubtract=sttoiostToIO stripprefix7 stripPrefix stringrepW StringRep stringconstrx StringConstrstringStringLM<~stringstricttolazyststrictToLazySTstrictStrictJKstrefSTRefI}stream0Stream|storableJStorableHstepfstep{stdout|stdoutstdinstdinstderrstderr stackoverflow StackOverflow stableptr StablePtrG stablename StableNameFzst_size/st_sizeyst_mtimeJst_mtimexst_modeest_modewst_ino~st_inovst_devst_devustSTEtsqrtsqrt; splittyconapp splitTyConAppsplitatsplitAt:spanspan9spacingcombiningmarkDSpacingCombiningMarkspaceiSpacesortbysortBysortsort somewhere somewheres something somethingrsomesomesndsnd8 skipspaces skipSpacesq skipmany15 skipMany1pskipmanyRskipManyo sizeof_statq sizeof_statnsizeofsizeOfsinhsinh7sinsin6signumsignum5 significand significand4 signalqsemn  signalQSemNm signalqsem, signalQSeml showversionM showVersion showstyperepp showsTypeRep showstring showString3 showsprec showsPrec2 showsigned showSigned1showsShowS/shows0 showparen  showParen.showoct@showOct- showlitchar^ showLitChar showlistwith showListWithshowlistshowList, showintatbase showIntAtBase+showintshowInt*showhexshowHex) showgfloat showGFloat( showfloat< showFloat' showfixedZ showFixed showffloaty showFFloat& showefloat showEFloat% showconstr showConstrkshowcharshowChar$showShowD"show#shiftrshiftRshiftl7shiftLshiftNshiftsetuncaughtexceptionhandlerzsetUncaughtExceptionHandlersetechosetEchoj setcooked setCookedisetbitsetBitset_console_echoset_console_echohset_console_buffering2set_console_bufferingg sequencea_] sequenceA_ sequencea| sequenceA sequence_ sequence_!sequencesequence sepby1sepBy1fsepbysepByeseekmodeSeekMode seekfromend0 SeekFromEndsecondMsecondschemesfSchemesCscanr1scanr1scanrscanrscanl1scanl1scanlscanl scalefloat scaleFloatsatisfy satisfyd samplevar( SampleVarBcs_issockIs_issockbs_isregds_isregas_isfifos_isfifo`s_isdirs_isdir_s_ischrs_ischr^s_isblks_isblk]runstrunST\ runkleisli runKleisliruninunboundthread-runInUnboundThreadruninboundthread[runInBoundThreadrtssupportsboundthreadsrtsSupportsBoundThreadsroundroundrotaterrotateRrotatelrotateLrotaterotaterightRightrightreverse?reverse returninorderc ReturnInOrder[returnareturnAreturnreturnZ resolution resolution reseterrno resetErrnoYresetresetX requireorder RequireOrderWreqarg6ReqArgV replicatem_S replicateM_ replicatemt replicateM replicate replicaterepeatrepeat repconstr repConstrUremrem relativeseek RelativeSeek regularfile' RegularFileT recupderrorI RecUpdError recselerrork RecSelErrorrecoverqrecoverQS recovermp recoverMpRreciprecip recconerror RecConError realtofrac realToFracrealpartrealPart reallocbytes< reallocBytesQ reallocarray0a reallocArray0P reallocarray reallocArrayOreallocreallocNrealfracRealFrac realfloat RealFloatrealReal readwritemode ReadWriteMode readstref5 readSTRefM readsprecW readsPrec readsignedz readSigned  readsamplevar readSampleVarL reads_to_prec readS_to_PrecK reads_to_p readS_to_PJreadsReadS Ireads  readprec_to_s6 readPrec_to_SH readprec_to_p\ readPrec_to_PGreadprec}ReadPrecAFreadPrec readparen readParen  readp_to_s readP_to_SE readp_to_prec readP_to_PrecDreadpReadP@Creadoct,readOct readmvarGreadMVarBreadmodecReadModereadln}readLn readlitchar readLitCharreadlistprecdefaultreadListPrecDefault readlistprec readListPrecreadlistdefaultreadListDefaultreadlist=readList readioref^ readIORefreadioyreadIOreadintpreadIntPAreadintreadIntreadhexreadHex readfloat readFloatreadfilereadFilereaddir$readdir@readdecp?readDecP?readdecZreadDec readconstrw readConstr>readchanreadChan=readRead?read rawdevice RawDevice<rationalRationalratioRatio>rat.Rat; rangesizeJ rangeSizerangedrangequotrem|quotRemquotquotqsemnQSemN=:qsemQSem<9 puttracemsg putTraceMsgputstrlnputStrLnputstrputStrputmvar:putMVar8putcharTputCharpureopurepuncPunc7 ptrtowordptr ptrToWordPtr ptrtointptr ptrToIntPtrptrPtr;properfractionproperFractionproduct&Productproduct processid[ ProcessID6processgroupid~ProcessGroupID5 privateuse PrivateUse printftype PrintfType printfarg PrintfArgprintfPrintf:printfprintprintprime9primepreludeQPrelude9prefixjPrefix4predpredprecPrec2prec3pooledreallocbytespooledReallocBytes1pooledreallocarray0pooledReallocArray00pooledreallocarray"pooledReallocArray/ pooledreallocM pooledRealloc.poolednewarray0upooledNewArray0-poolednewarraypooledNewArray, poolednew pooledNew+pooledmallocbytespooledMallocBytes*pooledmallocarray0pooledMallocArray0)pooledmallocarrayEpooledMallocArray( pooledmallocn pooledMalloc'poolPool8&polarpolar pokeelemoff pokeElemOff pokebyteoff pokeByteOff pokearray0 pokeArray0% pokearray! pokeArray$poke:pokeplusptrQplusPtrpicohPicopizpiphasephase~pfailpfail"#permutePermute!permissionerrortypepermissionErrorType  performgc  performGC} peekelemoff- peekElemOff|peekcwstringlenSpeekCWStringLen peekcwstringz peekCWStringpeekcstringlenpeekCStringLen peekcstring peekCStringpeekcastringlenpeekCAStringLen peekcastring peekCAString peekbyteoff5 peekByteOff{ peekarray0V peekArray0 peekarrayu peekArraypeekpeekzpatternmatchfailPatternMatchFaily partition partitionx parseversion parseVersionwparensparensvparagraphseparator6ParagraphSeparatoruoverflow\Overflowt otherwisey otherwises othersymbol OtherSymbolrotherpunctuationOtherPunctuationq othernumber OtherNumberp otherletter  OtherLetteroos&osnorelse:orElseorderingTOrderingmordoOrd7kordlororijoptionaloptionalhoptionOptionoptionoptdescrOptDescroptarg OptArg opentempfile+ openTempFilegopenpunctuationROpenPunctuationfopenfileuopenFileeopenbinarytempfileopenBinaryTempFiledopenbinaryfileopenBinaryFilecononboddoddo_wronly o_WRONLYo_trunc&o_TRUNCo_rdwr?o_RDWRo_rdonlyYo_RDONLY o_nonblockw o_NONBLOCK o_nocttyo_NOCTTY o_exclo_EXCL o_creato_CREAT o_binaryo_BINARY o_appendo_APPENDnumericNumeric6 numerator6 numeratoranumNNumnullptrdnullPtr` nullfunptr nullFunPtr_nullnull^nubbynubBy]nubnub\nothingNothing[notelemnotElemYZ notassigned" NotAssignedXnot<notWnorepTNoRepnonterminationsNonTerminationVnonspacingmarkNonSpacingMarkU nomethoderror NoMethodErrorT nobuffering NoBufferingSnoargNoArgnmergeionmergeIOR newunique8 newUniqueQnewstrefUnewSTRefP newstableptry newStablePtrO newsamplevar newSampleVarnewqsemnnewQSemNnewqsemnewQSemnewpoolnewPoolnewmvar newMVarnewioref'newIORefNnewforeignptrenvKnewForeignPtrEnvMnewforeignptr_unewForeignPtr_L newforeignptr newForeignPtrJKnewemptysamplevarnewEmptySampleVar newemptymvar newEmptyMVarnewcwstringlennewCWStringLen newcwstring> newCWString newcstringlenb newCStringLen newcstring newCStringnewchannewChannewcastringlennewCAStringLen newcastring newCAString newarray0 newArray0newarray%newArraynew<newInestedatomically_NestedAtomicallyHnegatenegatemzeromzeroG mythreadid myThreadIdFmvarMVar5munch1munch1munchmunchmsummsumDEmplus,mplusC movebytesF moveBytes movearrayd moveArraymonoidMonoid4B monadplus MonadPlusAmonadfixMonadFixmonadMonad3@ modifystref modifySTRef? modifymvar_" modifyMVar_ modifymvarC modifyMVar modifyiorefd modifyIORef> modifyioerror modifyIOErrormodifiersymbolModifierSymbol=modifierletterModifierLetter<mod'mod';modmod mkweakptr  mkWeakPtr mkweakpair? mkWeakPair mkweakioref` mkWeakIORef:mkweak}mkWeak mktyconapp mkTyConApp9mktyconmkTyCon8mktmkT mkstringtype mkStringTypemkstringconstr mkStringConstrmkr*mkRmkq<mkQmkpolarRmkPolar7 mknoreptypep mkNorepTypemkmpmkMpmkmmkM mkioerror mkIOError mkinttype mkIntType mkintconstr mkIntConstrmkfuntymkFunTy6 mkfloattype0 mkFloatType mkfloatconstrT mkFloatConstrmkdirrmkdir mkdatatype mkDataTypemkconstrmkConstrmkapptymkAppTy5minusptrminusPtr4minprecminPrec minimumby minimumBy23minimum8minimum01minbound[minBoundminrmin/microMicro.mfixmfixmergeiomergeIO-memptymempty,memMem2mconcatmconcat+ maybewith maybeWith maybetolist6 maybeToList* maybepeekV maybePeekmaybenewsmaybeNewmaybeMaybe1(maybe) maximumby maximumBy&'maximummaximum$%maxconstrindexmaxConstrIndexmaxbound(maxBoundmax?max# mathsymbol\ MathSymbol"marshalyMarshal0mappendmappend!mapmaybemapMaybe mapm_mapM_mapmmapM mapexception mapException mapandunzipm, mapAndUnzipM mapaccumrM mapAccumR mapaccumlk mapAccumLmapmapmanytillmanyTillmany1many1manymanymallocforeignptrbytesmallocForeignPtrBytesmallocforeignptrarray0,mallocForeignPtrArray0mallocforeignptrarraycmallocForeignPtrArraymallocforeignptrmallocForeignPtr mallocbytes mallocBytes mallocarray0 mallocArray0 mallocarray mallocArraymallocmallocmakestablename>makeStableName magnitudea magnitudeltxLTlstatlstatlowercaseletterLowercaseLetterlossofprecisionLossOfPrecisionlooploop lookuplookup  look,look longestchainL longestChain logbaseklogBaseloglog listtomaybe listToMaybe listifylistifylistList/ lineseparator LineSeparatorlines lines linebuffering- LineBufferinglimitKLimitliftm5bliftM5liftm4zliftM4liftm3liftM3liftm2liftM2liftmliftMlifta3liftA3lifta2liftA2liftaliftAliftliftlexp0lexP lexlitcharJ lexLitCharlexemefLexeme lexdigits lexDigitslexcharlexCharlexLex.lex letternumber LetterNumber lengtharray0  lengthArray0length% lengthleftappB leftAppleftY Leftleftlcmz lcmlazytostrictst lazyToStrictSTlazy Lazy,-last Lastlastkleisli Kleisli killthread  killThreadjust1 JustjoinI joinix[ Ix+iteratet iterate isvaliderrno  isValidErrnoisusererrortype isUserErrorType isusererror  isUserErrorisupper isUpperissymbol isSymbol issuffixof;  isSuffixOfisstringY IsStringisspacet isSpaceissigned isSigned isseparator  isSeparator ispunctuation  isPunctuationisprint isPrint isprefixof  isPrefixOfispermissionerrortype: isPermissionErrorTypeispermissionerrorl isPermissionError isoctdigit  isOctDigitisnumber isNumber isnothing  isNothing isnoreptype  isNorepTypeisnegativezero isNegativeZeroisnan2 isNaNismarkI isMarkislowerb isLowerisletter} isLetterislatin1 isLatin1isjust isJust isinfixof  isInfixOf isinfinite  isInfiniteisillegaloperationerrortypeisIllegalOperationErrorTypeisillegaloperationWisIllegalOperationisieee{isIEEE ishexdigit isHexDigitisfullerrortypeisFullErrorType isfullerror isFullErroriseoferrortypeisEOFErrorType iseoferror+ isEOFErroriseofFisEOFisemptysamplevargisEmptySampleVar isemptymvar isEmptyMVar isemptychan isEmptyChanisdoesnotexisterrortypeisDoesNotExistErrorTypeisdoesnotexisterrorisDoesNotExistErrorisdigit:isDigitisdenormalized[isDenormalizediscurrentthreadboundisCurrentThreadBound iscontrol isControlischarIsChar isasciiupper isAsciiUpper isasciilower isAsciiLowerisascii.isAsciiisalreadyinuseerrortypeXisAlreadyInUseErrorTypeisalreadyinuseerrorisAlreadyInUseErrorisalreadyexistserrortypeisAlreadyExistsErrorTypeisalreadyexistserrorisAlreadyExistsError isalphanum' isAlphaNumisalphaDisAlpha isalgtype` isAlgTypeiorefzIORef*iomodeIOMode ioexception IOExceptionioesetlocationioeSetLocation ioesethandle ioeSetHandleioesetfilename'ioeSetFileNameioeseterrortypePioeSetErrorTypeioeseterrorstring|ioeSetErrorString ioerrortype IOErrorTypeioerrorsioErrorsioerrorIOErrorioErrorioegetlocationioeGetLocation ioegethandle> ioeGetHandleioegetfilenamedioeGetFileNameioegeterrortypeioeGetErrorTypeioegeterrorstringioeGetErrorStringioIO) inttodigit intToDigitintrepIntRep intptrtoptr1 intPtrToPtrintptrNIntPtr interspersek intersperse intersectby intersectBy intersect intersect internals Internals( intercalate intercalateinteract interactintegral*IntegralintegerEInteger intconstra IntConstrint8zInt8int64Int64int32Int32int16Int16intInt' instances Instances%&insertbyinsertByinsert2insertinrangeOinRangeinreInrinlwInlinitsinits initialquote InitialQuoteinitinitinfoInfo$infixInfixindexoutofboundsIndexOutOfBounds indexconstr9 indexConstrindexUindeximagpartnimagPartillegaloperationerrortypeillegalOperationErrorTypeidentIdentidid hwaitforinput hWaitForInputhtellhTellhslex/hsLexhshowEhShowhsetposn^hSetPosn hsetfilesize~ hSetFileSizehsetechohSetEcho hsetbuffering hSetBufferinghsetbinarymodehSetBinaryModehseekhSeekhreadyhReady hputstrln7 hPutStrLnhputstrShPutStrhputcharnhPutCharhputbufnonblockinghPutBufNonBlockinghputbufhPutBuf hprintftype HPrintfTypehprintfhPrintfhprinthPrint hlookahead* hLookAhead hiswritableK hIsWritablehisterminaldeviceshIsTerminalDevice hisseekable hIsSeekable hisreadable hIsReadablehisopenhIsOpenhiseofhIsEOF hisclosed hIsClosedhgetposn,hGetPosnhgetlineHhGetLinehgetechodhGetEcho hgetcontents hGetContentshgetcharhGetCharhgetbufnonblockinghGetBufNonBlocking hgetbuffering hGetBufferinghgetbufhGetBufhflush.hFlush hfilesizeI hFileSize heapoverflowj HeapOverflowheadheadhclosehClose hasresolution HasResolution hashunique hashUnique hashtable HashTable# hashstring$ hashStringhashstablenameHhashStableNamehashintihashInt~ handleposn HandlePosn} handlejust handleJust|handleHandlezhandle{ gzipwitht gzipWithT gzipwithq gzipWithQ gzipwithm% gzipWithMgzip>gzipgunfoldUgunfoldguardmguardy gtypecount gtypecountgtGTxgsizegsizegshowgshowgroupbygroupBywgroup groupvgread greadgq* GQ gnodecountB  gnodecountgmapt] gmapTgmapqrt gmapQrgmapql gmapQlgmapqi gmapQigmapq gmapQgmapmp gmapMpgmapmo gmapMogmapm!gmapM~ gmapaccumt! gmapAccumT} gmapaccumqr=! gmapAccumQr| gmapaccumql_! gmapAccumQl{ gmapaccumq! gmapAccumQz gmapaccumm! gmapAccumMygm!GMxglength!glengthw gfoldlaccum! gfoldlAccumvgfoldl"gfoldlu gfindtype#" gfindtypet getziplistB" getZipListugetuncaughtexceptionhandlers"getUncaughtExceptionHandlertgetsum"getSums getprogname" getProgNamer getproduct" getProductqgetopt'"getOpt'sgetopt#GetOpt"getOptrgetline9#getLinepgetlastW#getLastogetfirstr#getFirstngeterrno#getErrnoqgetenvironment#getEnvironmentmgetenv#getEnvlgetecho#getEchopgetdual$getDualk getcputime $ getCPUTimej getcontentsA$ getContentsigetconstd$getConsthgetchar$getCharggetchancontents$getChanContentsogetargs$getArgsfgetany$getAnyegetall$getAlldget_console_echo%get_console_echonget9%getlmgeqO%geqk generictakei% genericTakec generict'% GenericT'jgenerict%GenericTigenericsplitat%genericSplitAtbgenerics%Generics!genericreplicate&genericReplicateagenericr2&GenericRh genericq'O& GenericQ'ggenericql&GenericQf genericm'& GenericM'egenericm&GenericMd genericlength& genericLength` genericindex& genericIndex_ genericdrop' genericDrop^genericb.'GenericBcgeneric'J'Generic'abgenerici'Generic`generalcategory'GeneralCategory\generalCategory]gdepth'gdepth_gcount'gcount^gcd'gcdgcast2(gcast2[gcast1(gcast1Zgcast2(gcastYgatherI(gather] funresulttyf( funResultTyXfunptr(FunPtrWfunctor(FunctorV\ functions( Functions function(Function fullerrortype( fullErrorType[fst)fstU fromstring7) fromStringT fromrationalY) fromRationalfromratx)fromRat frommaybe) fromMaybeSfromlist)fromListRfromjust)fromJustQ fromintegral) fromIntegral frominteger* fromIntegerfromenum/*fromEnum fromdynamicN* fromDynamicPfromdynl*fromDynO fromconstrm* fromConstrMZ fromconstrb* fromConstrBY fromconstr* fromConstrXfrombool*fromBoolW freestableptr + freeStablePtrNfreepool-+freePoolVfreehaskellfunptrR+freeHaskellFunPtrM freedirenty+ freeDirEntUfree+freeT fractional+ Fractionalformat+FormatLform_+forM_JKform+forMHIforkos,forkOSGforkio+,forkIOFforeverD,foreverE foreignptra, ForeignPtrDforeign,Foreignfor_,for_Cfor,forBfoldrm,foldrMAfoldr1,foldr1?@foldr',foldr'>foldr-foldr<=foldmapdefault7-foldMapDefault;foldmapX-foldMap:foldm_q-foldM_9foldm-foldM8foldlm-foldlM7foldl1'-foldl1'6foldl1-foldl145foldl'-foldl'23foldl .foldl01foldable-.Foldable/foldI.fold. fmapdefaultd. fmapDefault-fmap.fmap,Sfloor.floor floattodigits. floatToDigitsfloatrep.FloatRepR floatrange. floatRange floatradix/ floatRadixfloating7/Floating floatdigitsV/ floatDigits floatconstrx/ FloatConstrQfloat/Floatflip/flip+fixst/fixSTPfixity/FixityOfixio/fixIO*fixed 0Fixed)fix"0Fixfix(NfirstC0First%&first' findindicesn0 findIndices$ findindex0 findIndex#find0find!" finalquote0 FinalQuote finally0finally finalizerptr1 FinalizerPtr finalizerfree&1 finalizerFreeMfinalizerenvptrN1FinalizerEnvPtrfinalizeforeignptr{1finalizeForeignPtrfinalize1finalizeLfilterm1filterMfilter1filterfiletype1fileTypeKfilepath2FilePath fileoffset12 FileOffsetJfilemodeO2FileModeIfileidi2FileIDHfdtype2FDTypeFfdTypeGfdstat2fdStatEfdistty2fdIsTTYD fdgetmode2 fdGetModeC fdfilesize2 fdFileSizeBfd3Fd@Afalse(3FalsefailA3fail?extt]3extT>extrq3extR=extq3extQ<extmp3extMp;extm3extM:extb3extB9ext1t3ext1T8ext1r3ext1R7ext1q4ext1Q6ext1m4ext1M5ext0/4ext04exponentG4exponentexp^4expexitwithu4exitWith exitsuccess4 ExitSuccess exitfailure4 ExitFailure exitFailure exitexception4 ExitExceptionexitcode 5ExitCodeexit$5Exit exception=5 Exception everywherema5 everywhereM3 everywherebut5 everywhereBut2 everywhere'5 everywhere'1 everywhere5 everywhere0 everything5 everything/evaluate6evaluate errorcalls&6 errorCalls errorcallE6 ErrorCall error_6Errorerrorerrnotoioerror6errnoToIOError.errno6Errno,-eq6EQ Eq  epochtime6 EpochTime+ eoferrortype7 eofErrorType*eof.7EOF ) environmentL7 Environment enumfromtom7 enumFromToenumfromthento7enumFromThenTo enumfromthen7 enumFromThenenumfrom7enumFromenum7Enumendo8Endo endby18endBy1(endby48endBy' end_of_dirO8 end_of_dir& encodefloatp8 encodeFloat enclosingmark8 EnclosingMarkemptysamplevar8emptySampleVar%empty8empty elemindices8 elemIndices elemindex9 elemIndexelem/9elemeitherM9Eithereithere6y9E6e2big9e2BIG$e129E12 dyntyperep9 dynTypeRep dynexceptions9 dynExceptions dynexception: DynExceptiondynapply!:dynApplydynapp;:dynAppdynamicT:Dynamicdupchanr:dupChan#dual:Dual dropwhile: dropWhiledrop:dropdouble:Doubledoesnotexisterrortype;doesNotExistErrorType"divmod',;divMod'divmodE;divMod dividebyzeroc; DivideByZerodiv';div'div;div directory; Directory! digittoint; digitToIntdeviceid;DeviceID  derefweak< deRefWeakderefstableptr'<deRefStablePtrdenormalI<Denormal denominatorh< denominatordeletefirstsby<deleteFirstsBydeleteby<deleteBydelete<delete decodefloat< decodeFloat decimalnumber= DecimalNumberdeadlock/=Deadlock datatyperepN= dataTypeRep datatypeofo= dataTypeOf datatypename= dataTypeNamedatatypeconstrs=dataTypeConstrsdatatype=DataTypedatarep=DataRep datacast2> dataCast2 datacast10> dataCast1dataI>Datadashpunctuationh>DashPunctuationd_name>d_namecycle>cycle cwstringlen> CWStringLencwstring>CWStringcwchar>CWcharcutsname?CUtsnamecutimbuf/?CUtimbufcushortJ?CUShortcurryb?currycurrencysymbol?CurrencySymbolculong?CULongcullong?CULLong cuintptr?CUIntPtr cuintmax?CUIntMax cuint@CUInt cuchar%@CUChar ctms;@CTmsctmN@CTmctimeb@CTimectermios{@CTermios cstringlen@ CStringLencstring@CStringcstat@CStatcssize@CSsizecsize@CSizecsigsetACSigset csigatomic1A CSigAtomic csigactionQA CSigactioncshortmACShortcscharACSCharcputimeprecisionAcpuTimePrecisioncputimeACPUTimecptrdiffACPtrdiffcpidACPidcpasswdBCPasswdcount,BcountcoshABcoshcosTBcos copybyteslB copyBytes copyarrayB copyArraycontrolBControl constrtypeB constrType constrrepB ConstrRep constrRep constrindexC constrIndex constrfixity4C constrFixity constrfieldsXC constrFieldsconstrvCConstr const_vtimeC const_vtime const_vminC const_vmin const_tcsanowC const_tcsanow const_sigttouC const_sigttouconst_sig_setmask'Dconst_sig_setmaskconst_sig_blockSDconst_sig_block const_icanonzD const_icanon const_f_setflD const_f_setfl const_f_getflD const_f_getfl const_echoD const_echoconstEConstconstconnectorpunctuation;EConnectorPunctuation conjugatedE conjugateconindexEConIndex concurrentE Concurrent concatmapE concatMapconcatEconcatcomplexFComplex  complementbit*F complementBit complementMF complementcompilerversionrFcompilerVersion compilernameF compilerName comparingF comparingcompareFcomparecoffFCOffcoerceGCoerce cmodeGCModeclosepunctuation?GClosePunctuationclosefdbGcloseFdclongzGCLong clocktickG ClockTickcllongGCLLongclearbitGclearBitcldoubleGCLDoubleclconvGCLconvcjmpbufHCJmpBufcis.HciscintptrDHCIntPtrcintmax^HCIntMaxcintuHCIntcinoHCInochrHchrchoiceqHchoiceQchoicempHchoiceMpchoiceHchoicecharisrepresentableIcharIsRepresentablechar3IChar charchanaIChan chainr1|Ichainr1chainrIchainrchainl1Ichainl1chainlIchainlcgroupICGroupcfposICFposcflock JCFLockcfloat%JCFloatcfile> Z^>>^<<Z^<<^.Z^q\\=Z\\>>^NZ>>^>>>`Z>>>~>>=rZ>>=p}>>Z>>o|>=>Z>=>{>=Z>=nz>Z>my==Z==lx=<[<|>v<=<[<=<u<=)[<=jt<<^>[<<^s<<b[<+>q<++t[<++<*>[<*>p<**>[<**>o<*[<*n<$>[<$>m<$[<$l<[<ik:+:[:+:j:+\:+i:*:\:*:gh/=+\/=hf/>\/g.|.N\.|.e.&.`\.&.d.p\.fc-\-e+++\+++b++\++da+\+c*>\*>`***\***_**\**b*\*a&&&]&&&^&&]&&`]%2]%\$!A]$!_$P]$^[!!c]!!]Zy+}%(L<9RVuFgX M az4QRv(Snf :bѷG}`J ãƢfJp Þ\k"%IǙ7ʗi(2-ʎ҄NCƀ D~~/}|0|{zxqw{u tDsrm_mlIlkk&ji;ih`h&hgeeWdcbba}_^t^\[QZ`YX-XWWVVU)TRQ QnP2POUONMJMLK\HFfFE|EEDDCB+BWA@?<b<;$;:99V8p76'654220A0/.:.*$*) )(i('i'=&#2#R""!OOXuNE    X  9 n V<hurL~! 0q:U >~8'+rd+:Eh(c~bj]m  -XFo~b4ǫ5Kܦ  z 1X֠F6~w(>͒8mN֊kՁ_U`~~}n|{zyxxwwts_srq7qp.nmlkzhNg1f5e%d`_^2\T$TESRQkPNMKB@=<K:9X98o87w76^54E43w21?1H0/.r.=.-z--,+*)j)|((X'%$#"8" +pA7M*AX.!  e   0   P FOf(qX 0>Qc-<~/wO`/z+SܺdұNvȭfC<hEڣ;ۢSzv &Ėhl̓@a}}zKxmw:trmmjiigZgffe{e da``]]#[|YXtWUSaR_ONMKKJsG GFEiEDCwCB1BA_A??T=<;;::=:9827x54O32;2%1j.-d-y,+O+*)v('&-&%<%7$##)" Q*#RQ4      E WvkDBktd+Py{{=a%Y .=Z UC'Dx"g;)<Uٵc}/{֫"Uݧ 9uͤ{Y)~t-ڈlŅq܃;@~*~}C}||j{zwzlxoq6qo0onnmljVji+ihJhgfJfdddcc5bdXWVUTTGSRQPPOwNNLLKKJJHRGE EaDCCJBAaA@??>t>>=U<A:775432&210+0/.--,+***)P! ( Thp/     .ZFOR~)8ea8~k0nLʾ̼>ַ>`I(*~qܪʩ0?¤$+UP[třaMȒMhmZ0.;+~m}z|z yts~s1srrMrq0qspo{o6onmZmmillj{jni~h`g"fdIc3baM`^U][YWVUgUTTpSsRdQPRPLKJCJIGFEvCBA*@v??===<.<;_;:w::9'9887k76K65954H433+32q221,10'0c/.P*))[)()((%(''%'&6%U$"!E! T W%l g;Rv(Bid6E}ez A   =   %   X #  p=f2r7:K*<Ahiqx>Y2M%j>Uhjwh=+Q!M {@z' Gr+Xܾ|ݽNHd ѷ Do:-9bXN=ک))5ܤ&EҠN3Ϝ)} '1rkmps/xÆ<e/A~}}j}||{){zzy`wRvmusCsryqponml`lkjkjiXihMhfse9dcbaaw`_U^t\H[VZY-YXTQTP@ONMLJIHGEE|CAZ@><>==<4<;:::99R9988T8877Z76o543 3j20/S/.-/-|,+*V**)(''U&X%$L#]"N!  R 5@:EV&^(     P A*"kc W"*7 p >up.P)Z^0 [ |#]FoW:\͹x Lj2ʰZ ?ԥSբM̡#wU505Iq|{\Յ܄F(lXv|?{y/yx7 unsafeIOToST unsafeIOToST :: IO a -> ST s a+yyIOaSTsa7unsafeInterleaveSTunsafeInterleaveST :: ST s a -> ST s ayySTsaSTsa7stToIOstToIO :: ST RealWorld a -> IO azyST RealWorldaIOa%A monad transformer embedding lazy state transformers in the IO monad. The RealWorld parameter indicates that the internal state used by the ST computation is a special one supplied by the IO monad, and thus distinct from those used by invocations of runST. 7strictToLazySTstrictToLazyST :: ST s a -> ST s a{{STsaSTsaConvert a strict ST computation into a lazy one. The strict state thread passed to strictToLazyST is not performed until the result of the lazy state thread it returns is demanded. 7STdata ST s a|The lazy state-transformer monad. A computation of type ST s a transforms an internal state indexed by s, and returns a value of type a. The s parameter is either
  • an unstantiated type variable (inside invocations of runST), or
  • RealWorld (inside invocations of stToIO).
It serves to keep the internal states of different invocations of runST separate from each other and from invocations of stToIO. The >>= and >> operations are not strict in the state. For example,
runST (writeSTRef _|_ v >>= readSTRef _|_ >> return 2) = 2
7runSTrunST :: ST s a -> aSTsaaReturn the value computed by a state transformer computation. The forall ensures that the internal state used by the ST computation is inaccessible to the rest of the program. 7lazyToStrictSTlazyToStrictST :: ST s a -> ST s a܀STsaSTsa8Convert a lazy ST computation into a strict one. 7fixSTfixST ::  (a -> ST s a) -> ST s abaSTsaSTsaAllow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixST f = _|_. F writeSTRef writeSTRef ::  STRef s a -> a -> ST s ()STRefsaaSTs()1writeSampleVarwriteSampleVar ::  SampleVar a -> a -> IO ()2 SampleVaraaIO()XWrite a value into the SampleVar, overwriting any previous value that was there. .writeList2ChanwriteList2Chan :: Chan a -> [a] -> IO ()Chana[]aIO()0Write an entire list of items to a Chan. . writeChan writeChan :: Chan a -> a -> IO ()ChanaaIO() Write a value to a Chan. OwithPoolwithPool :: (Pool -> IO b) -> IO bH+PoolIObIObExecute an action with a fresh memory pool, which gets automatically deallocated (including its contents) after the action has finished. -withMVarwithMVar :: MVar a ->  (a -> IO b) -> IO bX3MVaraaIObIObPwithMany withMany :: (a -> (b -> res) -> res) -> [a] ->  ([b] -> res) -> resۆabresres[]a[]bresresgReplicates a withXXX combinator over a list of objects, yielding a list of marshalled objects withCWStringLenwithCWStringLen :: String -> (CWStringLen -> IO a) -> IO aString CWStringLenIOaIOa[Marshal a Haskell string into a NUL terminated C wide string using temporary storage.
  • the Haskell string may not contain any NUL characters
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
 withCWString withCWString :: String -> (CWString -> IO a) -> IO aStringCWStringIOaIOa[Marshal a Haskell string into a NUL terminated C wide string using temporary storage.
  • the Haskell string may not contain any NUL characters
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
withCStringLenwithCStringLen :: String -> (CStringLen -> IO a) -> IO aString CStringLenIOaIOa6Marshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
 withCString withCString :: String -> (CString -> IO a) -> IO aۍStringCStringIOaIOaVMarshal a Haskell string into a NUL terminated C string using temporary storage.
  • the Haskell string may not contain any NUL characters
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
withCAStringLenwithCAStringLen :: String -> (CStringLen -> IO a) -> IO aՏString CStringLenIOaIOa6Marshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
 withCAString withCAString :: String -> (CString -> IO a) -> IO a{StringCStringIOaIOaVMarshal a Haskell string into a NUL terminated C string using temporary storage.
  • the Haskell string may not contain any NUL characters
  • the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
 withArrayLen0  withArrayLen0 :: Storable a => a -> [a] -> (Int -> Ptr a -> IO b) -> IO bɓStorableaa[]aIntPtraIObIObJLike withArrayLen, but a terminator indicates where the array ends  withArrayLen withArrayLen :: Storable a => [a] -> (Int -> Ptr a -> IO b) -> IO bєStorablea[]aIntPtraIObIOb[Like withArray, but the action gets the number of values as an additional parameter  withArray0  withArray0 :: Storable a => a -> [a] -> (Ptr a -> IO b) -> IO bStorableaa[]aPtraIObIObGLike withArray, but a terminator indicates where the array ends  withArray withArray :: Storable a => [a] -> (Ptr a -> IO b) -> IO bݖStorablea[]aPtraIObIObtTemporarily store a list of storable values in memory (like Foreign.Marshal.Utils.with, but for multiple elements). Pwithwith :: Storable a => a -> (Ptr a -> IO b) -> IO bStorableaaPtraIObIObwith val f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory into which val has been marshalled (the combination of alloca and poke). The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this. YWeakdata Weak v~A weak pointer object with a key and a value. The value has type v. A weak pointer expresses a relationship between two objects, the key and the value: if the key is considered to be alive by the garbage collector, then the value is also alive. A reference from the value to the key does not keep the key alive. A weak pointer may also have a finalizer of type IO (); if it does, then the finalizer will be run at most once, at a time after the key has become unreachable by the program ("dead"). The storage manager attempts to run the finalizer(s) for an object soon after the object dies, but promptness is not guaranteed. It is not guaranteed that a finalizer will eventually run, and no attempt is made to run outstanding finalizers when the program exits. Therefore finalizers should not be relied on to clean up resources - other methods (eg. exception handlers) should be employed, possibly in addition to finalisers. References from the finalizer to the key are treated in the same way as references from the value to the key: they do not keep the key alive. A finalizer may therefore ressurrect the key, perhaps by storing it in the same data structure. The finalizer, and the relationship between the key and the value, exist regardless of whether the program keeps a reference to the Weak object or not. There may be multiple weak pointers with the same key. In this case, the finalizers for each of these weak pointers will all be run in some arbitrary order, or perhaps concurrently, when the key dies. If the programmer specifies a finalizer that assumes it has the only reference to an object (for example, a file that it wishes to close), then the programmer must ensure that there is only one such finalizer. If there are no other threads to run, the runtime system will check for runnable finalizers before declaring the system to be deadlocked. 0 waitQSemN waitQSemN :: QSemN -> Int -> IO (){QSemNIntIO()4Wait for the specified quantity to become available /waitQSemwaitQSem :: QSem -> IO ()%QSemIO()$Wait for a unit to become available Nvoidvoid :: IO a -> IO ()IOaIO()0Discard the return value of an IO action  userErrorType userErrorType ::  IOErrorType) IOErrorType&I/O error that is programmer-defined.  userError userError :: String -> IOErrorStringIOErrorConstruct an IOError value with a string describing the error. The fail method of the IO instance of the Monad class raises a userError, thus:
instance Monad IO where 
  ...
  fail s = ioError (userError s)
R usageInfo usageInfo :: String ->  [OptDescr a] -> StringBString[]OptDescraStringReturn a string describing the usage of a command, derived from the header (first argument) and the options described by the second argument. 6 unsafeSTToIO unsafeSTToIO :: ST s a -> IO a;#STsaIOa3unsafePerformIOunsafePerformIO :: IO a -> aIOaaThis is the "back door" into the IO monad, allowing IO computation to be performed at any time. For this to be safe, the IO computation should be free of side effects and independent of its environment. If the I/O computation wrapped in unsafePerformIO performs side effects, then the relative order in which those side effects take place (relative to the main I/O trunk, or other calls to unsafePerformIO) is indeterminate. You have to be careful when writing and compiling modules that use unsafePerformIO:
  • Use {-# NOINLINE foo #-} as a pragma on any function foo that calls unsafePerformIO. If the call is inlined, the I/O may be performed more than once.
  • Use the compiler flag -fno-cse to prevent common sub-expression elimination being performed on the module, which might combine two side effects that were meant to be separate. A good example is using multiple global variables (like test in the example below).
  • Make sure that the either you switch off let-floating, or that the call to unsafePerformIO cannot float outside a lambda. For example, if you say: f x = unsafePerformIO (newIORef []) you may get only one reference cell shared between all calls to f. Better would be f x = unsafePerformIO (newIORef [x]) because now it can't float outside the lambda.
It is less well known that unsafePerformIO is not type safe. For example:
test :: IORef [a]
test = unsafePerformIO $ newIORef []

main = do
	      writeIORef test [42]
	      bang <- readIORef test
	      print (bang :: [Char])
This program will core dump. This problem with polymorphic references is well known in the ML community, and does not arise with normal monadic use of references. There is no easy way to make it impossible once you use unsafePerformIO. Indeed, it is possible to write coerce :: a -> b with the help of unsafePerformIO. So be careful! 6 unsafeIOToST unsafeIOToST :: IO a -> ST s aIOaSTsa6unsafeInterleaveSTunsafeInterleaveST :: ST s a -> ST s ahSTsaSTsa3unsafeInterleaveIOunsafeInterleaveIO :: IO a -> IO aIOaIOaunGTunGT ::  GenericT' -> Data aV= GenericT'DataaunGQunGQ ::  GenericQ' r ->  GenericQ rư GenericQ'rGenericQrunGMunGM ::  GenericM' m -> Data a. GenericM'mDataa. unGetChan unGetChan :: Chan a -> a -> IO ()ChanaaIO()JPut a data item back onto a channel, where it will be the next item read.  unGeneric' unGeneric' ::  Generic' c ->  Generic cfFGeneric'cGenericc tyconUQname tyconUQname :: String -> String̲StringStringAGets the unqualified type constructor: drop *.*.*... before name  tyconModule tyconModule :: String -> Strings`StringStringAGets the module of a type constructor: take *.*.*... before name - tryTakeMVar tryTakeMVar :: MVar a ->  IO (Maybe a)- MVaraIOMaybeaA non-blocking version of takeMVar. The tryTakeMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a. After tryTakeMVar, the MVar is left empty. - tryPutMVar tryPutMVar :: MVar a -> a -> IO BoolĵMVaraaIOBoolA non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise. trytry :: IO a -> IO (Either IOError a)߶IOaIOEitherIOErroraThe construct try comp exposes IO errors which occur within a computation, and which are not fully handled. Non-I/O exceptions are not caught by this variant; to catch all exceptions, use Control.Exception.try from Control.Exception. toConstrtoConstr ::  Data a => a -> Constrt[DataaaConstrPtoBooltoBool ::  Num a => a -> BoolոNumaaBool?Convert a Boolean in numeric representation to a Haskell value N throwIfNull throwIfNull :: String ->  IO (Ptr a) ->  IO (Ptr a)StringIOPtraIOPtraGuards against null pointers N throwIfNeg_ throwIfNeg_ :: (Ord a, Num a) =>  (a -> String) -> IO a -> IO (){DOrdaNumaaStringIOaIO()2Like throwIfNeg, but discarding the result N throwIfNeg throwIfNeg :: (Ord a, Num a) =>  (a -> String) -> IO a -> IO a[%OrdaNumaaStringIOaIOa&Guards against negative result values NthrowIf_ throwIf_ ::  (a -> Bool) ->  (a -> String) -> IO a -> IO ())aBoolaStringIOaIO()/Like throwIf, but discarding the result NthrowIfthrowIf :: a -> Bool -> a -> String -> IO a -> IO aۼaBoolaStringIOaIOaExecute an IO action, throwing a userError if the predicate yields True when applied to the result returned by the IO action. If no exception is raised, return the result of the computation. MthrowErrnoPathIfNull throwErrnoPathIfNull :: String -> FilePath ->  IO (Ptr a) ->  IO (Ptr a)rStringFilePathIOPtraIOPtraTas throwErrnoIfNull, but exceptions include the given path when appropriate. MthrowErrnoPathIfMinus1_ throwErrnoPathIfMinus1_ ::  Num a => String -> FilePath -> IO a -> IO ()ĿNumaStringFilePathIOaIO()Was throwErrnoIfMinus1_, but exceptions include the given path when appropriate. MthrowErrnoPathIfMinus1 throwErrnoPathIfMinus1 ::  Num a => String -> FilePath -> IO a -> IO aNumaStringFilePathIOaIOaVas throwErrnoIfMinus1, but exceptions include the given path when appropriate. MthrowErrnoPathIf_ throwErrnoPathIf_ ::  (a -> Bool) -> String -> FilePath -> IO a -> IO ()aBoolStringFilePathIOaIO()Qas throwErrnoIf_, but exceptions include the given path when appropriate. MthrowErrnoPathIf throwErrnoPathIf ::  (a -> Bool) -> String -> FilePath -> IO a -> IO aaBoolStringFilePathIOaIOaPas throwErrnoIf, but exceptions include the given path when appropriate. MthrowErrnoPaththrowErrnoPath :: String -> FilePath -> IO aStringFilePathIOaNas throwErrno, but exceptions include the given path when appropriate. MthrowErrnoIfRetryMayBlock_ throwErrnoIfRetryMayBlock_ ::  (a -> Bool) -> String -> IO a -> IO b -> IO ()aBoolStringIOaIObIO()>as throwErrnoIfRetryMayBlock, but discards the result. MthrowErrnoIfRetryMayBlockthrowErrnoIfRetryMayBlock :: a -> Bool -> String -> IO a -> IO b -> IO a2aBoolStringIOaIObIOaas throwErrnoIfRetry, but checks for operations that would block and executes an alternative action before retrying in that case. MthrowErrnoIfRetry_ throwErrnoIfRetry_ ::  (a -> Bool) -> String -> IO a -> IO ()kBaBoolStringIOaIO()6as throwErrnoIfRetry, but discards the result. MthrowErrnoIfRetry throwErrnoIfRetry ::  (a -> Bool) -> String -> IO a -> IO aM%aBoolStringIOaIOaas throwErrnoIf, but retry the IO action when it yields the error code eINTR - this amounts to the standard retry loop for interrupted POSIX system calls. MthrowErrnoIfNullRetryMayBlock throwErrnoIfNullRetryMayBlock :: String ->  IO (Ptr a) -> IO b ->  IO (Ptr a)StringIOPtraIObIOPtraMas throwErrnoIfNullRetry, but checks for operations that would block. MthrowErrnoIfNullRetrythrowErrnoIfNullRetry :: String ->  IO (Ptr a) ->  IO (Ptr a)StringIOPtraIOPtraThrow an IOError corresponding to the current value of getErrno if the IO action returns nullPtr, but retry in case of an interrupted operation. MthrowErrnoIfNullthrowErrnoIfNull :: String ->  IO (Ptr a) ->  IO (Ptr a)StringIOPtraIOPtra~Throw an IOError corresponding to the current value of getErrno if the IO action returns nullPtr. M throwErrnoIfMinus1RetryMayBlock_  throwErrnoIfMinus1RetryMayBlock_ ::  Num a => String -> IO a -> IO b -> IO ()n=NumaStringIOaIObIO()Das throwErrnoIfMinus1RetryMayBlock, but discards the result. MthrowErrnoIfMinus1RetryMayBlock throwErrnoIfMinus1RetryMayBlock ::  Num a => String -> IO a -> IO b -> IO aTNumaStringIOaIObIOaOas throwErrnoIfMinus1Retry, but checks for operations that would block. MthrowErrnoIfMinus1Retry_throwErrnoIfMinus1Retry_ ::  Num a => String -> IO a -> IO ()XNumaStringIOaIO()7as throwErrnoIfMinus1, but discards the result. MthrowErrnoIfMinus1RetrythrowErrnoIfMinus1Retry ::  Num a => String -> IO a -> IO a`9NumaStringIOaIOaThrow an IOError corresponding to the current value of getErrno if the IO action returns a result of -1, but retries in case of an interrupted operation. MthrowErrnoIfMinus1_throwErrnoIfMinus1_ ::  Num a => String -> IO a -> IO ()NumaStringIOaIO()7as throwErrnoIfMinus1, but discards the result. MthrowErrnoIfMinus1throwErrnoIfMinus1 ::  Num a => String -> IO a -> IO ajNumaStringIOaIOaThrow an IOError corresponding to the current value of getErrno if the IO action returns a result of -1. M throwErrnoIf_  throwErrnoIf_ ::  (a -> Bool) -> String -> IO a -> IO ()aBoolStringIOaIO()^as throwErrnoIf, but discards the result of the IO action after error handling. M throwErrnoIf  throwErrnoIf :: a -> Bool -> String -> IO a -> IO aaBoolStringIOaIOaThrow an IOError corresponding to the current value of getErrno if the result value of the IO action meets the given predicate. M throwErrno throwErrno :: String -> IO aStringIOaOThrow an IOError corresponding to the current value of getErrno. -takeMVartakeMVar :: MVar a -> IO akTMVaraIOaReturn the contents of the MVar. If the MVar is currently empty, takeMVar will wait until it is full. After a takeMVar, the MVar is left empty. There are two further important properties of takeMVar:
  • takeMVar is single-wakeup. That is, if there are multiple threads blocked in takeMVar, and the MVar becomes full, only one thread will be woken up. The runtime guarantees that the woken thread completes its takeMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
 synthesize  synthesize :: s ->  (t -> s -> s) -> GenericQ (s -> t) ->  GenericQ tstssGenericQstGenericQtBottom-up synthesis of a data structure; 1st argument z is the initial element for the synthesis; 2nd argument o is for reduction of results from subterms; 3rd argument f updates the synthesised data according to the given term "SymbolSymbol :: String -> Lexeme&StringLexeme4Haskell symbol, e.g. >>, :% -swapMVarswapMVar :: MVar a -> a -> IO aMVaraaIOaTake a value from an MVar, put a new value into the MVar and return the value taken. Note that there is a race condition whereby another process can put something in the MVar after the take happens but before the put does. 6stToIOstToIO :: ST RealWorld a -> IO a/ST RealWorldaIOa'A monad transformer embedding strict state transformers in the IO monad. The RealWorld parameter indicates that the internal state used by the ST computation is a special one supplied by the IO monad, and thus distinct from those used by invocations of runST.  StringRep StringRep :: DataRepDataRep StringConstr StringConstr :: String ->  ConstrRep String ConstrRep stringstring :: String ->  ReadP Stringw[StringReadPString)Parses and returns the specified string. "StringString :: String -> LexemeStringLexeme)String literal, with escapes interpreted FSTRefdata STRef s aW{a value of type STRef s a is a mutable variable in state thread s, containing a value of type a StreamStream :: FDType FDType#stepstep ::  ReadPrec a ->  ReadPrec a_ReadPrecaReadPreca)Increases the precedence context by one. X StableNamedata  StableName aiAn abstract name for an object, that supports equality and hashing. Stable names have the following property:
  • If sn1 :: StableName and sn2 :: StableName and sn1 == sn2 then sn1 and sn2 were created by calls to makeStableName on the same object.
The reverse is not necessarily true: if two stable names are not equal, then the objects they name may still be equal. Note in particular that mkStableName may return a different StableName after an object is evaluated. Stable Names are similar to Stable Pointers (Foreign.StablePtr), but differ in the following ways:
  • There is no freeStableName operation, unlike Foreign.StablePtrs. Stable names are reclaimed by the runtime system when they are no longer needed.
  • There is no deRefStableName operation. You can't get back from a stable name to the original Haskell object. The reason for this is that the existence of a stable name for an object does not guarantee the existence of the object itself; it can still be garbage collected.
st_sizest_size ::  Ptr CStat -> IO Int64PtrCStatIOInt64st_mtimest_mtime ::  Ptr CStat -> IO CTime* PtrCStatIOCTimest_modest_mode ::  Ptr CStat -> IO CModezPtrCStatIOCModest_inost_ino ::  Ptr CStat -> IO CInoPtrCStatIOCInost_devst_dev ::  Ptr CStat -> IO CDevlOPtrCStatIOCDev6STdata ST s aThe strict state-transformer monad. A computation of type ST s a transforms an internal state indexed by s, and returns a value of type a. The s parameter is either
  • an uninstantiated type variable (inside invocations of runST), or
  • RealWorld (inside invocations of Control.Monad.ST.stToIO).
It serves to keep the internal states of different invocations of runST separate from each other and from invocations of Control.Monad.ST.stToIO. The >>= and >> operations are strict in the state (though not in values stored in the state). For example,
runST (writeSTRef _|_ v >>= f) = _|_
 somewhere somewhere :: MonadPlus m =>  GenericM m ->  GenericM m MonadPlusmGenericMmGenericMm2Apply a monadic transformation at least somewhere  something something :: GenericQ (Maybe u) -> GenericQ (Maybe u)GenericQMaybeuGenericQMaybeu3Look up a subterm by means of a maybe-typed filter  skipSpaces skipSpaces :: ReadP ()VHReadP()Skips all whitespace.  skipMany1 skipMany1 :: ReadP a -> ReadP ()ReadPaReadP(),Like many1, but discards the result.  skipManyskipMany :: ReadP a -> ReadP ()rVReadPaReadP()+Like many, but discards the result.  sizeof_stat sizeof_stat :: IntInt0 signalQSemN signalQSemN :: QSemN -> Int -> IO ()ZAQSemNIntIO()ESignal that a given quantity is now available from the QSemN. / signalQSem signalQSem :: QSem -> IO ()QSemIO()3Signal that a unit of the QSem is available  showConstr showConstr :: Constr -> StringConstrString"Gets the string for a constructor setEchosetEcho :: FD -> Bool -> IO ()&FDBoolIO() setCooked setCooked :: FD -> Bool -> IO ()FDBoolIO()set_console_echoset_console_echo :: CInt -> CInt -> IO CIntCIntCIntIOCIntset_console_bufferingset_console_buffering :: CInt -> CInt -> IO CIntCIntCIntIOCInt sepBy1sepBy1 :: ReadP a ->  ReadP sep ->  ReadP [a]@ReadPaReadPsepReadP[]asepBy1 p sep parses one or more occurrences of p, separated by sep. Returns a list of values returned by p.  sepBysepBy :: ReadP a ->  ReadP sep ->  ReadP [a]_0ReadPaReadPsepReadP[]asepBy p sep parses zero or more occurrences of p, separated by sep. Returns a list of values returned by p.  satisfysatisfy :: (Char -> Bool) ->  ReadP CharfFCharBoolReadPCharRConsumes and returns the next character, if it satisfies the specified predicate. 1 SampleVartype  SampleVar a = MVar (Int, MVar a)LSample variables are slightly different from a normal MVar:
  • Reading an empty SampleVar causes the reader to block. (same as takeMVar on empty MVar)
  • Reading a filled SampleVar empties it and returns value. (same as takeMVar)
  • Writing to an empty SampleVar fills it with a value, and potentially, wakes up a blocked reader (same as for putMVar on empty MVar).
  • Writing to a filled SampleVar overwrites the current value. (different from putMVar on full MVar.)
s_issocks_issock :: CMode -> BoolCModeBools_isregs_isreg :: CMode -> BoolCModeBools_isfifos_isfifo :: CMode -> Bool_OCModeBools_isdirs_isdir :: CMode -> BoolCModeBools_ischrs_ischr :: CMode -> BoolCModeBools_isblks_isblk :: CMode -> BoolgWCModeBool6runSTrunST :: ST s a -> aSTsaaReturn the value computed by a state transformer computation. The forall ensures that the internal state used by the ST computation is inaccessible to the rest of the program. R ReturnInOrder ReturnInOrder :: String -> a ->  ArgOrder aStringaArgOrderawrap non-options into options *returnreturn ::  Monad m => a -> m ajMonadmamaM resetErrno resetErrno :: IO ()IO()?Reset the current thread's errno value to eOK. #resetreset ::  ReadPrec a ->  ReadPrec a|[ReadPrecaReadPreca'Resets the precedence context to zero. R RequireOrder RequireOrder ::  ArgOrder aArgOrdera,no option processing after first non-option RReqArg ReqArg :: String -> a -> String ->  ArgDescr aStringaStringArgDescraoption requires argument  repConstr repConstr :: DataType ->  ConstrRep -> ConstrV6DataType ConstrRepConstr,Look up a constructor by its representation  RegularFile RegularFile :: FDTypeFDTyperecoverQrecoverQ :: MonadPlus m => r -> GenericQ (m r) -> GenericQ (m r)E MonadPlusmrGenericQmrGenericQmr8Recover from the failure of monadic query by a constant  recoverMp recoverMp :: MonadPlus m =>  GenericM m ->  GenericM mR! MonadPlusmGenericMmGenericMm?Recover from the failure of monadic transformation by identity  reallocBytes reallocBytes :: Ptr a -> Int ->  IO (Ptr a)PtraIntIOPtramResize a memory area that was allocated with malloc or mallocBytes to the given size. The returned pointer may refer to an entirely different memory area, but will be sufficiently aligned for any of the basic foreign types that fits into a memory block of the given size. The contents of the referenced memory area will be the same as of the original pointer up to the minimum of the original size and the given size. If the pointer argument to reallocBytes is nullPtr, reallocBytes behaves like malloc. If the requested size is 0, reallocBytes behaves like free.  reallocArray0 reallocArray0 :: Storable a => Ptr a -> Int ->  IO (Ptr a)/StorableaPtraIntIOPtraLAdjust the size of an array including an extra position for the end marker.  reallocArray reallocArray :: Storable a => Ptr a -> Int ->  IO (Ptr a)!StorableaPtraIntIOPtraAdjust the size of an array reallocrealloc :: Storable b => Ptr a ->  IO (Ptr b)StorablebPtraIOPtrbResize a memory area that was allocated with malloc or mallocBytes to the size needed to store values of type b. The returned pointer may refer to an entirely different memory area, but will be suitably aligned to hold values of type b. The contents of the referenced memory area will be the same as of the original pointer up to the minimum of the original size and the size of values of type b. If the argument to realloc is nullPtr, realloc behaves like malloc. F readSTRef readSTRef ::  STRef s a -> ST s aL . STRefsaSTsa1 readSampleVar readSampleVar ::  SampleVar a -> IO a   SampleVaraIOa?Wait for a value to become available, then take it and return. # readS_to_Prec readS_to_Prec :: (Int -> ReadS a) ->  ReadPrec a f IntReadSaReadPreca readS_to_P readS_to_P :: ReadS a -> ReadP a  ReadSaReadPaConverts a Haskell ReadS-style function into a parser. Warning: This introduces local backtracking in the resulting parser, and therefore a possible inefficiency.  ReadStype ReadS a = String -> [(a, String)]  A parser for a type a, represented as a function that takes a String and returns a list of possible parses as (a,String) pairs. Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ReadP). # readPrec_to_S readPrec_to_S ::  ReadPrec a -> Int -> ReadS a s ReadPrecaIntReadSa# readPrec_to_P readPrec_to_P ::  ReadPrec a -> Int -> ReadP a$ReadPrecaIntReadPa#ReadPrecdata ReadPrec aZ readP_to_S readP_to_S :: ReadP a -> ReadS aReadPaReadSaConverts a parser into a Haskell ReadS-style function. This is the main way in which you can "run" a ReadP parser: the expanded type is readP_to_S :: ReadP a -> String -> [(a,String)] # readP_to_Prec readP_to_Prec :: (Int -> ReadP a) ->  ReadPrec a"IntReadPaReadPreca ReadPdata ReadP aR-readMVarreadMVar :: MVar a -> IO aMVaraIOaThis is a combination of takeMVar and putMVar; ie. it takes the value from the MVar, puts it back, and also returns it. "readIntP readIntP ::  Num a => a -> (Char -> Bool) ->  (Char -> Int) -> ReadP aNumaaCharBoolCharIntReadPareaddirreaddir :: Ptr CDir -> Ptr (Ptr CDirent) -> IO CInthPtrCDirPtrPtrCDirentIOCInt"readDecPreadDecP ::  Num a => ReadP aNumaReadPa readConstr readConstr :: DataType -> String ->  Maybe ConstrbDataTypeStringMaybeConstr"Lookup a constructor via a string .readChanreadChan :: Chan a -> IO a ChanaIOa*Read the next value from the Chan.  RawDevice RawDevice :: FDType|sFDType"RatRat :: Rational -> LexemeRationalLexemeFloating point literal 0QSemNdata QSemNA QSemN is a quantity semaphore, in which the available "quantity" may be signalled or waited for in arbitrary amounts. /QSemdata QSemvA QSem is a simple quantity semaphore, in which the available "quantity" is always dealt with in units of one. -putMVarputMVar :: MVar a -> a -> IO ()MVaraaIO()Put a value into an MVar. If the MVar is currently full, putMVar will wait until it becomes empty. There are two further important properties of putMVar:
  • putMVar is single-wakeup. That is, if there are multiple threads blocked in putMVar, and the MVar becomes empty, only one thread will be woken up. The runtime guarantees that the woken thread completes its putMVar operation.
  • When multiple threads are blocked on an MVar, they are woken up in FIFO order. This is useful for providing fairness properties of abstractions built using MVars.
"PuncPunc :: String -> LexemevStringLexeme=Punctuation or reserved symbol, e.g. (, ::  ProcessIDtype  ProcessID = CPidProcessGroupIDtype ProcessGroupID = CPidNPrefixPrefix :: FixityFixity#precprec :: Prec ->  ReadPrec a ->  ReadPrec aPrecReadPrecaReadPreca(prec n p) checks whether the precedence context is less than or equal to n, and
  • if not, fails
  • if so, parses p in context n.
#Prectype Prec = IntOpooledReallocBytes pooledReallocBytes :: Pool -> Ptr a -> Int ->  IO (Ptr a)PoolPtraIntIOPtraFAdjust the storage area for an element in the pool to the given size. OpooledReallocArray0 pooledReallocArray0 :: Storable a => Pool -> Ptr a -> Int ->  IO (Ptr a)StorableaPoolPtraIntIOPtraBAdjust the size of an array with an end marker in the given pool. OpooledReallocArray pooledReallocArray :: Storable a => Pool -> Ptr a -> Int ->  IO (Ptr a)StorableaPoolPtraIntIOPtra/Adjust the size of an array in the given pool. O pooledRealloc pooledRealloc :: Storable a => Pool -> Ptr a ->  IO (Ptr a)qStorableaPoolPtraIOPtra[Adjust the storage area for an element in the pool to the given size of the required type. OpooledNewArray0 pooledNewArray0 :: Storable a => Pool -> a -> [a] ->  IO (Ptr a)  StorableaPoola[]aIOPtraAllocate consecutive storage for a list of values in the given pool and marshal these values into it, terminating the end with the given marker. OpooledNewArraypooledNewArray :: Storable a => Pool -> [a] ->  IO (Ptr a)!!StorableaPool[]aIOPtrafAllocate consecutive storage for a list of values in the given pool and marshal these values into it. O pooledNew pooledNew :: Storable a => Pool -> a ->  IO (Ptr a)""StorableaPoolaIOPtraXAllocate storage for a value in the given pool and marshal the value into this storage. OpooledMallocBytespooledMallocBytes :: Pool -> Int ->  IO (Ptr a)##PoolIntIOPtra;Allocate the given number of bytes of storage in the pool. OpooledMallocArray0pooledMallocArray0 :: Storable a => Pool -> Int ->  IO (Ptr a)$$StorableaPoolIntIOPtraAllocate storage for the given number of elements of a storable type in the pool, but leave room for an extra element to signal the end of the array. OpooledMallocArraypooledMallocArray :: Storable a => Pool -> Int ->  IO (Ptr a)%%StorableaPoolIntIOPtraRAllocate storage for the given number of elements of a storable type in the pool. O pooledMalloc pooledMalloc :: Storable a => Pool ->  IO (Ptr a)&&StorableaPoolIOPtraAllocate space for storable type in the given pool. The size of the area allocated is determined by the sizeOf method from the instance of Storable for the appropriate type. OPooldata Pool'A memory pool.  pokeArray0  pokeArray0 :: Storable a => a -> Ptr a -> [a] -> IO ()(N(StorableaaPtra[]aIO()aWrite the list elements consecutive into memory and terminate them with the given marker element  pokeArray pokeArray :: Storable a => Ptr a -> [a] -> IO ()z)K)StorableaPtra[]aIO()0Write the list elements consecutive into memory #pfailpfail ::  ReadPrec a))ReadPrecaAlways fails.  pfailpfail :: ReadP aD*7*ReadPaAlways fails. RPermutePermute ::  ArgOrder a**ArgOrdera+freely intersperse options and non-options permissionErrorTypepermissionErrorType ::  IOErrorType.+ + IOErrorTypeI/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation. peekCWStringLenpeekCWStringLen ::  CWStringLen ->  IO String4,, CWStringLenIOStringDMarshal a C wide string with explicit length into a Haskell string.  peekCWString peekCWString :: CWString ->  IO String,,CWStringIOString>Marshal a NUL terminated C wide string into a Haskell string. peekCStringLenpeekCStringLen ::  CStringLen ->  IO String-- CStringLenIOString?Marshal a C string with explicit length into a Haskell string.  peekCString peekCString :: CString ->  IO StringX.>.CStringIOString9Marshal a NUL terminated C string into a Haskell string. peekCAStringLenpeekCAStringLen ::  CStringLen ->  IO String/. CStringLenIOString?Marshal a C string with explicit length into a Haskell string.  peekCAString peekCAString :: CString ->  IO String//CStringIOString9Marshal a NUL terminated C string into a Haskell string.  peekArray0 peekArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO [a]0n0StorableaEqaaPtraIO[]aHConvert an array terminated by the given end marker into a Haskell list  peekArray peekArray :: Storable a => Int -> Ptr a -> IO [a]1X1StorableaIntPtraIO[]aConvert an array of given length into a Haskell list. This version traverses the array backwards using an accumulating parameter, which uses constant stack space. The previous version using mapM needed linear stack space. orElseorElse :: Maybe a -> Maybe a -> Maybe a22MaybeaMaybeaMaybeaLeft-biased choice on maybies  optionaloptional :: ReadP a -> ReadP ()u3Y3ReadPaReadP()Qoptional p optionally parses p and always returns ().  optionoption :: a -> ReadP a -> ReadP a<44aReadPaReadPacoption x p will either parse p or return x without consuming any input. ROption Option :: [Char] -> [String] ->  ArgDescr a -> String ->  OptDescr ak5(5[]Char[]StringArgDescraStringOptDescraROptDescrdata OptDescr a5Each OptDescr describes a single option. The arguments to Option are:
  • list of short option characters
  • list of long option strings (without "--")
  • argument descriptor
  • explanation of option for user
ROptArg OptArg ::  Maybe String -> a -> String ->  ArgDescr aD77MaybeStringaStringArgDescraoptional argument o_WRONLYo_WRONLY :: CInt77CInto_TRUNCo_TRUNC :: CInt77CInto_RDWRo_RDWR :: CInt8 8CInto_RDONLYo_RDONLY :: CIntP8I8CInt o_NONBLOCK o_NONBLOCK :: CInt88CInto_NOCTTYo_NOCTTY :: CInt88CInto_EXCLo_EXCL :: CInt9 9CInto_CREATo_CREAT :: CIntN9G9CInto_BINARYo_BINARY :: CInt99CInto_APPENDo_APPEND :: CInt99CIntNoRepNoRep :: DataRep::DataRepRNoArgNoArg :: a ->  ArgDescr ai:T:aArgDescrano argument expected FnewSTRefnewSTRef :: a -> ST s (STRef s a)::aSTsSTRefsa1 newSampleVar newSampleVar :: a -> IO (SampleVar a)d;H;aIO SampleVara0Build a SampleVar with an initial value. 0newQSemNnewQSemN :: Int -> IO QSemN;;IntIOQSemN;Build a new QSemN with a supplied initial quantity. /newQSemnewQSem :: Int -> IO QSem<y<IntIOQSemBuild a new QSem OnewPoolnewPool :: IO Pool<<IOPoolAllocate a fresh memory pool. -newMVarnewMVar :: a ->  IO (MVar a)l=U=aIOMVara9Create an MVar which contains the supplied value. 1newEmptySampleVarnewEmptySampleVar :: IO (SampleVar a)>=IO SampleVara%Build a new, empty, SampleVar - newEmptyMVar newEmptyMVar ::  IO (MVar a)>>IOMVara0Create an MVar which is initially empty. newCWStringLennewCWStringLen :: String -> IO CWStringLenA?#?StringIO CWStringLenMarshal a Haskell string into a C wide string (ie, wide character array) with explicit length information.
  • new storage is allocated for the C wide string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
 newCWString newCWString :: String ->  IO CWString@@StringIOCWString.Marshal a Haskell string into a NUL terminated C wide string.
  • the Haskell string may not contain any NUL characters
  • new storage is allocated for the C wide string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
 newCStringLen newCStringLen :: String ->  IO CStringLenrBUBStringIO CStringLenMarshal a Haskell string into a C string (ie, character array) with explicit length information.
  • new storage is allocated for the C string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
 newCString newCString :: String ->  IO CStringCCStringIOCString$Marshal a Haskell string into a NUL terminated C string.
  • the Haskell string may not contain any NUL characters
  • new storage is allocated for the C string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
.newChannewChan ::  IO (Chan a)[EIEIOChana1Build and returns a new instance of Chan. newCAStringLennewCAStringLen :: String ->  IO CStringLen FEStringIO CStringLenMarshal a Haskell string into a C string (ie, character array) with explicit length information.
  • new storage is allocated for the C string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
 newCAString newCAString :: String ->  IO CStringGfGStringIOCString$Marshal a Haskell string into a NUL terminated C string.
  • the Haskell string may not contain any NUL characters
  • new storage is allocated for the C string and must be explicitly freed using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree.
 newArray0 newArray0 :: Storable a => a -> [a] ->  IO (Ptr a)=IIStorableaa[]aIOPtraWrite a list of storable elements into a newly allocated, consecutive sequence of storable values, where the end is fixed by the given end marker newArraynewArray :: Storable a => [a] ->  IO (Ptr a)VJ+JStorablea[]aIOPtraWrite a list of storable elements into a newly allocated, consecutive sequence of storable values (like Foreign.Marshal.Utils.new, but for multiple elements). Pnewnew :: Storable a => a ->  IO (Ptr a)jKEKStorableaaIOPtra}Allocate a block of memory and marshal a value into it (the combination of malloc and poke). The size of the area allocated is determined by the Foreign.Storable.sizeOf method from the instance of Storable for the appropriate type. The memory may be deallocated using Foreign.Marshal.Alloc.free or Foreign.Marshal.Alloc.finalizerFree when no longer required. -MVardata MVar aMAn MVar (pronounced "em-var") is a synchronising variable, used for communication between concurrent threads. It can be thought of as a a box, which may be empty or full.  munch1munch1 :: (Char -> Bool) ->  ReadP String@NNCharBoolReadPStringBParses the first one or more characters satisfying the predicate.  munchmunch :: (Char -> Bool) ->  ReadP StringNNCharBoolReadPStringCParses the first zero or more characters satisfying the predicate. P moveBytes  moveBytes :: Ptr a -> Ptr a -> Int -> IO ()OOPtraPtraIntIO()Copies the given number of bytes from the second area (source) into the first (destination); the copied areas may overlap  moveArray  moveArray :: Storable a => Ptr a -> Ptr a -> Int -> IO ()QPStorableaPtraPtraIntIO()Copy the given number of elements from the second array (source) into the first array (destination); the copied areas may overlap ,MonadFixclass  Monad m => MonadFix mQMonads having fixed points with a 'knot-tying' semantics. Instances of MonadFix should satisfy the following laws:
  • purity mfix (return . h) = return (fix h)
  • left shrinking (or tightening) mfix (\x -> a >>= \y -> f x y) = a >>= \y -> mfix (\x -> f x y)
  • sliding mfix (Control.Monad.liftM h . f) = Control.Monad.liftM h (mfix (f . h)), for strict h.
  • nesting mfix (\x -> mfix (\y -> f x y)) = mfix (\x -> f x x)
This class is used in the translation of the recursive do notation supported by GHC and Hugs. *Monadclass Monad m UThe Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Minimal complete definition: >>= and return. Instances of Monad should satisfy the following laws:
return a >>= k  ==  k a
m >>= return  ==  m
m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
Instances of both Monad and Functor should additionally satisfy the law:
fmap f xs  ==  xs >>= return . f
The instances of Monad for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws. F modifySTRef modifySTRef ::  STRef s a -> (a -> a) -> ST s ())YYSTRefsaaaSTs()- modifyMVar_ modifyMVar_ :: MVar a ->  (a -> IO a) -> IO ()YYMVaraaIOaIO()- modifyMVar modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO bRZ#ZMVaraaIO(,)abIOb modifyIOError modifyIOError :: (IOError -> IOError) -> IO a -> IO aZZIOErrorIOErrorIOaIOaVCatch any IOError that occurs in the computation and throw a modified version. Y mkWeakPtr mkWeakPtr :: k ->  Maybe (IO ()) ->  IO (Weak k)[[kMaybeIO()IOWeakkA specialised version of mkWeak, where the key and the value are the same object:
mkWeakPtr key finalizer = mkWeak key key finalizer
Y mkWeakPair  mkWeakPair :: k -> v ->  Maybe (IO ()) -> IO (Weak (k, v))#]\kvMaybeIO()IOWeak(,)kv.A specialised version of mkWeak where the value is actually a pair of the key and value passed to mkWeakPair:
mkWeakPair key val finalizer = mkWeak key (key,val) finalizer
The advantage of this is that the key can be retrieved by deRefWeak in addition to the value. YmkWeak mkWeak :: k -> v ->  Maybe (IO ()) ->  IO (Weak v)^^kvMaybeIO()IOWeakvEstablishes a weak pointer to k, with value v and a finalizer. This is the most general interface for building a weak pointer. mkTmkT :: (Typeable a, Typeable b) => (b -> b) -> a -> a`_TypeableaTypeablebbbaa\Make a generic transformation; start from a type-specific case; preserve the term otherwise  mkStringType mkStringType :: String -> DataType``StringDataType"Constructs the String type mkStringConstrmkStringConstr :: DataType -> String -> ConstranaDataTypeStringConstrmkRmkR :: )(MonadPlus m, Typeable a, Typeable b) => m b -> m a2ba MonadPlusmTypeableaTypeablebmbmacMake a generic builder; start from a type-specific ase; resort to no build (i.e., mzero) otherwise mkQ mkQ :: (Typeable a, Typeable b) => r -> (b -> r) -> a -> r=c cTypeableaTypeablebrbrarSMake a generic query; start from a type-specific case; return a constant otherwise  mkNorepType mkNorepType :: String -> DataTypeccStringDataType;Constructs a non-representation for a non-presentable type mkMpmkMp :: )(MonadPlus m, Typeable a, Typeable b) =>  (b -> m b) -> a -> m add MonadPlusmTypeableaTypeablebbmbamauMake a generic monadic transformation for MonadPlus; use "const mzero" (i.e., failure) instead of return as default. mkMmkM :: %(Monad m, Typeable a, Typeable b) =>  (b -> m b) -> a -> m a*feMonadmTypeableaTypeablebbmbamacMake a generic monadic transformation; start from a type-specific case; resort to return otherwise  mkIOError  mkIOError ::  IOErrorType -> String ->  Maybe Handle -> Maybe FilePath -> IOErrorkg&g IOErrorTypeStringMaybeHandleMaybeFilePathIOErrorConstruct an IOError of the given type where the second argument describes the error location and the third and fourth argument contain the file handle and file path of the file involved in the error if applicable.  mkIntType mkIntType :: String -> DataTypehhStringDataTypeConstructs the Int type  mkIntConstr mkIntConstr :: DataType -> Integer -> ConstrTi6iDataTypeIntegerConstr mkFloatType mkFloatType :: String -> DataTypeiiStringDataType!Constructs the Float type  mkFloatConstr mkFloatConstr :: DataType -> Double -> ConstrgjJjDataTypeDoubleConstrmkdirmkdir :: CString -> CInt -> IO CIntjjCStringCIntIOCInt mkDataType mkDataType :: String -> [Constr] -> DataTypehkEkString[]ConstrDataType!Constructs an algebraic datatype mkConstr mkConstr :: DataType -> String -> [String] -> Fixity -> ConstrCllDataTypeString[]StringFixityConstrConstructs a constructor #minPrecminPrec :: PrecllPrec,mfixmfix :: MonadFix m =>  (a -> m a) -> m amlMonadFixmamamaP maybeWith  maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO cmmaPtrbIOcIOcMaybeaPtrbIOcIOcConverts a withXXX combinator into one marshalling a value wrapped into a Maybe, using nullPtr to represent Nothing. P maybePeek maybePeek :: (Ptr a -> IO b) -> Ptr a ->  IO (Maybe b).onPtraIObPtraIOMaybeb]Convert a peek combinator into a one returning Nothing if applied to a nullPtr PmaybeNewmaybeNew :: (a -> IO (Ptr a)) -> Maybe a ->  IO (Ptr a).poaIOPtraMaybeaIOPtraAllocate storage and marshall a storable value wrapped into a Maybe maxConstrIndexmaxConstrIndex :: DataType -> ConIndex9q"qDataTypeConIndex<Gets the maximum constructor index of an algebraic datatype  manyTillmanyTill :: ReadP a ->  ReadP end ->  ReadP [a] rqReadPaReadPendReadP[]amanyTill p end parses zero or more occurrences of p, until end succeeds. Returns a list of values returned by p.  many1many1 :: ReadP a ->  ReadP [a] srReadPaReadP[]a4Parses one or more occurrences of the given parser.  manymany :: ReadP a ->  ReadP [a]ssReadPaReadP[]a5Parses zero or more occurrences of the given parser.  mallocBytes mallocBytes :: Int ->  IO (Ptr a)Jt2tIntIOPtraAllocate a block of memory of the given number of bytes. The block of memory is sufficiently aligned for any of the basic foreign types that fits into a memory block of the allocated size. The memory may be deallocated using free or finalizerFree when no longer required.  mallocArray0 mallocArray0 :: Storable a => Int ->  IO (Ptr a)uuStorableaIntIOPtraZLike mallocArray, but add an extra position to hold a special termination element.  mallocArray mallocArray :: Storable a => Int ->  IO (Ptr a)vvStorableaIntIOPtraAllocate storage for the given number of elements of a storable type (like Foreign.Marshal.Alloc.malloc, but for multiple elements). mallocmalloc :: Storable a =>  IO (Ptr a)wwStorableaIOPtra;Allocate a block of memory that is sufficient to hold values of type a. The size of the area allocated is determined by the sizeOf method from the instance of Storable for the appropriate type. The memory may be deallocated using free or finalizerFree when no longer required. XmakeStableNamemakeStableName :: a -> IO (StableName a)|y_yaIO StableNameaMakes a StableName for an arbitrary object. The object passed as the first argument is not evaluated by makeStableName. lstatlstat :: CString ->  Ptr CStat -> IO CIntz`zCStringPtrCStatIOCInt#looklook :: ReadPrec StringzzReadPrecStringNLook-ahead: returns the part of the input that is left, without consuming it.  looklook ::  ReadP Stringp{^{ReadPStringNLook-ahead: returns the part of the input that is left, without consuming it. listifylistify :: Typeable r =>  (r -> Bool) ->  GenericQ [r]T|"|TypeablerrBoolGenericQ[]r1Get a list of all entities that meet a predicate Limittype Limit = CLong|#liftlift :: ReadP a ->  ReadPrec a%}}ReadPaReadPrecaALift a precedence-insensitive ReadP to a ReadPrec. "Lexemedata Lexeme}Haskell lexemes. "lexCharlexChar ::  ReadP Char}}ReadPChar"lexlex ::  ReadP Lexeme=~+~ReadPLexeme lengthArray0 lengthArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO Int~~StorableaEqaaPtraIOIntDReturn the number of elements in an array, excluding the terminator M isValidErrno isValidErrno :: Errno -> Bool}ErrnoBoolYield True if the given Errno value is valid on the system. This implies that the Eq instance of Errno is also system dependent as it is only defined for valid values of Errno. isUserErrorTypeisUserErrorType ::  IOErrorType -> BoolՀ IOErrorTypeBool&I/O error that is programmer-defined.  isUserError isUserError :: IOError -> Bool_MIOErrorBoolEA programmer-defined error value constructed using userError. isPermissionErrorTypeisPermissionErrorType ::  IOErrorType -> Bool$ IOErrorTypeBoolI/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation. isPermissionErrorisPermissionError :: IOError -> BoolIOErrorBoolAn error indicating that an IO operation failed because the user does not have sufficient operating system privilege to perform that operation.  isNorepType isNorepType :: DataType -> BoolDataTypeBool"Test for a non-representable type isIllegalOperationErrorTypeisIllegalOperationErrorType ::  IOErrorType -> BoolĄ IOErrorTypeBool/I/O error where the operation is not possible. isIllegalOperationisIllegalOperation :: IOError -> BooleSIOErrorBoolZAn error indicating that an IO operation failed because the operation was not possible. Any computation which returns an IO result may fail with isIllegalOperation. In some cases, an implementation will not be able to distinguish between the possible error causes. In this case it should fail with isIllegalOperation. isFullErrorTypeisFullErrorType ::  IOErrorType -> Bool3 IOErrorTypeBoolAI/O error where the operation failed because the device is full.  isFullError isFullError :: IOError -> Bool؇ƇIOErrorBoolSAn error indicating that an IO operation failed because the device is full. isEOFErrorTypeisEOFErrorType ::  IOErrorType -> Bool IOErrorTypeBoolOI/O error where the operation failed because the end of file has been reached.  isEOFError isEOFError :: IOError -> BoolN<IOErrorBoolaAn error indicating that an IO operation failed because the end of file has been reached. 1isEmptySampleVarisEmptySampleVar ::  SampleVar a -> IO Bool1 SampleVaraIOBool>Returns True if the SampleVar is currently empty. Note that this function is only useful if you know that no other threads can be modifying the state of the SampleVar, because otherwise the state of the SampleVar may have changed by the time you see the result of isEmptySampleVar. - isEmptyMVar isEmptyMVar :: MVar a -> IO Bool݋ËMVaraIOBool9Check whether a given MVar is empty. Notice that the boolean value returned is just a snapshot of the state of the MVar. By the time you get to react on its result, the MVar may have been filled (or emptied) - so be extremely careful when using this operation. Use tryTakeMVar instead if possible. . isEmptyChan isEmptyChan :: Chan a -> IO BooljChanaIOBool:Returns True if the supplied Chan is empty. isDoesNotExistErrorTypeisDoesNotExistErrorType ::  IOErrorType -> BoolB, IOErrorTypeBoolRI/O error where the operation failed because one of its arguments does not exist. isDoesNotExistErrorisDoesNotExistError :: IOError -> BoolIOErrorBooldAn error indicating that an IO operation failed because one of its arguments does not exist. isAlreadyInUseErrorTypeisAlreadyInUseErrorType ::  IOErrorType -> Boolڏ IOErrorTypeBoolyI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used. isAlreadyInUseErrorisAlreadyInUseError :: IOError -> BoolݐːIOErrorBoolAn error indicating that an IO operation failed because one of its arguments is a single-use resource, which is already being used (for example, opening the same file twice for writing might give this error). isAlreadyExistsErrorTypeisAlreadyExistsErrorType ::  IOErrorType -> Bool;% IOErrorTypeBoolRI/O error where the operation failed because one of its arguments already exists. isAlreadyExistsErrorisAlreadyExistsError :: IOError -> BoolIOErrorBooldAn error indicating that an IO operation failed because one of its arguments already exists.  isAlgType isAlgType :: DataType -> BoolɓDataTypeBoolTest for an algebraic type ioeSetLocationioeSetLocation :: IOError -> String -> IOErrornQIOErrorStringIOError ioeSetHandle ioeSetHandle :: IOError -> Handle -> IOErrorהIOErrorHandleIOErrorioeSetFileNameioeSetFileName :: IOError -> FilePath -> IOErrorcIOErrorFilePathIOErrorioeSetErrorTypeioeSetErrorType :: IOError ->  IOErrorType -> IOErrorIOError IOErrorTypeIOErrorioeSetErrorStringioeSetErrorString :: IOError -> String -> IOErrorIOErrorStringIOError IOErrorTypedata  IOErrorTypeKAn abstract type that contains a value for each variant of IOError. ioErrorioError :: IOError -> IO awIOErrorIOa0Raise an IOError in the IO monad. IOErrortype IOError = IOException%The Haskell 98 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Control.Exception.Exception. In Haskell 98, this is an opaque type. ioeGetLocationioeGetLocation :: IOError -> String}IOErrorString ioeGetHandle ioeGetHandle :: IOError ->  Maybe Handle IOErrorMaybeHandleioeGetFileNameioeGetFileName :: IOError -> Maybe FilePathlIOErrorMaybeFilePathioeGetErrorTypeioeGetErrorType :: IOError ->  IOErrorTypeIOError IOErrorTypeioeGetErrorStringioeGetErrorString :: IOError -> StringyeIOErrorStringIntRepIntRep :: DataRepDataRep IntConstr IntConstr :: Integer ->  ConstrRep%Integer ConstrRep"IntInt :: Integer -> Lexeme}iIntegerLexemeInteger literal InfixInfix :: Fixity˜œFixity indexConstr indexConstr :: DataType -> ConIndex -> ConstrS4DataTypeConIndexConstr=Gets the constructor for an index (algebraic datatypes only) illegalOperationErrorTypeillegalOperationErrorType ::  IOErrorType IOErrorType/I/O error where the operation is not possible. "IdentIdent :: String -> LexemevStringLexeme4Haskell identifier, e.g. foo, Baz "hsLexhsLex ::  ReadP String ReadPString@Haskell lexer: returns the lexed string, rather than the lexeme XhashStableNamehashStableName ::  StableName a -> Int StableNameaIntConvert a StableName to an Int. The Int returned is not necessarily unique; several StableNames may map to the same Int (in practice however, the chances of this are small, so the result of hashStableName makes a good hash key).  gzipWithT gzipWithT :: GenericQ GenericT -> GenericQ GenericTb3GenericQGenericTGenericQGenericTTwin map for transformation  gzipWithQ gzipWithQ :: GenericQ (GenericQ r) -> GenericQ (GenericQ [r]),GenericQGenericQrGenericQGenericQ[]rTwin map for queries  gzipWithM gzipWithM ::  Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)MonadmGenericQGenericMmGenericQGenericMm$Twin map for monadic transformation gzipgzip :: GenericQ (GenericM Maybe) -> GenericQ (GenericM Maybe)ΣGenericQGenericMMaybeGenericQGenericMMaybeAGeneric zip controlled by a function with type-specific branches gunfold gunfold ::  Data a => (c (b -> r) -> c r) ->  (r -> c r) -> Constr -> c aؤDataacbrcrrcrConstrca gtypecount gtypecount :: Typeable a => a ->  GenericQ Int^8TypeableaaGenericQInt>Determine the number of nodes of a given type in a given term GTGT ::  Data a => a -> a ->  GenericT'Dataaaa GenericT'gsizegsize ::  Data a => a -> IntpZDataaaInt,Compute size of an arbitrary data structure gshowgshow ::  Data a => a -> StringDataaaString0Generic show: an alternative to "deriving Show" greadgread ::  Data a => ReadS aqDataaReadSa0Generic read: an alternative to "deriving Read" GQGQ ::  GenericQ r ->  GenericQ' r%GenericQr GenericQ'r gnodecount gnodecount ::  GenericQ Int|jGenericQInt2Determine the number of all nodes in a given term gmapTgmapT ::  Data a => (b -> b) -> a -> a% DataabbaagmapQr gmapQr ::  Data a => (r' -> r -> r) -> r ->  (a -> r') -> a -> r֩Dataar'rrrar'argmapQl gmapQl ::  Data a => (r -> r' -> r) -> r ->  (a -> r') -> a -> r[Dataarr'rrar'argmapQi gmapQi ::  Data a => Int -> (a -> u) -> a -> uDataaIntauaugmapQgmapQ ::  Data a => (a -> u) -> a -> [u]qDataaaua[]ugmapMpgmapMp :: (Data a, MonadPlus m) =>  (a -> m a) -> a -> m a9Dataa MonadPlusmamaamagmapMogmapMo :: (Data a, MonadPlus m) =>  (a -> m a) -> a -> m a߬Dataa MonadPlusmamaamagmapMgmapM :: (Data a, Monad m) =>  (a -> m a) -> a -> m a{IDataaMonadmamaama gmapAccumT  gmapAccumT ::  Data d => (a -> d -> (a, d)) -> a -> d -> (a, d)2Datadad(,)adad(,)adgmapT with accumulation  gmapAccumQr gmapAccumQr ::  Data d => (r' -> r -> r) -> r -> (a -> d -> (a, r')) -> a -> d -> (a, r);Datadr'rrrad(,)ar'ad(,)argmapQr with accumulation  gmapAccumQl gmapAccumQl ::  Data d => (r -> r' -> r) -> r -> (a -> d -> (a, r')) -> a -> d -> (a, r)EDatadrr'rrad(,)ar'ad(,)argmapQl with accumulation  gmapAccumQ  gmapAccumQ ::  Data d => (a -> d -> (a, q)) -> a -> d -> (a, [q])Datadad(,)aqad(,)a[]qgmapQ with accumulation  gmapAccumM  gmapAccumM :: (Data d, Monad m) => (a -> d -> (a, m d)) -> a -> d -> (a, m d)űDatadMonadmad(,)amdad(,)amdgmapM with accumulation GMGM ::  Data a => a -> m a ->  GenericM' mDataaama GenericM'mglengthglength ::  GenericQ IntGenericQInt9Count the number of immediate subterms of the given term  gfoldlAccum  gfoldlAccum ::  Data d => "(a -> c (d -> r) -> d -> (a, c r)) -> (a -> g -> (a, c g)) -> a -> d -> (a, c d)RDatadacdrd(,)acrag(,)acgad(,)acdgfoldl with accumulation gfoldlgfoldl ::  Data a =>  c (a -> b) -> a -> c b -> g -> c g -> a -> c a@Dataacabacbgcgaca gfindtype gfindtype :: (Data x, Typeable y) => x -> Maybe yϵDataxTypeableyxMaybey:Find (unambiguously) an immediate subterm of a given type RgetOpt' getOpt' ::  ArgOrder a ->  [OptDescr a] -> [String] -> #([a], [String], [String], [String])ArgOrdera[]OptDescra[]String(,,,)[]a[]String[]String[]StringThis is almost the same as getOpt, but returns a quadruple consisting of the option arguments, a list of non-options, a list of unrecognized options, and a list of error messages. RgetOpt getOpt ::  ArgOrder a ->  [OptDescr a] -> [String] -> ([a], [String], [String])YArgOrdera[]OptDescra[]String(,,)[]a[]String[]StringProcess the command-line, and return the list of values that matched (and those that didn't). The arguments are:
  • The order requirements (see ArgOrder)
  • The option descriptions (see OptDescr)
  • The actual command line arguments (presumably got from System.Environment.getArgs).
getOpt returns a triple consisting of the option arguments, a list of non-options, and a list of error messages. MgetErrnogetErrno :: IO ErrnoƺIOErrno?Get the current value of errno in the current thread. getEchogetEcho :: FD -> IO Bool`MFDIOBool.getChanContentsgetChanContents :: Chan a -> IO [a]ػChanaIO[]alReturn a lazy list representing the contents of the supplied Chan, much like System.IO.hGetContents. get_console_echoget_console_echo :: CInt -> IO CIntCIntIOCInt#getget ::  ReadPrec CharReadPrecCharJConsumes and returns the next character. Fails if there is no input left.  getget ::  ReadP CharReadPCharJConsumes and returns the next character. Fails if there is no input left. geqgeq ::  Data a => a -> a -> BoolF,DataaaaBool2Generic equality: an alternative to "deriving Eq"  GenericT'newtype  GenericT''Other first-class polymorphic wrappers GenericTtype GenericT = a -> a=Generic transformations, i.e., take an "a" and return an "a" GenericRtype GenericR m = m aZGeneric readers, say monadic builders, i.e., produce an "a" with the help of a monad "m".  GenericQ'newtype  GenericQ' r'GenericQtype GenericQ r = a -> rhBGeneric queries of type "r", i.e., take any "a" and return an "r"  GenericM'newtype  GenericM' mGenericMtype GenericM m = a -> m a(FGeneric monadic transformations, i.e., take an "a" and compute an "a" GenericBtype GenericB = a'Generic builders i.e., produce an "a". Generic'Generic' ::  Generic c ->  Generic' cC#GenericcGeneric'cGeneric'data Generic' cyTWrapped generic functions; recall: [Generic c] would be legal but [Generic' c] not. Generictype Generic c = a -> c axThe general scheme underlying generic functions assumed by gfoldl; there are isomorphisms such as GenericT = Generic T. gdepthgdepth ::  GenericQ IntGenericQInt"Determine depth of the given term gcountgcount ::  GenericQ Bool ->  GenericQ IntsMGenericQBoolGenericQInt;Determine the number of all suitable nodes in a given term  gathergather :: ReadP a -> ReadP (String, a)-ReadPaReadP(,)StringaTransforms a parser into one that does the same, but in addition returns the exact characters read. IMPORTANT NOTE: gather gives a runtime error if its first argument is built using any occurrences of readS_to_P. *Functorclass Functor f>CThe Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:
fmap id  ==  id
fmap (f . g)  ==  fmap f . fmap g
The instances of Functor for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws.  fullErrorType fullErrorType ::  IOErrorType IOErrorTypeAI/O error where the operation failed because the device is full.  fromConstrM fromConstrM :: (Monad m, Data a) => m a -> Constr -> m aMonadmDataamaConstrma(Monadic variation on fromConstrB  fromConstrB fromConstrB ::  Data a => a -> Constr -> aiMDataaaConstra5Build a term and use a generic function for subterms  fromConstr fromConstr ::  Data a => Constr -> a DataaConstraBuild a term skeleton PfromBoolfromBool ::  Num a => Bool -> arNumaBoola<Convert a Haskell Bool to its numeric representation OfreePoolfreePool :: Pool -> IO ()!PoolIO()UDeallocate a memory pool and everything which has been allocated in the pool itself.  freeDirEnt freeDirEnt ::  Ptr CDirent -> IO ()PtrCDirentIO()freefree :: Ptr a -> IO ()B+PtraIO()Free a block of memory that was allocated with malloc, mallocBytes, realloc, reallocBytes, Foreign.Marshal.Utils.new or any of the newX functions in Foreign.Marshal.Array or Foreign.C.String. *fmapfmap ::  Functor f => (a -> b) -> f a -> f bFunctorfabfafbFloatRepFloatRep :: DataRep DataRep FloatConstr FloatConstr :: Double ->  ConstrRepwaDouble ConstrRep6fixSTfixST ::  (a -> ST s a) -> ST s aaSTsaSTsaAllow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixST f = _|_. Fixitydata FixityFixity of constructors ,fixfix :: (a -> a) -> aaaafix f is the least fixed point of the function f, i.e. the least defined x such that f x = x.  finalizerFree finalizerFree :: FinalizerPtr a FinalizerPtraA pointer to a foreign function equivalent to free, which may be used as a finalizer (cf Foreign.ForeignPtr.ForeignPtr) for storage allocated with malloc, mallocBytes, realloc or reallocBytes. Yfinalizefinalize :: Weak v -> IO ()N6WeakvIO()MCauses a the finalizer associated with a weak pointer to be run immediately. fileTypefileType :: FilePath ->  IO FDTypeFilePathIOFDType FileOffsettype  FileOffset = COffIFileModetype FileMode = CModeFileIDtype FileID = CInofdTypefdType :: FD ->  IO FDTypeFDIOFDTypeFDTypedata FDTypeMfdStatfdStat :: FD -> IO (FDType, CDev, CIno)FDIO(,,)FDTypeCDevCInofdIsTTYfdIsTTY :: FD -> IO Bool'FDIOBool fdGetMode fdGetMode :: FD ->  IO IOModeuFDIOIOMode fdFileSize fdFileSize :: FD ->  IO IntegerFDIOIntegerFdFd :: CInt -> Fd9,CIntFdFdnewtype Fdd*failfail ::  Monad m => String -> m aMonadmStringmaextT extT :: (Typeable a, Typeable b) => (a -> a) -> (b -> b) -> a -> aOTypeableaTypeablebaabbaa8Extend a generic transformation by a type-specific case extRextR :: %(Monad m, Typeable a, Typeable b) => m a -> m b -> m av1MonadmTypeableaTypeablebmambmaExtend a generic reader extQ extQ :: (Typeable a, Typeable b) => (a -> q) -> (b -> q) -> a -> qD TypeableaTypeablebaqbqaq/Extend a generic query by a type-specific case extMp extMp :: )(MonadPlus m, Typeable a, Typeable b) =>  (a -> m a) ->  (b -> m b) -> a -> m a] MonadPlusmTypeableaTypeablebamabmbamaBExtend a generic MonadPlus transformation by a type-specific case extM extM :: %(Monad m, Typeable a, Typeable b) =>  (a -> m a) ->  (b -> m b) -> a -> m a-MonadmTypeableaTypeablebamabmbama@Extend a generic monadic transformation by a type-specific case extBextB :: (Typeable a, Typeable b) => a -> b -> aM#TypeableaTypeablebabaExtend a generic builder ext1T ext1T :: (Data d, Typeable1 t) => (d -> d) ->  (t d -> t d) -> d -> d&Datad Typeable1tddtdtddd>Type extension of transformations for unary type constructors ext1Rext1R :: "(Monad m, Data d, Typeable1 t) => m d -> m (t d) -> m d!MonadmDatad Typeable1tmdmtdmd0Type extension of readers for type constructors ext1Q ext1Q :: (Data d, Typeable1 t) => (d -> q) ->  (t d -> q) -> d -> q Datad Typeable1tdqtdqdq0Type extension of queries for type constructors ext1M ext1M :: "(Monad m, Data d, Typeable1 t) =>  (d -> m d) -> (t d -> m (t d)) -> d -> m d&MonadmDatad Typeable1tdmdtdmtddmd@Type extension of monadic transformations for type constructors ext0ext0 :: (Typeable a, Typeable b) => c a -> c b -> c a TypeableaTypeablebcacbcaFlexible type extension  everywhereM everywhereM ::  Monad m =>  GenericM m ->  GenericM mMonadmGenericMmGenericMm Monadic variation on everywhere  everywhereBut everywhereBut ::  GenericQ Bool -> GenericT -> GenericTqHGenericQBoolGenericTGenericT5Variation on everywhere with an extra stop condition  everywhere' everywhere' :: (a -> a) -> a -> aaaaa5Apply a transformation everywhere in top-down manner  everywhere everywhere :: (a -> a) -> a -> aaaaa6Apply a transformation everywhere in bottom-up manner  everything everything ::  (r -> r -> r) ->  GenericQ r ->  GenericQ r]rrrGenericQrGenericQr5Summarise all nodes in top-down, left-to-right order MerrnoToIOError errnoToIOError :: String -> Errno ->  Maybe Handle ->  Maybe String -> IOErrorYStringErrnoMaybeHandleMaybeStringIOErrorConstruct a Haskell 98 I/O error based on the given Errno value. The optional information can be used to improve the accuracy of error messages. MErrnoErrno :: CInt -> ErrnorCIntErrnoMErrnonewtype ErrnoHaskell representation for errno values. The implementation is deliberately exposed, to allow users to add their own definitions of Errno values.  EpochTimetype  EpochTime = CTime eofErrorType eofErrorType ::  IOErrorType IOErrorTypeOI/O error where the operation failed because the end of file has been reached. "EOFEOF :: LexemetkLexeme endBy1endBy1 :: ReadP a ->  ReadP sep ->  ReadP [a]ReadPaReadPsepReadP[]ahendBy p sep parses one or more occurrences of p, separated and ended by sep.  endByendBy :: ReadP a ->  ReadP sep ->  ReadP [a]ReadPaReadPsepReadP[]aiendBy p sep parses zero or more occurrences of p, separated and ended by sep.  end_of_dir end_of_dir :: CIntCInt1emptySampleVaremptySampleVar ::  SampleVar a -> IO ()# SampleVaraIO()AIf the SampleVar is full, leave it empty. Otherwise, do nothing. Me2BIGe2BIG :: ErrnoErrno.dupChandupChan :: Chan a ->  IO (Chan a)ChanaIOChanaDuplicate a Chan: the duplicate channel begins empty, but data written to either channel from then on will be available from both. Hence this creates a kind of broadcast channel, where data written by anyone is seen by everyone else. doesNotExistErrorTypedoesNotExistErrorType ::  IOErrorTypehZ IOErrorTypeRI/O error where the operation failed because one of its arguments does not exist.  Directory Directory :: FDTypeFDTypeDeviceIDtype DeviceID = CDev=Y deRefWeak deRefWeak :: Weak v ->  IO (Maybe v)WeakvIOMaybev8Dereferences a weak pointer. If the key is still alive, then Just v is returned (where v is the value in the weak pointer), otherwise Nothing is returned. The return value of deRefWeak depends on when the garbage collector runs, hence it is in the IO monad.  dataTypeRep dataTypeRep :: DataType -> DataRepV@DataTypeDataRep+Gets the public presentation of a datatype  dataTypeOf dataTypeOf ::  Data a => a -> DataTypeDataaaDataType dataTypeName dataTypeName :: DataType -> String`KDataTypeString/Gets the type constructor including the module dataTypeConstrsdataTypeConstrs :: DataType -> [Constr] DataType[]Constr/Gets the constructors of an algebraic datatype DataTypedata DataTypeleRepresentation of datatypes. A package of constructor representations with names of type and module. DataRepdata DataRep#Public representation of datatypes  dataCast2 dataCast2 :: (Data a, Typeable2 t) =>  c (t a b) ->  Maybe (c a)Dataa Typeable2tctabMaybeca dataCast1 dataCast1 :: (Data a, Typeable1 t) => c (t a) ->  Maybe (c a)CDataa Typeable1tctaMaybecaDataclass Typeable a => Data a The Data class comprehends a fundamental primitive gfoldl for folding over constructor applications, say terms. This primitive can be instantiated in several ways to map over the immediate subterms of a term; see the gmap combinators later in this class. Indeed, a generic programmer does not necessarily need to use the ingenious gfoldl primitive but rather the intuitive gmap combinators. The gfoldl primitive is completed by means to query top-level constructors, to turn constructor representations into proper terms, and to list all possible datatype constructors. This completion allows us to serve generic programming scenarios like read, show, equality, term generation. The combinators gmapT, gmapQ, gmapM, etc are all provided with default definitions in terms of gfoldl, leaving open the opportunity to provide datatype-specific definitions. (The inclusion of the gmap combinators as members of class Data allows the programmer or the compiler to derive specialised, and maybe more efficient code per datatype. Note: gfoldl is more higher-order than the gmap combinators. This is subject to ongoing benchmarking experiments. It might turn out that the gmap combinators will be moved out of the class Data.) Conceptually, the definition of the gmap combinators in terms of the primitive gfoldl requires the identification of the gfoldl function arguments. Technically, we also need to identify the type constructor c for the construction of the result type from the folded term type. In the definition of gmapQx combinators, we use phantom type constructors for the c in the type of gfoldl because the result type of a query does not involve the (polymorphic) type of the term argument. In the definition of gmapQl we simply use the plain constant type constructor because gfoldl is left-associative anyway and so it is readily suited to fold a left-associative binary operation over the immediate subterms. In the definition of gmapQr, extra effort is needed. We use a higher-order accumulation trick to mediate between left-associative constructor application vs. right-associative binary operation (e.g., (:)). When the query is meant to compute a value of type r, then the result type withing generic folding is r -> r. So the result of folding is a function to which we finally pass the right unit. With the -fglasgow-exts option, GHC can generate instances of the Data class automatically. For example, given the declaration
data T a b = C1 a b | C2 deriving (Typeable, Data)
GHC will generate an instance that is equivalent to
instance (Data a, Data b) => Data (T a b) where
    gfoldl k z (C1 a b) = z C1 `k` a `k` b
    gfoldl k z C2       = z C2

    gunfold k z c = case constrIndex c of
                        1 -> k (k (z C1))
                        2 -> z C2

    toConstr (C1 _ _) = con_C1
    toConstr C2       = con_C2

    dataTypeOf _ = ty_T

con_C1 = mkConstr ty_T "C1" [] Prefix
con_C2 = mkConstr ty_T "C2" [] Prefix
ty_T   = mkDataType "Module.T" [con_C1, con_C2]
This is suitable for datatypes that are exported transparently. d_named_name ::  Ptr CDirent ->  IO CStringG%PtrCDirentIOCString CWStringLentype  CWStringLen = (Ptr CWchar, Int)A wide character string with explicit length information in CWchars instead of a terminating NUL (allowing NUL characters in the middle of the string). CWStringtype CWString = Ptr CWcharySA C wide string is a reference to an array of C wide characters terminated by NUL. CWchardata CWchar7Haskell type representing the C wchar_t type. CUtsnametype CUtsname = ()nCUtimbuftype CUtimbuf = ()CUShortdata CUShort>Haskell type representing the C unsigned short type. CULongdata CULongI=Haskell type representing the C unsigned long type. CULLongdata CULLongBHaskell type representing the C unsigned long long type. CUIntPtrdata CUIntPtr.CUIntMaxdata CUIntMaxbCUIntdata CUInt<Haskell type representing the C unsigned int type. CUChardata CUChar=Haskell type representing the C unsigned char type. CTmstype CTms = ()lCTmtype CTm = ()CTimedata CTimeHaskell type representing the C time_t type. To convert to a Data.Time.UTCTime, use the following formula:
posixSecondsToUTCTime (realToFrac :: POSIXTime)
CTermiostype CTermios = () CStringLentype  CStringLen = (Ptr CChar, Int) A string with explicit length information in bytes instead of a terminating NUL (allowing NUL characters in the middle of the string). CStringtype CString = Ptr CChar IA C string is a reference to an array of C characters terminated by NUL. CStattype CStat = ()T CSsizedata CSsize CSizedata CSize 6Haskell type representing the C size_t type. CSigsettype CSigset = ()!  CSigAtomicdata  CSigAtomicY <Haskell type representing the C sig_atomic_t type.  CSigactiontype  CSigaction = () CShortdata CShort 5Haskell type representing the C short type. CSChardata CSChari ;Haskell type representing the C signed char type. CPtrdiffdata CPtrdiff 9Haskell type representing the C ptrdiff_t type. CPiddata CPid= CPasswdtype CPasswd = ()v  countcount :: Int -> ReadP a ->  ReadP [a]  IntReadPaReadP[]akcount n p parses n occurrences of p in sequence. A list of results is returned. P copyBytes  copyBytes :: Ptr a -> Ptr a -> Int -> IO ()PtraPtraIntIO()Copies the given number of bytes from the second area (source) into the first (destination); the copied areas may not overlap  copyArray  copyArray :: Storable a => Ptr a -> Ptr a -> Int -> IO ())StorableaPtraPtraIntIO()Copy the given number of elements from the second array (source) into the first array (destination); the copied areas may not overlap  constrType constrType :: Constr -> DataType ConstrDataType#Gets the datatype of a constructor  constrRep constrRep :: Constr ->  ConstrRepConstr ConstrRep-Gets the public presentation of constructors  ConstrRepdata  ConstrRep &Public representation of constructors  constrIndex constrIndex :: Constr -> ConIndexConstrConIndex;Gets the index of a constructor (algebraic datatypes only)  constrFixity constrFixity :: Constr -> Fixity?,ConstrFixity!Gets the fixity of a constructor  constrFields constrFields :: Constr -> [String]Constr[]StringGets the field labels of a constructor. The list of labels is returned in the same order as they were given in the original constructor declaration. Constrdata ConstrRepresentation of constructors  const_vtime const_vtime :: CIntCInt const_vmin const_vmin :: CInt>7CInt const_tcsanow const_tcsanow :: CIntCInt const_sigttou const_sigttou :: CIntCIntconst_sig_setmaskconst_sig_setmask :: CInt$CIntconst_sig_blockconst_sig_block :: CIntrkCInt const_icanon const_icanon :: CIntCInt const_f_setfl const_f_setfl :: CIntCInt const_f_getfl const_f_getfl :: CIntNGCInt const_echo const_echo :: CIntCIntConIndextype ConIndex = IntiUnique index for datatype constructors, counting from 1 in the order they are given in the program text. COffdata COffcCModedata CModecloseFdcloseFd :: Bool -> CInt -> IO CIntBoolCIntIOCIntCLongdata CLong44Haskell type representing the C long type.  ClockTicktype  ClockTick = CClockCLLongdata CLLong9Haskell type representing the C long long type. CLDoubledata CLDoubleF;Haskell type representing the C long double type. CLconvtype CLconv = ()CJmpBufdata CJmpBuf7Haskell type representing the C jmp_buf type. CIntPtrdata CIntPtrSCIntMaxdata CIntMaxCIntdata CInt3Haskell type representing the C int type. CInodata CInochoiceQchoiceQ :: MonadPlus m => GenericQ (m r) -> GenericQ (m r) -> GenericQ (m r) MonadPlusmGenericQmrGenericQmrGenericQmrChoice for monadic queries choiceMpchoiceMp :: MonadPlus m =>  GenericM m ->  GenericM m ->  GenericM mx MonadPlusmGenericMmGenericMmGenericMm#Choice for monadic transformations #choicechoice ::  [ReadPrec a] ->  ReadPrec aU.[]ReadPrecaReadPreca,Combines all parsers in the specified list.  choicechoice ::  [ReadP a] -> ReadP a[]ReadPaReadPa,Combines all parsers in the specified list. charIsRepresentablecharIsRepresentable :: Char -> IO Bool}CharIOBoolDetermines whether a character can be accurately encoded in a CString. Unrepresentable characters are converted to '?'. Currently only Latin-1 characters are representable.  charchar :: Char ->  ReadP Char  CharReadPChar,Parses and returns the specified character. "CharChar :: Char -> Lexeme/!!CharLexemeCharacter literal .Chandata Chan ao!HChan is an abstract type representing an unbounded FIFO channel.  chainr1chainr1 :: ReadP a -> ReadP (a -> a -> a) -> ReadP aR"#"ReadPaReadPaaaReadPaFLike chainr, but parses one or more occurrences of p.  chainr chainr :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP aA##ReadPaReadPaaaaReadPachainr p op x parses zero or more occurrences of p, separated by op. Returns a value produced by a right associative application of all functions returned by op. If there are no occurrences of p, x is returned.  chainl1chainl1 :: ReadP a -> ReadP (a -> a -> a) -> ReadP a$$ReadPaReadPaaaReadPaFLike chainl, but parses one or more occurrences of p.  chainl chainl :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP a%%ReadPaReadPaaaaReadPachainl p op x parses zero or more occurrences of p, separated by op. Returns a value produced by a left associative application of all functions returned by op. If there are no occurrences of p, x is returned. CGrouptype CGroup = ()!'CFposdata CFposO'6Haskell type representing the C fpos_t type. CFLocktype CFLock = ()'CFloatdata CFloat'5Haskell type representing the C float type. CFiledata CFileO(4Haskell type representing the C FILE type. CDoubledata CDouble(6Haskell type representing the C double type. CDirenttype CDirent = ()$)CDirtype CDir = ()W)CDevdata CDev)CClockdata CClock)7Haskell type representing the C clock_t type. CChardata CChar*4Haskell type representing the C char type. catchcatch :: IO a -> (IOError -> IO a) -> IO a**IOaIOErrorIOaIOaThe catch function establishes a handler that receives any IOError raised in the action protected by catch. An IOError is caught by the most recent handler established by catch. These handlers are not selective: all IOErrors are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in
f = catch g (\e -> if IO.isEOFError e then return [] else ioError e)
the function f returns [] when an end-of-file exception (cf. System.IO.Error.isEOFError) occurs in g; otherwise, the exception is propagated to the next outer handler. When an exception propagates outside the main program, the Haskell system prints the associated IOError value and exits the program. Non-I/O exceptions are not caught by this variant; to catch all exceptions, use Control.Exception.catch from Control.Exception. castCharToCCharcastCharToCChar :: Char -> CChar..CharCCharfConvert a Haskell character to a C character. This function is only safe on the first 256 characters. castCCharToCharcastCCharToChar :: CChar -> Char//CCharChar\Convert a C byte, representing a Latin-1 character, to the corresponding Haskell character. c_write c_write :: CInt ->  Ptr CChar -> CSize ->  IO CSsize00CIntPtrCCharCSizeIOCSsizec_unlinkc_unlink :: CString -> IO CInt(11CStringIOCIntc_umaskc_umask :: CMode -> IO CMode1t1CModeIOCModec_statc_stat :: CString ->  Ptr CStat -> IO CInt21CStringPtrCStatIOCInt c_s_isreg c_s_isreg :: CMode -> CIntm2]2CModeCInt c_s_isfifo c_s_isfifo :: CMode -> CInt22CModeCInt c_s_isdir c_s_isdir :: CMode -> CInt'33CModeCInt c_s_ischr c_s_ischr :: CMode -> CInt3s3CModeCInt c_s_isblk c_s_isblk :: CMode -> CInt33CModeCIntc_rmdirc_rmdir :: CString -> IO CIntD4,4CStringIOCInt c_rewinddir c_rewinddir :: Ptr CDir -> IO ()44PtrCDirIO()c_renamec_rename :: CString -> CString -> IO CInt555CStringCStringIOCIntc_read c_read :: CInt ->  Ptr CChar -> CSize ->  IO CSsize55CIntPtrCCharCSizeIOCSsize c_opendir c_opendir :: CString ->  IO (Ptr CDir)G6(6CStringIOPtrCDirc_open c_open :: CString -> CInt -> CMode -> IO CInt66CStringCIntCModeIOCIntc_lseek c_lseek :: CInt -> Int64 -> CInt -> IO Int64g7D7CIntInt64CIntIOInt64c_isattyc_isatty :: CInt -> IO CInt77CIntIOCIntc_getpidc_getpid :: IO CPid88IOCPidc_getcwdc_getcwd ::  Ptr CChar -> CSize -> IO (Ptr CChar)8z8PtrCCharCSizeIOPtrCChar c_ftruncate c_ftruncate :: CInt -> COff -> IO CInt#99CIntCOffIOCIntc_fstatc_fstat :: CInt ->  Ptr CStat -> IO CInt99CIntPtrCStatIOCIntc_dup2c_dup2 :: CInt -> CInt -> IO CInt:9CIntCIntIOCIntc_dupc_dup :: CInt -> IO CInts:^:CIntIOCIntc_creatc_creat :: CString -> CMode -> IO CInt::CStringCModeIOCInt c_closesocket c_closesocket :: CInt -> IO CInt[;F;CIntIOCInt c_closedir c_closedir :: Ptr CDir -> IO CInt;;PtrCDirIOCIntc_closec_close :: CInt -> IO CInt*<<CIntIOCIntc_chmodc_chmod :: CString -> CMode -> IO CInt<<CStringCModeIOCIntc_chdirc_chdir :: CString -> IO CInt =<CStringIOCIntc_accessc_access :: CString -> CInt -> IO CInt=k=CStringCIntIOCInt ByteCounttype  ByteCount = CSize= between between ::  ReadP open ->  ReadP close -> ReadP a -> ReadP a}>C>ReadPopenReadPcloseReadPaReadPabetween open close p parses open, followed by p and finally close. Only the value of p is returned. RArgOrderdata ArgOrder aD?.What to do with options following non-options RArgDescrdata ArgDescr a?~Describes whether an option takes an argument or not, and if so how the argument is injected into a value of type a. annotateIOError annotateIOError :: IOError -> String ->  Maybe Handle -> Maybe FilePath -> IOErrorA@IOErrorStringMaybeHandleMaybeFilePathIOErrorAdds a location description and maybe a file path and file handle to an IOError. If any of the file handle or file path is not given the corresponding value in the IOError remains unaltered. alreadyInUseErrorTypealreadyInUseErrorType ::  IOErrorType=B/B IOErrorTypeyI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used. alreadyExistsErrorTypealreadyExistsErrorType ::  IOErrorType CC IOErrorTypeRI/O error where the operation failed because one of its arguments already exists.  allocaBytes allocaBytes :: Int -> (Ptr a -> IO b) -> IO bDCIntPtraIObIOballocaBytes n f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory of n bytes. The block of memory is sufficiently aligned for any of the basic foreign types that fits into a memory block of the allocated size. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.  allocaArray0 allocaArray0 :: Storable a => Int -> (Ptr a -> IO b) -> IO buF@FStorableaIntPtraIObIObZLike allocaArray, but add an extra position to hold a special termination element.  allocaArray allocaArray :: Storable a => Int -> (Ptr a -> IO b) -> IO b{GFGStorableaIntPtraIObIOb|Temporarily allocate space for the given number of elements (like Foreign.Marshal.Alloc.alloca, but for multiple elements). allocaalloca :: Storable a => (Ptr a -> IO b) -> IO bHUHStorableaPtraIObIObTalloca f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory sufficient to hold values of type a. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this. AlgRepAlgRep :: [Constr] -> DataRep?J%J[]ConstrDataRep AlgConstr AlgConstr :: ConIndex ->  ConstrRepJJConIndex ConstrRep advancePtr advancePtr :: Storable a => Ptr a -> Int -> Ptr aBKKStorableaPtraIntPtra@Advance a pointer into an array by the given number of elements -addMVarFinalizeraddMVarFinalizer :: MVar a -> IO () -> IO ()LKMVaraIO()IO()Add a finalizer to an MVar (GHC only). See Foreign.ForeignPtr and System.Mem.Weak for more about finalizers. Y addFinalizer addFinalizer :: key -> IO () -> IO ()MLkeyIO()IO()=A specialised version of mkWeakPtr, where the Weak object returned is simply thrown away (however the finalizer will be remembered by the garbage collector, and will still be run when the key becomes unreachable). Note: adding a finalizer to a Foreign.ForeignPtr.ForeignPtr using addFinalizer won't work as well as using the specialised version Foreign.ForeignPtr.addForeignPtrFinalizer because the latter version adds the finalizer to the primitive 'ForeignPtr#' object inside, whereas the generic addFinalizer will add the finalizer to the box. Optimisations tend to remove the box, which may cause the finalizer to run earlier than you intended. The same motivation justifies the existence of Control.Concurrent.MVar.addMVarFinalizer and Data.IORef.mkWeakIORef (the non-uniformity is accidental). *>>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bPPMonadmmaambmb*>> (>>) ::  Monad m => m a -> m b -> m b`Q9QMonadmmambmb#<++ (<++) ::  ReadPrec a ->  ReadPrec a ->  ReadPrec aQQReadPrecaReadPrecaReadPrecaxLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.  <++ (<++) :: ReadP a -> ReadP a -> ReadP aRRReadPaReadPaReadPaxLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used. #+++ (+++) ::  ReadPrec a ->  ReadPrec a ->  ReadPrec aTSReadPrecaReadPrecaReadPrecaSymmetric choice.  +++ (+++) :: ReadP a -> ReadP a -> ReadP aTsTReadPaReadPaReadPaSymmetric choice. )||| (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) dcU U ArrowChoiceaabdacdaEitherbcd9|| (||) :: Bool -> Bool -> BoolUUBoolBoolBool Boolean "or"  zipWithM_  zipWithM_ ::  Monad m => (a -> b -> m c) -> [a] -> [b] -> m ()VWVMonadmabmc[]a[]bm()UzipWithM_ is the extension of zipWithM which ignores the final result. zipWithM zipWithM ::  Monad m => (a -> b -> m c) -> [a] -> [b] -> m [c]WdWMonadmabmc[]a[]bm[]cMThe zipWithM function generalizes zipWith to arbitrary monads. AzipWith7zipWith7 :: &(a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h](YX abcdefgh[]a[]b[]c[]d[]e[]f[]g[]hThe zipWith7 function takes a function which combines seven elements, as well as seven lists and returns a list of their point-wise combination, analogous to zipWith. AzipWith6zipWith6 :: !(a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]ZZabcdefg[]a[]b[]c[]d[]e[]f[]gThe zipWith6 function takes a function which combines six elements, as well as six lists and returns a list of their point-wise combination, analogous to zipWith. AzipWith5zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]\Q\abcdef[]a[]b[]c[]d[]e[]fThe zipWith5 function takes a function which combines five elements, as well as five lists and returns a list of their point-wise combination, analogous to zipWith. AzipWith4zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e])^]abcde[]a[]b[]c[]d[]eThe zipWith4 function takes a function which combines four elements, as well as four lists and returns a list of their point-wise combination, analogous to zipWith. AzipWith3 zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]___abcd[]a[]b[]c[]dThe zipWith3 function takes a function which combines three elements, as well as three lists and returns a list of their point-wise combination, analogous to zipWith. AzipWith zipWith ::  (a -> b -> c) -> [a] -> [b] -> [c]``abc[]a[]b[]czipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two lists to produce the list of corresponding sums. (ZipListZipList :: [a] ->  ZipList a/bb[]aZipLista(ZipListnewtype ZipList afbLists, but with an Applicative functor based on zipping, so that
f <$> ZipList xs1 <*> ... <*> ZipList xsn = ZipList (zipWithn f xs1 ... xsn)
Azip7zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)][dc[]a[]b[]c[]d[]e[]f[]g[](,,,,,,)abcdefghThe zip7 function takes seven lists and returns a list of seven-tuples, analogous to zip. Azip6zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]e^e[]a[]b[]c[]d[]e[]f[](,,,,,)abcdefdThe zip6 function takes six lists and returns a list of six-tuples, analogous to zip. Azip5zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]ff[]a[]b[]c[]d[]e[](,,,,)abcdefThe zip5 function takes five lists and returns a list of five-tuples, analogous to zip. Azip4 zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]hg[]a[]b[]c[]d[](,,,)abcdeThe zip4 function takes four lists and returns a list of quadruples, analogous to zip. Azip3 zip3 :: [a] -> [b] -> [c] ->  [(a, b, c)]ih[]a[]b[]c[](,,)abcVzip3 takes three lists and returns a list of triples, analogous to zip. Azipzip :: [a] -> [b] -> [(a, b)]ii[]a[]b[](,)abzip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded. ) zeroArrow zeroArrow :: ArrowZero a => a b cjj ArrowZeroaabcyieldyield :: IO ()kkIO()The yield action allows (forces, in a co-operative multitasking implementation) a context-switch to any other currently runnable threads (if any), and is occasionally useful when implementing concurrency abstractions. xorxor ::  Bits a => a -> a -> aelNlBitsaaaaE writeSTRef writeSTRef ::  STRef s a -> a -> ST s ()llSTRefsaaSTs()'Write a new value into an STRef  WriteMode WriteMode :: IOModeVmMmIOMode4 writeIORef writeIORef :: IORef a -> a -> IO ()mmIORefaaIO()'Write a new value into an IORef  writeFile writeFile :: FilePath -> String -> IO ()xnYnFilePathStringIO()wThe computation writeFile file str function writes the string str, to the file file. ( WrappedMonadnewtype  WrappedMonad m a2o( WrappedArrownewtype  WrappedArrow a b cwo( WrapMonad WrapMonad :: m a -> WrappedMonad m aooma WrappedMonadma( WrapArrow WrapArrow :: a b c -> WrappedArrow a b copHpabc WrappedArrowabcAwordswords :: String -> [String]ppString[]String[words breaks a string up into a list of words, which were delimited by white space. K wordPtrToPtr wordPtrToPtr :: WordPtr -> Ptr aqqWordPtrPtra+casts a WordPtr to a Ptr KWordPtrdata WordPtrqUAn unsigned integral type that can be losslessly converted to and from Ptr.  Word8data Word8wr8-bit unsigned integer type  Word64data Word64r64-bit unsigned integer type  Word32data Word32s32-bit unsigned integer type  Word16data Word16]s16-bit unsigned integer type  Worddata WordsNA Word is an unsigned integral type, with the same size as Int. T withProgName withProgName :: String -> IO a -> IO attWtStringIOaIOa{withProgName name act - while executing action act, have getProgName return name. LwithForeignPtrwithForeignPtr ::  ForeignPtr a -> (Ptr a -> IO b) -> IO bugu ForeignPtraPtraIObIObmThis is a way to look at the pointer living inside a foreign object. This function takes a function which is applied to that pointer. The resulting IO action is then executed. The foreign object is kept alive at least during the whole action, even if it is not used directly inside. Note that it is not safe to return the pointer from the action and use it after the action completes. All uses of the pointer should be inside the withForeignPtr bracket. The reason for this unsafeness is the same as for unsafeForeignPtrToPtr below: the finalizer may run earlier than expected, because the compiler can only track usage of the ForeignPtr object, not a Ptr object made from it. This function is normally used for marshalling data to or from the object pointed to by the ForeignPtr, using the operations from the Storable class. withFile withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO ryyFilePathIOModeHandleIOrIOrwithFile name mode act opens a file using openFile and passes the resulting handle to the computation act. The handle will be closed on exit from withFile, whether by normal termination or by raising an exception. withBinaryFile withBinaryFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO rg{6{FilePathIOModeHandleIOrIOrwithBinaryFile name mode act opens a file using openBinaryFile and passes the resulting handle to the computation act. The handle will be closed on exit from withBinaryFile, whether by normal termination or by raising an exception. TwithArgswithArgs :: [String] -> IO a -> IO a||[]StringIOaIOaswithArgs args act - while executing action act, have getArgs return args. whenwhen ::  Monad m => Bool -> m () -> m ()}}MonadmBoolm()m()Conditional execution of monadic expressions. For example,
when debug (putStr "Debugging\n")
will output the string Debugging\n if the Boolean value debug is True, and otherwise do nothing. I versionTags versionTags :: Version -> [String]B(Version[]StringA version can be tagged with an arbitrary list of strings. The interpretation of the list of tags is entirely dependent on the entity that this version applies to. I versionBranch versionBranch :: Version -> [Int]T=Version[]IntOThe numeric branch for this version. This reflects the fact that most software versions are tree-structured; there is a main trunk which is tagged with versions at various points (1,2,3...), and the first branch off the trunk after version 3 is 3.1, the second branch off the trunk after version 3 is 3.2, and so on. The tree can be branched arbitrarily, just by adding more digits. We represent the branch as a list of Int, so version 3.2.1 becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of Ord for [Int]) gives the natural ordering of branches. IVersionVersion :: [Int] -> [String] -> Version'[]Int[]StringVersionIVersiondata VersionYA Version represents the version of a software entity. An instance of Eq is provided, which implements exact equality modulo reordering of the tags in the versionTags field. An instance of Ord is also provided, which gives lexicographic ordering on the versionBranch fields (i.e. 2.1 > 2.0, 1.2.3 > 1.2.2, etc.). This is expected to be sufficient for many uses, but note that you may need to use a more specific ordering for your versioning scheme. For example, some versioning schemes may include pre-releases which have tags "pre1", "pre2", and so on, and these would need to be taken into account when determining ordering. In some cases, date ordering may be more appropriate, so the application would have to look for date tags in the versionTags field and compare those. The bottom line is, don't always assume that compare and other Ord operations are the right thing for every Version. Similarly, concrete representations of versions may differ. One possible concrete representation is provided (see showVersion and parseVersion), but depending on the application a different concrete representation may be more appropriate. % userErrors userErrors ::  Exception ->  Maybe String ExceptionMaybeString:UppercaseLetterUppercaseLetter :: GeneralCategoryGeneralCategoryLu: Letter, Uppercase @update update :: HashTable key val -> key -> val -> IO Bool͉ HashTablekeyvalkeyvalIOBoolUpdates an entry in the hash table, returning True if there was already an entry for this key, or False otherwise. After update there will always be exactly one entry for the given key in the table. insert is more efficient than update if you don't care about multiple entries, or you know for sure that multiple entries can't occur. However, update is more efficient than delete followed by insert. Aunzip7unzip7 :: [(a, b, c, d, e, f, g)] -> #([a], [b], [c], [d], [e], [f], [g]) [](,,,,,,)abcdefg(,,,,,,)[]a[]b[]c[]d[]e[]f[]glThe unzip7 function takes a list of seven-tuples and returns seven lists, analogous to unzip. Aunzip6unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])č][](,,,,,)abcdef(,,,,,)[]a[]b[]c[]d[]e[]fhThe unzip6 function takes a list of six-tuples and returns six lists, analogous to unzip. Aunzip5unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])[](,,,,)abcde(,,,,)[]a[]b[]c[]d[]ejThe unzip5 function takes a list of five-tuples and returns five lists, analogous to unzip. Aunzip4unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])[](,,,)abcd(,,,)[]a[]b[]c[]diThe unzip4 function takes a list of quadruples and returns four lists, analogous to unzip. Aunzip3unzip3 ::  [(a, b, c)] -> ([a], [b], [c])[](,,)abc(,,)[]a[]b[]cgThe unzip3 function takes a list of triples and returns three lists, analogous to unzip. Aunzipunzip :: [(a, b)] ->  ([a], [b])[](,)ab(,)[]a[]biunzip transforms a list of pairs into a list of first components and a list of second components. ( unwrapMonad unwrapMonad :: WrappedMonad m a -> m aĒ WrappedMonadmama( unwrapArrow unwrapArrow :: WrappedArrow a b c -> a b cI" WrappedArrowabcabcAunwordsunwords :: [String] -> String[]StringString_unwords is an inverse operation to words. It joins words with separating spaces. LunsafeForeignPtrToPtrunsafeForeignPtrToPtr ::  ForeignPtr a -> Ptr az ForeignPtraPtraThis function extracts the pointer component of a foreign pointer. This is a potentially dangerous operations, as if the argument to unsafeForeignPtrToPtr is the last usage occurrence of the given foreign pointer, then its finalizer(s) will be run, which potentially invalidates the plain pointer just obtained. Hence, touchForeignPtr must be used wherever it has to be guaranteed that the pointer lives on - i.e., has another usage occurrence. To avoid subtle coding errors, hand written marshalling code should preferably use Foreign.ForeignPtr.withForeignPtr rather than combinations of unsafeForeignPtrToPtr and touchForeignPtr. However, the later routines are occasionally preferred in tool generated marshalling code. < unsafeCoerce unsafeCoerce :: a -> bݗԗabAunlinesunlines :: [String] -> StringC*[]StringStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each. unlessunless ::  Monad m => Bool -> m () -> m ()AMonadmBoolm()m()The reverse of when. UnitUnit :: UnitUnitUnitdata Unit'Uniquedata UniqueAn abstract unique object. Objects of type Unique may be compared for equality and ordering and hashed into Int. AunionBy unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] aaBool[]a[]a[]aKThe unionBy function is the non-overloaded version of union. Aunionunion :: Eq a => [a] -> [a] -> [a]֛Eqa[]a[]a[]avThe union function returns the list union of the two lists. For example,
"dog" `union` "cow" == "dogcw"
Duplicates, and elements of the first list, are removed from the the second list, but if the first list contains duplicates, so will the result. It is a special case of unionBy, which allows the programmer to supply their own equality test. Aunfoldrunfoldr :: (b -> Maybe (a, b)) -> b -> [a]؝bMaybe(,)abb[]a#The unfoldr function is a `dual' to foldr: while foldr reduces a list to a summary value, unfoldr builds a list from a seed value. The function takes the element and returns Nothing if it is done producing the list or returns Just (a,b), in which case, a is a prepended to the list and b is used as the next element in a recursive call. For example,
iterate f == unfoldr (\x -> Just (x, f x))
In some cases, unfoldr can undo a foldr operation:
unfoldr f' (foldr f z xs) == xs
if the following holds:
f' (f x y) = Just (x,y)
f' z       = Nothing
A simple use of unfoldr:
unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10
 [10,9,8,7,6,5,4,3,2,1]
% Underflow Underflow :: ArithExceptionQ@ArithException%UndefinedElementUndefinedElement :: String -> ArrayExceptionѡStringArrayExceptionVAn attempt was made to evaluate an element of an array that had not been initialized. uncurryuncurry ::  (a -> b -> c) -> (a, b) -> cabc(,)abcCuncurry converts a curried function to a function on pairs. %unblockunblock :: IO a -> IO aC.IOaIOaTo re-enable asynchronous exceptions inside the scope of block, unblock can be used. It scopes in exactly the same way, so on exit from unblock asynchronous exception delivery will be disabled again.  typeRepTyCon typeRepTyCon :: TypeRep -> TyConuTypeRepTyCon6Observe the type constructor of a type representation  typeRepKey typeRepKey :: TypeRep -> IO Int'TypeRepIOIntReturns a unique integer associated with a TypeRep. This can be used for making a mapping with TypeReps as the keys, for example. It is guaranteed that t1 == t2 if and only if typeRepKey t1 == typeRepKey t2. It is in the IO monad because the actual value of the key may vary from run to run of the program. You should only rely on the equality property, not any actual key value. The relative ordering of keys has no meaning either.  typeRepArgs typeRepArgs :: TypeRep ->  [TypeRep]kPTypeRep[]TypeRep4Observe the argument types of a type representation  TypeRepdata TypeRepѧjA concrete representation of a (monomorphic) type. TypeRep supports reasonably efficient equality.  typeOfDefault typeOfDefault :: (Typeable1 t, Typeable a) => t a -> TypeRep Typeable1tTypeableataTypeRepLFor defining a Typeable instance from any Typeable1 instance.  typeOf7typeOf7 :: Typeable7 t => t a b c d e f g -> TypeRepƩ Typeable7ttabcdefgTypeRep typeOf6DefaulttypeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRepF Typeable7tTypeableatabcdefgTypeRepMFor defining a Typeable6 instance from any Typeable7 instance.  typeOf6typeOf6 :: Typeable6 t =>  t a b c d e f -> TypeRepm: Typeable6ttabcdefTypeRep typeOf5DefaulttypeOf5Default :: (Typeable6 t, Typeable a) =>  t a b c d e f -> TypeRep- Typeable6tTypeableatabcdefTypeRepMFor defining a Typeable5 instance from any Typeable6 instance.  typeOf5typeOf5 :: Typeable5 t =>  t a b c d e -> TypeRep ڬ Typeable5ttabcdeTypeRep typeOf4DefaulttypeOf4Default :: (Typeable5 t, Typeable a) =>  t a b c d e -> TypeRepŭ Typeable5tTypeableatabcdeTypeRepMFor defining a Typeable4 instance from any Typeable5 instance.  typeOf4typeOf4 :: Typeable4 t =>  t a b c d -> TypeRepp Typeable4ttabcdTypeRep typeOf3DefaulttypeOf3Default :: (Typeable4 t, Typeable a) =>  t a b c d -> TypeRepS Typeable4tTypeableatabcdTypeRepMFor defining a Typeable3 instance from any Typeable4 instance.  typeOf3typeOf3 :: Typeable3 t => t a b c -> TypeRep& Typeable3ttabcTypeRep typeOf2DefaulttypeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRepװ Typeable3tTypeableatabcTypeRepMFor defining a Typeable2 instance from any Typeable3 instance.  typeOf2typeOf2 :: Typeable2 t => t a b -> TypeRep~ Typeable2ttabTypeRep typeOf1DefaulttypeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRepQ Typeable2tTypeableatabTypeRepMFor defining a Typeable1 instance from any Typeable2 instance.  typeOf1typeOf1 :: Typeable1 t => t a -> TypeRep Typeable1ttaTypeRep typeOftypeOf :: Typeable a => a -> TypeRepmTypeableaaTypeRep Typeable7class  Typeable7 tij$Variant for 7-ary type constructors  Typeable6class  Typeable6 t!$Variant for 6-ary type constructors  Typeable5class  Typeable5 t~$Variant for 5-ary type constructors  Typeable4class  Typeable4 t۴$Variant for 4-ary type constructors  Typeable3class  Typeable3 t8$Variant for 3-ary type constructors  Typeable2class  Typeable2 t%Variant for binary type constructors  Typeable1class  Typeable1 t$Variant for unary type constructors  Typeableclass Typeable aNWThe class Typeable allows a concrete representation of a type to be calculated.  tyConString tyConString :: TyCon -> String TyConString1Observe string encoding of a type representation  TyCondata TyConhjAn abstract representation of a type constructor. TyCon objects can be built using mkTyCon. %tryJusttryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)F ExceptionMaybebIOaIOEitherbaA variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown. %trytry :: IO a -> IO (Either Exception a)IOaIOEither ExceptionaSimilar to catch, but returns an Either result which is (Right a) if no exception was raised, or (Left e) if an exception was raised and its value is e.
try a = catch (Right `liftM` a) (return . Left)
Note: as with catch, it is only polite to use this variant if you intend to re-throw the exception after performing whatever cleanup is needed. Otherwise, tryJust is generally considered to be better. Also note that System.IO.Error also exports a function called System.IO.Error.try with a similar type to try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module). 9TrueTrue :: BoolȼBool? traverse_ traverse_ :: (Foldable t, Applicative f) =>  (a -> f b) -> t a -> f ()GFoldablet Applicativefafbtaf()qMap each element of a structure to an action, evaluate these actions from left to right, and ignore the results. Htraversetraverse :: "(Traversable t, Applicative f) =>  (a -> f b) -> t a -> f (t b)ƾ} Traversablet ApplicativefafbtaftbH Traversableclass (Functor t, Foldable t) =>  Traversable tFunctors representing data structures that can be traversed from left to right. Minimal complete definition: traverse or sequenceA. Instances are similar to Functor, e.g. given a data type
data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
a suitable instance would be
instance Traversable Tree
   traverse f Empty = pure Empty
   traverse f (Leaf x) = Leaf <$> f x
   traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r
This is suitable even for abstract types, as the laws for <*> imply a form of associativity. The superclass instances should satisfy the following:
  • In the Functor instance, fmap should be equivalent to traversal with the identity applicative functor (fmapDefault).
  • In the Foldable instance, Data.Foldable.foldMap should be equivalent to traversal with a constant applicative functor (foldMapDefault).
A transpose transpose :: [[a]] -> [[a]]xW[][]a[][]aThe transpose function transposes the rows and columns of its argument. For example,
transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]
Jtracetrace :: String -> a -> audStringaaWhen called, trace outputs the string in its first argument, before returning the second argument as its result. The trace function is not referentially transparent, and should only be used for debugging, or for monitoring execution. Some implementations of trace may decorate the string that's output to indicate that you're tracing. The function is implemented on top of putTraceMsg. :toUppertoUpper :: Char -> ChariZCharCharlConvert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged. LtouchForeignPtrtouchForeignPtr ::  ForeignPtr a -> IO ()S5 ForeignPtraIO()This function ensures that the foreign object in question is alive at the given place in the sequence of IO actions. In particular Foreign.ForeignPtr.withForeignPtr does a touchForeignPtr after it executes the user action. Note that this function should not be used to express dependencies between finalizers on ForeignPtrs. For example, if the finalizer for a ForeignPtr F1 calls touchForeignPtr on a second ForeignPtr F2, then the only guarantee is that the finalizer for F2 is never started before the finalizer for F1. They might be started together if for example both F1 and F2 are otherwise unreachable, and in that case the scheduler might end up running the finalizer for F2 first. In general, it is not recommended to use finalizers on separate objects with ordering constraints between them. To express the ordering robustly requires explicit synchronisation using MVars between the finalizers, but even then the runtime sometimes runs multiple finalizers sequentially in a single thread (for performance reasons), so synchronisation between finalizers could result in artificial deadlock. Another alternative is to use explicit reference counting. :toTitletoTitle :: Char -> CharCharCharConvert a letter to the corresponding title-case or upper-case letter, if any. (Title case differs from upper case only for a small number of ligature letters.) Any other character is returned unchanged. :toLowertoLower :: Char -> CharCharCharlConvert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged. @toListtoList :: HashTable key val -> IO [(key, val)] HashTablekeyvalIO[](,)keyval4Converts a hash table to a list of key/value pairs. ?toListtoList :: Foldable t => t a -> [a]hEFoldabletta[]a!List of elements of a structure. toDyntoDyn :: Typeable a => a -> DynamicTypeableaaDynamicoConverts an arbitrary value into an object of type Dynamic. The type of the object must be an instance of Typeable, which ensures that only monomorphically-typed objects may be converted to Dynamic. To convert a polymorphic object into Dynamic, give it a monomorphic type signature. For example:
toDyn (id :: Int -> Int)
:TitlecaseLetterTitlecaseLetter :: GeneralCategoryGeneralCategoryLt: Letter, Titlecase &timeouttimeout :: Int -> IO a ->  IO (Maybe a)b?IntIOaIOMaybea^Wrap an IO computation to time out and return Nothing in case no result is available within n microseconds (1/10^6 seconds). In case a result is available before the timeout expires, Just a is returned. A negative timeout interval means "wait indefinitely". When specifying long timeouts, be careful not to exceed maxBound :: Int. The design of this combinator was guided by the objective that timeout n f should behave exactly the same as f as long as f doesn't time out. This means that f has the same myThreadId it would have without the timeout wrapper. Any exceptions f might throw cancel the timeout and propagate further up. It also possible for f to receive exceptions thrown to it by another thread. A tricky implementation detail is the question of how to abort an IO computation. This combinator relies on asynchronous exceptions internally. The technique works very well for computations executing inside of the Haskell runtime system, but it doesn't work at all for non-Haskell code. Foreign function calls, for example, cannot be timed out with this combinator simply because an arbitrary C function cannot receive asynchronous exceptions. When timeout is used to wrap an FFI call that blocks, no timeout event can be delivered until the FFI call returns, which pretty much negates the purpose of the combinator. In practice, however, this limitation is less severe than it may sound. Standard I/O functions like System.IO.hGetBuf, System.IO.hPutBuf, Network.Socket.accept, or System.IO.hWaitForInput appear to be blocking, but they really don't because the runtime system uses scheduling mechanisms like select(2) to perform asynchronous I/O, so it is possible to interrupt standard socket I/O or file I/O using this combinator. %throwTothrowTo :: ThreadId ->  Exception -> IO ()C!ThreadId ExceptionIO()7throwTo raises an arbitrary exception in the target thread (GHC only). throwTo does not return until the exception has been raised in the target thread. The calling thread can thus be certain that the target thread has received the exception. This is a useful property to know when dealing with race conditions: eg. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other. If the target thread is currently making a foreign call, then the exception will not be raised (and hence throwTo will not return) until the call has completed. This is the case regardless of whether the call is inside a block or not. Important note: the behaviour of throwTo differs from that described in the paper "Asynchronous exceptions in Haskell" (http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, throwTo is non-blocking; but the library implementation adopts a more synchronous design in which throwTo does not return until the exception is received by the target thread. The trade-off is discussed in Section 8 of the paper. Like any blocking operation, throwTo is therefore interruptible (see Section 4.3 of the paper). There is currently no guarantee that the exception delivered by throwTo will be delivered at the first possible opportunity. In particular, if a thread may unblock and then re-block exceptions (using unblock and block) without receiving a pending throwTo. This is arguably undesirable behaviour. throwTothrowTo :: ThreadId ->  Exception -> IO ()ThreadId ExceptionIO()7throwTo raises an arbitrary exception in the target thread (GHC only). throwTo does not return until the exception has been raised in the target thread. The calling thread can thus be certain that the target thread has received the exception. This is a useful property to know when dealing with race conditions: eg. if there are two threads that can kill each other, it is guaranteed that only one of the threads will get to kill the other. If the target thread is currently making a foreign call, then the exception will not be raised (and hence throwTo will not return) until the call has completed. This is the case regardless of whether the call is inside a block or not. Important note: the behaviour of throwTo differs from that described in the paper "Asynchronous exceptions in Haskell" (http://research.microsoft.com/~simonpj/Papers/asynch-exns.htm). In the paper, throwTo is non-blocking; but the library implementation adopts a more synchronous design in which throwTo does not return until the exception is received by the target thread. The trade-off is discussed in Section 8 of the paper. Like any blocking operation, throwTo is therefore interruptible (see Section 4.3 of the paper). There is currently no guarantee that the exception delivered by throwTo will be delivered at the first possible opportunity. In particular, if a thread may unblock and then re-block exceptions (using unblock and block) without receiving a pending throwTo. This is arguably undesirable behaviour. %throwIOthrowIO ::  Exception -> IO a ExceptionIOaA variant of throw that can be used within the IO monad. Although throwIO has a type that is an instance of the type of throw, the two functions are subtly different:
throw e   `seq` x  ===> throw e
throwIO e `seq` x  ===> x
The first example will cause the exception e to be raised, whereas the second one won't. In fact, throwIO will only cause an exception to be raised when it is used within the IO monad. The throwIO variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other IO operations, whereas throw does not. % throwDynTo throwDynTo :: Typeable exception => ThreadId ->  exception -> IO ()Typeable exceptionThreadId exceptionIO()wA variant of throwDyn that throws the dynamic exception to an arbitrary thread (GHC only: c.f. throwTo). %throwDynthrowDyn :: Typeable exception =>  exception -> bTypeable exception exceptionbNRaise any value as an exception, provided it is in the Typeable class. %throwthrow ::  Exception -> a Exceptiona}Throw an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad. threadWaitWritethreadWaitWrite :: Fd -> IO ()FdIO()\Block the current thread until data can be written to the given file descriptor (GHC only). threadWaitReadthreadWaitRead :: Fd -> IO ()\KFdIO()bBlock the current thread until data is available to read on the given file descriptor (GHC only). % ThreadKilled ThreadKilled :: AsyncException AsyncExceptionThis exception is raised by another thread calling Control.Concurrent.killThread, or by the system if it needs to terminate the thread for some reason. ThreadIddata ThreadId?A ThreadId is an abstract type representing a handle to a thread. ThreadId is an instance of Eq, Ord and Show, where the Ord instance implements an arbitrary total ordering over ThreadIds. The Show instance lets you convert an arbitrary-valued ThreadId to string form; showing a ThreadId value is occasionally useful when debugging or diagnosing the behaviour of a concurrent program. Note: in GHC, if you have a ThreadId, you essentially have a pointer to the thread itself. This means the thread itself can't be garbage collected until you drop the ThreadId. This misfeature will hopefully be corrected at a later date. Note: Hugs does not provide any operations on other threads; it defines ThreadId as a synonym for ().  threadDelay threadDelay :: Int -> IO ()tIntIO()Suspends the current thread for a given number of microseconds (GHC only). There is no guarantee that the thread will be rescheduled promptly when the delay has expired, but the thread will never continue to run earlier than specified. testBittestBit ::  Bits a => a -> Int -> BoolBitsaaIntBoolA takeWhile takeWhile ::  (a -> Bool) -> [a] -> [a]sSaBool[]a[]a/takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:
takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
takeWhile (< 9) [1,2,3] == [1,2,3]
takeWhile (< 0) [1,2,3] == []
Ataketake :: Int -> [a] -> [a] Int[]a[]atake n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs:
take 5 "Hello World!" == "Hello"
take 3 [1,2,3,4,5] == [1,2,3]
take 3 [1,2] == [1,2]
take 3 [] == []
take (-1) [1,2] == []
take 0 [1,2] == []
It is an instance of the more general Data.List.genericTake, in which n may be of any integral type. Atailstails :: [a] -> [[a]][]a[][]aThe tails function returns all final segments of the argument, longest first. For example,
tails "abc" == ["abc", "bc", "c",""]
Atailtail :: [a] -> [a][]a[]aHExtract the elements after the head of a list, which must be non-empty. !SymbolSymbol :: String -> LexemeStringLexeme4Haskell symbol, e.g. >>, :% : Surrogate Surrogate :: GeneralCategory6$GeneralCategoryCs: Other, Surrogate Asumsum ::  Num a => [a] -> aNuma[]aaFThe sum function computes the sum of a finite list of numbers. ?sumsum :: (Foldable t, Num a) => t a -> ag@FoldabletNumataaHThe sum function computes the sum of the numbers of a structure. +SumSum :: a -> Sum aaSuma+Sumnewtype Sum a+Monoid under addition. A stripPrefix stripPrefix :: Eq a => [a] -> [a] ->  Maybe [a]Eqa[]a[]aMaybe[]azThe stripPrefix function drops the given prefix from a list. It returns Nothing if the list did not start with the prefix given, or Just the list after the prefix, if it does.
stripPrefix "foo" "foobar" -> Just "bar"
stripPrefix "foo" "foo" -> Just ""
stripPrefix "foo" "barfoo" -> Nothing
stripPrefix "foo" "barfoobaz" -> Nothing
!StringString :: String -> LexemeStringLexeme)String literal, with escapes interpreted :Stringtype String = [Char]gA String is a list of characters. String constants in Haskell are values of type String. ESTRefdata STRef s a{a value of type STRef s a is a mutable variable in state thread s, containing a value of type a Storableclass Storable aaThe member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types. Memory addresses are represented as values of type Ptr a, for some a which is an instance of class Storable. The type argument to Ptr helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer. All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class Storable facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (Int8, Int16, Int32, Int64), the fixed size Word types (Word8, Word16, Word32, Word64), StablePtr, all types from Foreign.C.Types, as well as Ptr. Minimal complete definition: sizeOf, alignment, one of peek, peekElemOff and peekByteOff, and one of poke, pokeElemOff and pokeByteOff. stdoutstdout :: Handle8/HandleKA handle managing output to the Haskell program's standard output channel. stdinstdin :: HandleHandleKA handle managing input from the Haskell program's standard input channel. stderrstderr :: HandleL C HandleJA handle managing output to the Haskell program's standard error channel. % StackOverflow StackOverflow :: AsyncException  AsyncExceptionThe current thread's stack exceeded its limit. Since an exception has been raised, the thread's stack will certainly be below its limit again, but the programmer should take remedial action immediately. 2 StablePtrdata  StablePtr a A stable pointer is a reference to a Haskell expression that is guaranteed not to be affected by garbage collection, i.e., it will neither be deallocated nor will the value of the stable pointer itself change during garbage collection (ordinary references may be relocated during garbage collection). Consequently, stable pointers can be passed to foreign code, which can treat it as an opaque reference to a Haskell value. A value of type StablePtr a is a stable pointer to a Haskell expression of type a.  splitTyConApp splitTyConApp :: TypeRep -> (TyCon, [TypeRep]) p TypeRep(,)TyCon[]TypeRep&Splits a type constructor application AsplitAtsplitAt :: Int -> [a] ->  ([a], [a])DInt[]a(,)[]a[]aqsplitAt n xs returns a tuple where first element is xs prefix of length n and second element is the remainder of the list:
splitAt 6 "Hello World!" == ("Hello ","World!")
splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
splitAt 1 [1,2,3] == ([1],[2,3])
splitAt 3 [1,2,3] == ([1,2,3],[])
splitAt 4 [1,2,3] == ([1,2,3],[])
splitAt 0 [1,2,3] == ([],[1,2,3])
splitAt (-1) [1,2,3] == ([],[1,2,3])
It is equivalent to (take n xs, drop n xs). splitAt is an instance of the more general Data.List.genericSplitAt, in which n may be of any integral type. Aspanspan ::  (a -> Bool) -> [a] ->  ([a], [a])BaBool[]a(,)[]a[]aspan, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list:
span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3] == ([1,2,3],[])
span (< 0) [1,2,3] == ([],[1,2,3])
span p xs is equivalent to (takeWhile p xs, dropWhile p xs) :SpacingCombiningMarkSpacingCombiningMark :: GeneralCategoryGeneralCategoryMc: Mark, Spacing Combining :SpaceSpace :: GeneralCategoryGeneralCategoryZs: Separator, Space AsortBysortBy :: (a -> a -> Ordering) -> [a] -> [a]}aaOrdering[]a[]aIThe sortBy function is the non-overloaded version of sort. Asortsort ::  Ord a => [a] -> [a]T5Orda[]a[]aThe sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function. (somesome :: Alternative f => f a -> f [a]}R Alternativeffaf[]a One or more. sndsnd :: (a, b) -> b(,)abb(Extract the second component of a pair. sizeOfsizeOf :: Storable a => a -> IntlRStorableaaIntI showVersion showVersion :: Version -> StringVersionStringProvides one possible concrete representation for Version. For a version with versionBranch = [1,2,3] and versionTags = ["tag1","tag2"], the output will be 1.2.3-tag1-tag2.  showsTypeRep showsTypeRep :: TypeRep -> ShowSTypeRepShowSQ showString showString :: String -> ShowS{iStringShowSjutility function converting a String to a show function that simply prepends the string unchanged. Q showsPrec showsPrec ::  Show a => Int -> a -> ShowSdGShowaIntaShowSQshowsshows ::  Show a => a -> ShowSShowaaShowS7equivalent to showsPrec with a precedence of 0. QShowStype ShowS = String -> StringAThe shows functions return a function that prepends the output String to an existing String. This allows constant-time concatenation of results using function composition. Q showParen showParen :: Bool -> ShowS -> ShowSxaBoolShowSShowSxutility function that surrounds the inner show function with parentheses when the Bool parameter is True. : showLitChar showLitChar :: Char -> ShowSP@CharShowSConvert a character to a string using only printable characters, using Haskell source-language escape conventions. For example:
showLitChar '\n' s  =  "\\n" ++ s
Q showListWith showListWith ::  (a -> ShowS) -> [a] -> ShowSiaShowS[]aShowSWShow a list (using square brackets and commas), given a function for showing elements. QshowListshowList ::  Show a => [a] -> ShowSP2Showa[]aShowS> showFixed showFixed :: HasResolution a => Bool -> Fixed a -> String HasResolutionaBoolFixedaString0First arg is whether to chop off trailing zeros QshowCharshowChar :: Char -> ShowS~ n CharShowSkutility function converting a Char to a show function that simply prepends the character unchanged. Qshowshow ::  Show a => a -> StringL!3!ShowaaStringQShowclass Show a{!.Conversion of values to readable Strings. Minimal complete definition: showsPrec or show. Derived instances of Show have the following properties, which are compatible with derived instances of Text.Read.Read:
  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a
the derived instance of Show is equivalent to
instance (Show a) => Show (Tree a) where

       showsPrec d (Leaf m) = showParen (d > app_prec) $
            showString "Leaf " . showsPrec (app_prec+1) m
         where app_prec = 10

       showsPrec d (u :^: v) = showParen (d > up_prec) $
            showsPrec (up_prec+1) u . 
            showString " :^: "      .
            showsPrec (up_prec+1) v
         where up_prec = 5
Note that right-associativity of :^: is ignored. For example,
  • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
shiftRshiftR ::  Bits a => a -> Int -> a**BitsaaIntashiftLshiftL ::  Bits a => a -> Int -> a*r*BitsaaIntashiftshift ::  Bits a => a -> Int -> a**BitsaaInta%setUncaughtExceptionHandlersetUncaughtExceptionHandler :: (Exception -> IO ()) -> IO ()+z+ ExceptionIO()IO()setBitsetBit ::  Bits a => a -> Int -> a,+BitsaaInta? sequenceA_ sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f (),~,Foldablet Applicativeftfaf()REvaluate each action in the structure from left to right, and ignore the results. H sequenceA sequenceA :: "(Traversable t, Applicative f) => t (f a) -> f (t a)-}- Traversablet Applicativeftfafta? sequence_ sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()Y.%.FoldabletMonadmtmam()ZEvaluate each monadic action in the structure from left to right, and ignore the results.  sequence_ sequence_ ::  Monad m => [m a] -> m ()0/ /Monadm[]mam()QEvaluate each action in the sequence from left to right, and ignore the results. Hsequencesequence :: (Traversable t, Monad m) => t (m a) -> m (t a)'0/ TraversabletMonadmtmamtasequencesequence ::  Monad m => [m a] -> m [a]0}0Monadm[]mam[]aREvaluate each action in the sequence from left to right, and collect the results. SeekModedata SeekMode.1SA mode that determines the effect of hSeek hdl mode i, as follows:  SeekFromEnd SeekFromEnd :: SeekMode11SeekModeSthe position of hdl is set to offset i from the end of the file. )secondsecond ::  Arrow a => a b c -> a (d, b) (d, c)2~2Arrowaabca(,)db(,)dcAscanr1scanr1 ::  (a -> a -> a) -> [a] -> [a]333aaa[]a[]aPscanr1 is a variant of scanr that has no starting value argument. Ascanr scanr ::  (a -> b -> b) -> b -> [a] -> [b] 43abbb[]a[]buscanr is the right-to-left dual of scanl. Note that
head (scanr f z xs) == foldr f z xs.
Ascanl1scanl1 ::  (a -> a -> a) -> [a] -> [a]44aaa[]a[]ascanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
Ascanl scanl ::  (a -> b -> a) -> a -> [b] -> [a]65abaa[]b[]ascanl 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.
) runKleisli runKleisli ::  Kleisli m a b -> a -> m b7l7KleislimabambrunInUnboundThreadrunInUnboundThread :: IO a -> IO a87IOaIOa=Run the IO computation passed as the first argument. If the calling thread is bound, an unbound thread is created temporarily using forkIO. runInBoundThread doesn't finish until the IO computation finishes. Use this function only in the rare case that you have actually observed a performance loss due to the use of bound threads. A program that doesn't need it's main thread to be bound and makes heavy use of concurrency (e.g. a web server), might want to wrap it's main action in runInUnboundThread. runInBoundThreadrunInBoundThread :: IO a -> IO a::IOaIOaRun the IO computation passed as the first argument. If the calling thread is not bound, a bound thread is created temporarily. runInBoundThread doesn't finish until the IO computation finishes. You can wrap a series of foreign function calls that rely on thread-local state with runInBoundThread so that you can use them without knowing whether the current thread is bound. rtsSupportsBoundThreadsrtsSupportsBoundThreads :: Bool<<BoolTrue if bound threads are supported. If rtsSupportsBoundThreads is False, isCurrentThreadBound will always return False and both forkOS and runInBoundThread will fail. rotateRrotateR ::  Bits a => a -> Int -> a==BitsaaIntarotateLrotateL ::  Bits a => a -> Int -> ap>W>BitsaaIntarotaterotate ::  Bits a => a -> Int -> a>>BitsaaInta)rightright :: ArrowChoice a => a b c -> a (Either d b) (Either d c)?M? ArrowChoiceaabcaEitherdbEitherdc$RightRight :: b ->  Either a b??bEitherabAreversereverse :: [a] -> [a]H@3@[]a[]amreverse xs returns the elements of xs in reverse order. xs must be finite. )returnAreturnA ::  Arrow a => a b bA@ArrowaabbMThe identity arrow, which plays the role of return in arrow notation. returnreturn ::  Monad m => a -> m aAAMonadmama> resolution resolution :: HasResolution a => a -> IntegerFB#B HasResolutionaaInteger replicateM_ replicateM_ ::  Monad m => Int -> m a -> m ()BBMonadmIntmam()1Like replicateM, but discards the result.  replicateM replicateM ::  Monad m => Int -> m a -> m [a]CkCMonadmIntmam[]a^replicateM n act performs the action n times, gathering the results. A replicate replicate :: Int -> a -> [a]]DIDInta[]aArepeatrepeat :: a -> [a]DDa[]aZrepeat x is an infinite list, with x the value of every element.  RelativeSeek RelativeSeek :: SeekModeWELESeekModeTthe position of hdl is set to offset i from the current position. % RecUpdError RecUpdError :: String ->  ExceptionFFString Exception7An attempt was made to update a field in a record, where the record doesn't have the requested field. This can only occur with multi-constructor records, when one or more fields are missing from some of the constructors. The String argument gives the location of the record update in the source program. % RecSelError RecSelError :: String ->  ExceptionGGString Exception'A field selection was attempted on a constructor that doesn't have the requested field. This can happen with multi-constructor records when one or more fields are missing from some of the constructors. The String argument gives the location of the record selection in the source program. % RecConError RecConError :: String ->  ExceptionMI7IString ExceptionAn attempt was made to evaluate a field of a record for which no value was given at construction time. The String argument gives the location of the record construction in the source program. ;realPartrealPart :: RealFloat a =>  Complex a -> aJnJ RealFloataComplexaa,Extracts the real part of a complex number.  ReadWriteMode ReadWriteMode :: IOMode KKIOModeE readSTRef readSTRef ::  STRef s a -> ST s a|K^KSTRefsaSTsa"Read the value of an STRef ! readsPrec readsPrec ::  Read a => Int -> ReadS aLKReadaIntReadSa!readsreads ::  Read a => ReadS alLTLReadaReadSa7equivalent to readsPrec with a precedence of 0. !ReadStype ReadS a = String -> [(a, String)]L A parser for a type a, represented as a function that takes a String and returns a list of possible parses as (a,String) pairs. Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ReadP). !readPrecreadPrec ::  Read a =>  ReadPrec asNXNReadaReadPreca! readParen readParen :: Bool -> ReadS a -> ReadS aNNBoolReadSaReadSareadParen True p parses what p parses, but surrounded with parentheses. readParen False p parses what p parses, but optionally surrounded with parentheses. ReadModeReadMode :: IOModeP PIOModereadLnreadLn ::  Read a => IO ajPUPReadaIOaFThe readLn function combines getLine and readIO. : readLitChar readLitChar ::  ReadS CharQPReadSCharRead a string representation of a character, using Haskell source-language escape conventions, and convert it to the character that it encodes. For example:
readLitChar "\\nHello"  =  [('\n', "Hello")]
!readListPrecDefaultreadListPrecDefault ::  Read a =>  ReadPrec [a]_R>RReadaReadPrec[]apA possible replacement definition for the readListPrec method, defined using readPrec (GHC only). ! readListPrec readListPrec ::  Read a =>  ReadPrec [a]CS"SReadaReadPrec[]a!readListDefaultreadListDefault ::  Read a =>  ReadS [a]SSReadaReadS[]aA possible replacement definition for the readList method (GHC only). This is only needed for GHC, and even then only for Read instances where readListPrec isn't defined as readListPrecDefault. !readListreadList ::  Read a =>  ReadS [a]TTReadaReadS[]a4 readIORef readIORef :: IORef a -> IO aaUIUIORefaIOa"Read the value of an IORef readIOreadIO ::  Read a => String -> IO aUUReadaStringIOaThe readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program. readFilereadFile :: FilePath ->  IO StringVVFilePathIOStringThe readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents. !readread ::  Read a => String -> aWWReadaStringalThe read function reads input from a string, which must be completely consumed by the input process. !Readclass Read aX Parsing of Strings, producing values. Minimal complete definition: readsPrec (or, for GHC only, readPrec) Derived instances of Read make the following assumptions, which derived instances of Text.Show.Show obey:
  • If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).
  • Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
  • If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
  • The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.
For example, given the declarations
infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a
the derived instance of Read in Haskell 98 is equivalent to
instance (Read a) => Read (Tree a) where

        readsPrec d r =  readParen (d > app_prec)
                         (\r -> [(Leaf m,t) |
                                 ("Leaf",s) <- lex r,
                                 (m,t) <- readsPrec (app_prec+1) s]) r

                      ++ readParen (d > up_prec)
                         (\r -> [(u:^:v,w) |
                                 (u,s) <- readsPrec (up_prec+1) r,
                                 (":^:",t) <- lex s,
                                 (v,w) <- readsPrec (up_prec+1) t]) r

          where app_prec = 10
                up_prec = 5
Note that right-associativity of :^: is unused. The derived instance in GHC is equivalent to
instance (Read a) => Read (Tree a) where

        readPrec = parens $ (prec app_prec $ do
                                 Ident "Leaf" <- lexP
                                 m <- step readPrec
                                 return (Leaf m))

                     +++ (prec up_prec $ do
                                 u <- step readPrec
                                 Symbol ":^:" <- lexP
                                 v <- step readPrec
                                 return (u :^: v))

          where app_prec = 10
                up_prec = 5

        readListPrec = readListPrecDefault
DRationaltype Rational = Ratio IntegerwbArbitrary-precision rational numbers, represented as a ratio of two Integer values. A rational number may be constructed using the % operator. DRatiodata Integral a => Ratio aRcORational numbers, with numerator and denominator of some Integral type. !RatRat :: Rational -> LexemeccRationalLexemeFloating point literal B rangeSize rangeSize :: Ix a => (a, a) -> IntdfdIxa(,)aaIntBrangerange :: Ix a => (a, a) -> [a]ddIxa(,)aa[]aJ putTraceMsg putTraceMsg :: String -> IO ()YeDeStringIO()putTraceMsg function outputs the trace message from IO monad. Usually the output stream is System.IO.stderr but if the function is called from Windows GUI application then the output will be directed to the Windows debug console. putStrLnputStrLn :: String -> IO ()ffStringIO()9The same as putStr, but adds a newline character. putStrputStr :: String -> IO ()=g(gStringIO()UWrite a string to the standard output device (same as hPutStr stdout). putCharputChar :: Char -> IO ()ggCharIO()YWrite a character to the standard output device (same as hPutChar stdout). )purepure ::  Arrow a => (b -> c) -> a b chhArrowabcabc(purepure :: Applicative f => a -> f a'ii Applicativefafa!PuncPunc :: String -> LexemeiliStringLexeme=Punctuation or reserved symbol, e.g. (, :: K ptrToWordPtr ptrToWordPtr :: Ptr a -> WordPtr'jjPtraWordPtr+casts a Ptr to a WordPtr K ptrToIntPtr ptrToIntPtr :: Ptr a -> IntPtrjjPtraIntPtr+casts a Ptr to an IntPtr KPtrdata Ptr akA value of type Ptr a represents a pointer to an object, or an array of objects, which may be marshalled to or from Haskell values of type a. The type a will often be an instance of class Foreign.Storable.Storable which provides the marshalling operations. However this is not essential, and you can provide your own operations to access the pointer. For example you might write small foreign functions to get or set the fields of a C struct. Aproductproduct ::  Num a => [a] -> a\mCmNuma[]aaNThe product function computes the product of a finite list of numbers. ?productproduct :: (Foldable t, Num a) => t a -> a+nnFoldabletNumataaPThe product function computes the product of the numbers of a structure. +ProductProduct :: a ->  Product annaProducta+Productnewtype Product aoMonoid under multiplication. : PrivateUse PrivateUse :: GeneralCategoryotoGeneralCategoryCo: Other, Private Use Z PrintfTypeclass  PrintfType toZThe PrintfType class provides the variable argument magic for printf. Its implementation is intentionally not visible from this module. If you attempt to pass an argument of a type which is not an instance of this class to printf or hPrintf, then the compiler will report it as a missing instance of PrintfArg. Z PrintfArgclass  PrintfArg akqZprintfprintf :: PrintfType r => String -> rqq PrintfTyperStringrFormat a variable number of arguments with the C-style formatting string. The return value is either String or (IO a). The format string consists of ordinary characters and /conversion specifications/, which specify how to format one of the arguments to printf in the output string. A conversion specification begins with the character %, followed by one or more of the following flags:
-      left adjust (default is right adjust)
+      always use a sign (+ or -) for signed conversions
0      pad with zeroes rather than spaces
followed optionally by a field width:
num    field width
*      as num, but taken from argument list
followed optionally by a precision:
.num   precision (number of decimal places)
and finally, a format character:
c      character               Char, Int, Integer, ...
d      decimal                 Char, Int, Integer, ...
o      octal                   Char, Int, Integer, ...
x      hexadecimal             Char, Int, Integer, ...
X      hexadecimal             Char, Int, Integer, ...
u      unsigned decimal        Char, Int, Integer, ...
f      floating point          Float, Double
g      general format float    Float, Double
G      general format float    Float, Double
e      exponent format float   Float, Double
E      exponent format float   Float, Double
s      string                  String
Mismatch between the argument types and the format string will cause an exception to be thrown at runtime. Examples:
> printf "%d\n" (23::Int)
23
> printf "%s %s\n" "Hello" "World"
Hello World
> printf "%.2f\n" pi
3.14
printprint ::  Show a => a -> IO ()xxShowaaIO()The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline. For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
@primeprime :: Int32zzInt320A prime larger than the maximum hash table size ;polarpolar :: RealFloat a =>  Complex a -> (a, a)f{8{ RealFloataComplexa(,)aa pokeElemOff  pokeElemOff :: Storable a => Ptr a -> Int -> a -> IO ()|{StorableaPtraIntaIO() pokeByteOff  pokeByteOff :: Storable a => Ptr b -> Int -> a -> IO ()||StorableaPtrbIntaIO()pokepoke :: Storable a => Ptr a -> a -> IO ()?}}StorableaPtraaIO()KplusPtrplusPtr :: Ptr a -> Int -> Ptr b}}PtraIntPtrb9Advances the given address by the given offset in bytes. >Picotype Pico = Fixed E12&~;phasephase :: RealFloat a =>  Complex a -> a~z~ RealFloataComplexaaW performGC performGC :: IO ()~~IO())Triggers an immediate garbage collection  peekElemOff peekElemOff :: Storable a => Ptr a -> Int -> IO a{StorableaPtraIntIOa peekByteOff peekByteOff :: Storable a => Ptr b -> Int -> IO a<StorableaPtrbIntIOapeekpeek :: Storable a => Ptr a -> IO aStorableaPtraIOa%PatternMatchFailPatternMatchFail :: String ->  Exception'String ExceptionA pattern matching failure. The String argument should contain a descriptive message including the function name, source file and line number. A partition partition ::  (a -> Bool) -> [a] ->  ([a], [a])T$aBool[]a(,)[]a[]aThe partition function takes a predicate a list and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e.,
partition p xs == (filter p xs, filter (not . p) xs)
I parseVersion parseVersion ::  ReadP VersionReadPVersionDA parser for versions in the format produced by showVersion. !parensparens ::  ReadPrec a ->  ReadPrec aJ)ReadPrecaReadPreca(parens p) parses "P", "(P0)", "((P0))", etc, where p parses "P" in the current precedence context and parses "P0" in precedence context zero :ParagraphSeparatorParagraphSeparator :: GeneralCategoryTBGeneralCategoryZp: Separator, Paragraph %OverflowOverflow :: ArithExceptionArithException9 otherwise otherwise :: BoolBoolotherwise is defined as the value True. It helps to make guards more readable. eg.
f x | x < 0     = ...
    | otherwise = ...
: OtherSymbol OtherSymbol :: GeneralCategoryGeneralCategorySo: Symbol, Other :OtherPunctuationOtherPunctuation :: GeneralCategoryucGeneralCategoryPo: Punctuation, Other : OtherNumber OtherNumber :: GeneralCategoryևGeneralCategoryNo: Number, Other : OtherLetter OtherLetter :: GeneralCategoryVDGeneralCategoryLo: Letter, Other Vosos :: StringString6The operating system on which the program is running. COrderingdata Ordering Represents an ordering relationship between two values: less than, equal to, or greater than. An Ordering is returned by compare. :ordord :: Char -> Int؉CharIntCThe Prelude.fromEnum method restricted to the type Data.Char.Char. COrdclass Eq a => Ord a^The Ord class is used for totally ordered datatypes. Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects. Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types. Aoror :: [Bool] -> BoolČ[]BoolBoolor returns the disjunction of a Boolean list. For the result to be False, the list must be finite; True, however, results from a True value at a finite index of a finite or infinite list. ?oror :: Foldable t => t Bool -> Bool FoldablettBoolBoolor returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end. (optionaloptional :: Alternative f => f a ->  f (Maybe a)m? AlternativeffafMaybea One or none.  openTempFile openTempFile :: FilePath -> String -> IO (FilePath, Handle)&FilePathStringIO(,)FilePathHandleThe function creates a temporary file in ReadWrite mode. The created file isn't deleted automatically, so you need to delete it manually. The file is creates with permissions such that only the current user can read/write it. With some exceptions (see below), the file will be created securely in the sense that an attacker should not be able to cause openTempFile to overwrite another file on the filesystem using your credentials, by putting symbolic links (on Unix) in the place where the temporary file is to be created. On Unix the O_CREAT and O_EXCL flags are used to prevent this attack, but note that O_EXCL is sometimes not supported on NFS filesystems, so if you rely on this behaviour it is best to use local filesystems only. :OpenPunctuationOpenPunctuation :: GeneralCategorywGeneralCategoryPs: Punctuation, Open openFileopenFile :: FilePath -> IOMode ->  IO Handle&FilePathIOModeIOHandle/Computation openFile file mode allocates and returns a new, open handle to manage the file file. It manages input if mode is ReadMode, output if mode is WriteMode or AppendMode, and both input and output if mode is ReadWriteMode. If the file does not exist and it is opened for output, it should be created as a new file. If mode is WriteMode and the file already exists, then it should be truncated to zero length. Some operating systems delete empty files, so there is no guarantee that the file will exist following an openFile with mode WriteMode unless it is subsequently written to successfully. The handle is positioned at the end of the file if mode is AppendMode, and otherwise at the beginning (in which case its internal position is 0). The initial buffer mode is implementation-dependent. This operation may fail with: Note: if you will be working with files containing binary data, you'll want to be using openBinaryFile. openBinaryTempFileopenBinaryTempFile :: FilePath -> String -> IO (FilePath, Handle) ٙFilePathStringIO(,)FilePathHandlejLike openTempFile, but opens the file in binary mode. See openBinaryFile for more comments. openBinaryFileopenBinaryFile :: FilePath -> IOMode ->  IO Handle FilePathIOModeIOHandleLike openFile, but open the file in binary mode. On Windows, reading a file in text mode (which is the default) will translate CRLF to LF, and writing will translate LF to CRLF. This is usually what you want with text files. With binary files this is undesirable; also, as usual under Microsoft operating systems, text mode treats control-Z as EOF. Binary mode turns off all special treatment of end-of-line and end-of-file characters. (See also hSetBinaryMode.) 5on on ::  (b -> b -> c) -> (a -> b) -> a -> a -> cwXbbcabaacz(*) `on` f = \x y -> f x * f y. Typical usage: Data.List.sortBy (compare `on` fst). Algebraic properties:
  • (*) `on` id = (*) (if (*) {, const })
  • ((*) `on` f) `on` g = (*) `on` (f . g)
  • flip on f . flip on g = flip on (g .
    f)
D numerator numerator :: Integral a => Ratio a -> akJIntegralaRatioaaExtract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive. KnullPtrnullPtr :: Ptr a7,Ptra~The constant nullPtr contains a distinguished value of Ptr that is not associated with a valid memory location. K nullFunPtr nullFunPtr :: FunPtr aFunPtraThe constant nullFunPtr contains a distinguished value of FunPtr that is not associated with a valid memory location. Anullnull :: [a] -> Boolڡȡ[]aBoolTest whether a list is empty. AnubBynubBy :: (a -> a -> Bool) -> [a] -> [a]xUaaBool[]a[]aThe nubBy function behaves just like nub, except it uses a user-supplied equality predicate instead of the overloaded == function. Anubnub :: Eq a => [a] -> [a]sUEqa[]a[]aThe nub function removes duplicate elements from a list. In particular, it keeps only the first occurrence of each element. (The name nub means `essence'.) It is a special case of nubBy, which allows the programmer to supply their own equality test.  NothingNothing :: Maybe aɤMaybeaAnotElemnotElem :: Eq a => a -> [a] -> BoolB$Eqaa[]aBool/notElem is the negation of elem. ?notElemnotElem :: (Foldable t, Eq a) => a -> t a -> BoolڥFoldabletEqaataBool/notElem is the negation of elem. : NotAssigned NotAssigned :: GeneralCategoryGeneralCategoryCn: Other, Not Assigned 9notnot :: Bool -> BoolBoolBoolBoolean "not" %NonTerminationNonTermination ::  Exception[O Exception~The current thread is stuck in an infinite loop. This exception may or may not be thrown when the program is non-terminating. :NonSpacingMarkNonSpacingMark :: GeneralCategory;)GeneralCategoryMn: Mark, Non-Spacing % NoMethodError NoMethodError :: String ->  ExceptionString ExceptionAn attempt was made to invoke a class method which has no definition in this instance, and there was no default definition given in the class declaration. GHC issues a warning when you compile an instance which has missing methods.  NoBuffering NoBuffering ::  BufferMode BufferMode#buffering is disabled if possible. nmergeIOnmergeIO :: [[a]] -> IO [a]j[][]aIO[]a' newUnique newUnique ::  IO Uniqueڪ˪IOUniqueCreates a new object of type Unique. The value returned will not compare equal to any other value of type Unique returned by previous calls to newUnique. There is no limit on the number of times newUnique may be called. EnewSTRefnewSTRef :: a -> ST s (STRef s a)B$aSTsSTRefsa5Build a new STRef in the current state thread 2 newStablePtr newStablePtr :: a -> IO (StablePtr a)ѬaIO StablePtra>Create a stable pointer referring to the given Haskell value. 4newIORefnewIORef :: a ->  IO (IORef a)yaIOIORefaBuild a new IORef LnewForeignPtrEnv newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a)EFinalizerEnvPtrenvaPtrenvPtraIO ForeignPtraThis variant of newForeignPtr adds a finalizer that expects an environment in addition to the finalized pointer. The environment that will be passed to the finalizer is fixed by the second argument to newForeignPtrEnv. LnewForeignPtr_newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)ܯPtraIO ForeignPtraTurns a plain memory reference into a foreign pointer that may be associated with finalizers by using addForeignPtrFinalizer. L newForeignPtr newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)7 FinalizerPtraPtraIO ForeignPtra(Turns a plain memory reference into a foreign pointer, and associates a finaliser with the reference. The finaliser will be executed after the last reference to the foreign object is dropped. Note that there is no guarantee on how soon the finaliser is executed after the last reference was dropped; this depends on the details of the Haskell storage manager. Indeed, there is no guarantee that the finalizer is executed at all; a program may exit with finalizers outstanding. (This is true of GHC, other implementations may give stronger guarantees).  newForeignPtr newForeignPtr :: Ptr a -> IO () -> IO (ForeignPtr a)ѳPtraIO()IO ForeignPtraTurns a plain memory reference into a foreign object by associating a finalizer - given by the monadic operation - with the reference. The finalizer will be executed after the last reference to the foreign object is dropped. Note that there is no guarantee on how soon the finalizer is executed after the last reference was dropped; this depends on the details of the Haskell storage manager. The only guarantee is that the finalizer runs before the program terminates. @newnew :: key -> key -> Bool -> key -> Int32 -> IO (HashTable key val)dkeykeyBoolkeyInt32IO HashTablekeyvalCreates a new hash table. The following property should hold for the eq and hash functions passed to new:
eq A B  =>  hash A == hash B
%NestedAtomicallyNestedAtomically ::  Exception ExceptionThe runtime detected an attempt to nest one STM transaction inside another one, presumably due to the use of unsafePeformIO with atomically. mzeromzero :: MonadPlus m => m ay MonadPlusmma myThreadId myThreadId ::  IO ThreadIdָIOThreadId>Returns the ThreadId of the calling thread (GHC only). ?msummsum :: (Foldable t, MonadPlus m) => t (m a) -> m aFoldablet MonadPlusmtmama@The sum of a collection of actions, generalizing concat. msummsum :: MonadPlus m => [m a] -> m auL MonadPlusm[]mama8This generalizes the list-based concat function. mplusmplus :: MonadPlus m => m a -> m a -> m a7  MonadPlusmmamama+Monoidclass Monoid ajThe monoid class. A minimal complete definition must supply mempty and mappend, and these should satisfy the monoid laws.  MonadPlusclass  Monad m =>  MonadPlus m6-Monads that also support choice and failure. Monadclass Monad mThe Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Minimal complete definition: >>= and return. Instances of Monad should satisfy the following laws:
return a >>= k  ==  k a
m >>= return  ==  m
m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
Instances of both Monad and Functor should additionally satisfy the law:
fmap f xs  ==  xs >>= return . f
The instances of Monad for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws. E modifySTRef modifySTRef ::  STRef s a -> (a -> a) -> ST s ()STRefsaaaSTs()'Mutate the contents of an STRef 4 modifyIORef modifyIORef :: IORef a -> (a -> a) -> IO ()_>IORefaaaIO()'Mutate the contents of an IORef :ModifierSymbolModifierSymbol :: GeneralCategoryGeneralCategorySk: Symbol, Modifier :ModifierLetterModifierLetter :: GeneralCategory_MGeneralCategoryLm: Letter, Modifier >mod'mod' ::  Real a => a -> a -> aRealaaaa5generalisation of mod to any instance of Real 4 mkWeakIORef mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))IORefaIO()IOWeakIORefa.Make a Weak pointer to an IORef  mkTyConApp mkTyConApp :: TyCon ->  [TypeRep] -> TypeRepmKTyCon[]TypeRepTypeRep2Applies a type constructor to a sequence of types  mkTyConmkTyCon :: String -> TyConStringTyConBuilds a TyCon object representing a type constructor. An implementation of Data.Typeable should ensure that the following holds:
mkTyCon "a" == mkTyCon "a"
;mkPolarmkPolar :: RealFloat a => a -> a ->  Complex a@ RealFloataaaComplexa mkFunTymkFunTy :: TypeRep -> TypeRep -> TypeRepTypeRepTypeRepTypeRepeA special case of mkTyConApp, which applies the function type constructor to a pair of types.  mkAppTymkAppTy :: TypeRep -> TypeRep -> TypeRepTypeRepTypeRepTypeRep&Adds a TypeRep argument to a TypeRep. KminusPtrminusPtr :: Ptr a -> Ptr b -> Int=!PtraPtrbIntComputes the offset required to get from the first to the second argument. We have
p2 == p1 `plusPtr` (p2 `minusPtr` p1)
A minimumBy minimumBy :: (a -> a -> Ordering) -> [a] -> aL+aaOrdering[]aaThe minimumBy function takes a comparison function and a list and returns the least element of the list by the comparison function. The list must be finite and non-empty. ? minimumBy minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> asFoldabletaaOrderingtaaZThe least element of a non-empty structure with respect to the given comparison function. Aminimumminimum ::  Ord a => [a] -> aaHOrda[]aaminimum returns the minimum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of minimumBy, which allows the programmer to supply their own comparison function. ?minimumminimum :: (Foldable t, Ord a) => t a -> aFoldabletOrdataa,The least element of a non-empty structure. Cminmin ::  Ord a => a -> a -> aQ;Ordaaaa>Microtype Micro = Fixed E6mergeIOmergeIO :: [a] -> [a] -> IO [a][]a[]aIO[]a+memptymempty ::  Monoid a => aVEMonoidaa+mconcatmconcat ::  Monoid a => [a] -> aMonoida[]aa maybeToList maybeToList :: Maybe a -> [a]*Maybea[]aThe maybeToList function returns an empty list when given Nothing or a singleton list when not given Nothing.  maybe maybe :: b -> (a -> b) -> Maybe a -> b.babMaybeab The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.  Maybedata Maybe ai-The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error. The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Data.Either.Either type. A maximumBy maximumBy :: (a -> a -> Ordering) -> [a] -> aaaOrdering[]aaThe maximumBy function takes a comparison function and a list and returns the greatest element of the list by the comparison function. The list must be finite and non-empty. ? maximumBy maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> awHFoldabletaaOrderingtaa\The largest element of a non-empty structure with respect to the given comparison function. Amaximummaximum ::  Ord a => [a] -> a8Orda[]aamaximum returns the maximum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of maximumBy, which allows the programmer to supply their own comparison function. ?maximummaximum :: (Foldable t, Ord a) => t a -> apFoldabletOrdataa.The largest element of a non-empty structure. Cmaxmax ::  Ord a => a -> a -> a*Ordaaaa: MathSymbol MathSymbol :: GeneralCategoryrGeneralCategorySm: Symbol, Math +mappendmappend ::  Monoid a => a -> a -> aMonoidaaaa mapMaybemapMaybe :: (a -> Maybe b) -> [a] -> [b]iaMaybeb[]a[]bIThe mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result list. If it just Just b, then b is included in the result list. ?mapM_mapM_ :: (Foldable t, Monad m) =>  (a -> m b) -> t a -> m ()IFoldabletMonadmambtam()xMap each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. mapM_mapM_ ::  Monad m =>  (a -> m b) -> [a] -> m ()`Monadmamb[]am()SmapM_ f is equivalent to sequence_ . map f. HmapMmapM :: (Traversable t, Monad m) =>  (a -> m b) -> t a -> m (t b)V TraversabletMonadmambtamtbmapMmapM ::  Monad m =>  (a -> m b) -> [a] -> m [b].Monadmamb[]am[]bQmapM f is equivalent to sequence . map f. % mapException mapException :: (Exception -> Exception) -> a -> a Exception ExceptionaaoThis function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".  mapAndUnzipM mapAndUnzipM ::  Monad m => (a -> m (b, c)) -> [a] ->  m ([b], [c])IMonadmam(,)bc[]am(,)[]b[]cThe mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state-transforming monad. A mapAccumR  mapAccumR :: (acc -> x -> (acc, y)) -> acc -> [x] ->  (acc, [y])accx(,)accyacc[]x(,)acc[]y The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a list, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new list. A mapAccumL  mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] ->  (acc, [y])baccx(,)accyacc[]x(,)acc[]y The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a list, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new list. Amapmap :: (a -> b) -> [a] -> [b]ab[]a[]bmap f xs is the list obtained by applying f to each element of xs, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]
(manymany :: Alternative f => f a -> f [a]mB Alternativeffaf[]aZero or more. LmallocForeignPtrBytesmallocForeignPtrBytes :: Int -> IO (ForeignPtr a) IntIO ForeignPtraThis function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes. LmallocForeignPtrArray0mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)AStorableaIntIO ForeignPtraThis function is similar to Foreign.Marshal.Array.mallocArray0, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by Foreign.Marshal.Alloc.malloc. LmallocForeignPtrArraymallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)StorableaIntIO ForeignPtraThis function is similar to Foreign.Marshal.Array.mallocArray, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by Foreign.Marshal.Alloc.malloc. LmallocForeignPtrmallocForeignPtr :: Storable a => IO (ForeignPtr a)wStorableaIO ForeignPtraAllocate some memory and return a ForeignPtr to it. The memory will be released automatically when the ForeignPtr is discarded. mallocForeignPtr is equivalent to
do { p <- malloc; newForeignPtr finalizerFree p }
although it may be implemented differently internally: you may not assume that the memory returned by mallocForeignPtr has been allocated with Foreign.Marshal.Alloc.malloc. GHC notes: mallocForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the ForeignPtr does not require a finalizer to free the memory. Use of mallocForeignPtr and associated functions is strongly recommended in preference to newForeignPtr with a finalizer. ; magnitude magnitude :: RealFloat a =>  Complex a -> a! RealFloataComplexaaCLTLT :: Ordering]ROrdering:LowercaseLetterLowercaseLetter :: GeneralCategoryGeneralCategoryLl: Letter, Lowercase %LossOfPrecisionLossOfPrecision :: ArithException9(ArithException)looploop :: ArrowLoop a => a (b, d) (c, d) -> a b c ArrowLoopaa(,)bd(,)cdabcAlookuplookup :: Eq a => a -> [(a, b)] -> Maybe ba3Eqaa[](,)abMaybebIlookup key assocs looks up a key in an association list. @lookuplookup :: HashTable key val -> key -> IO (Maybe val)H HashTablekeyvalkeyIOMaybeval/Looks up the value of a key in the hash table. @ longestChain longestChain :: HashTable key val -> IO [(key, val)] HashTablekeyvalIO[](,)keyval`This function is useful for determining whether your hash function is working well for your data set. It returns the longest chain of key/value pairs in the hash table for which all the keys hash to the same bucket. If this chain is particularly long (say, longer than 14 elements or so), then it might be a good idea to try a different hash function.  listToMaybe listToMaybe :: [a] -> Maybe a[]aMaybeaThe listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list. : LineSeparator LineSeparator :: GeneralCategoryGeneralCategoryZl: Separator, Line Alineslines :: String -> [String]K2String[]String}lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.  LineBuffering LineBuffering ::  BufferMode BufferMode.line-buffering should be enabled if possible. liftM5liftM5 ::  Monad m => !(a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m reMonadma1a2a3a4a5rma1ma2ma3ma4ma5mrfPromote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). liftM4liftM4 ::  Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m rqMonadma1a2a3a4rma1ma2ma3ma4mrfPromote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). liftM3 liftM3 ::  Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m rMonadma1a2a3rma1ma2ma3mrfPromote a function to a monad, scanning the monadic arguments from left to right (cf. liftM2). liftM2 liftM2 ::  Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m rMonadma1a2rma1ma2mrPromote a function to a monad, scanning the monadic arguments from left to right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3]
liftM2 (+) (Just 1) Nothing = Nothing
liftMliftM ::  Monad m =>  (a1 -> r) -> m a1 -> m rQ(Monadma1rma1mrPromote a function to a monad. (liftA3 liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f dC Applicativefabcdfafbfcfd$Lift a ternary function to actions. (liftA2 liftA2 :: Applicative f =>  (a -> b -> c) -> f a -> f b -> f c Applicativefabcfafbfc#Lift a binary function to actions. (liftAliftA :: Applicative f => (a -> b) -> f a -> f b ApplicativefabfafboLift a function to actions. This function may be used as a value for fmap in a Functor instance. !lexPlexP :: ReadPrec Lexeme|ReadPrecLexemeParse a single lexeme : lexLitChar lexLitChar ::  ReadS StringReadSStringRead a string representation of a character, using Haskell source-language escape conventions. For example:
lexLitChar  "\\nHello"  =  [("\\n", "Hello")]
!Lexemedata LexemeHaskell lexemes. !lexlex ::  ReadS String0ReadSStringThe lex function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, lex returns a single successful `lexeme' consisting of the empty string. (Thus lex "" = [("","")].) If there is no legal lexeme at the beginning of the input string, lex fails (i.e. returns []). This lexer is not completely faithful to the Haskell lexical syntax in the following respects:
  • Qualified names are not handled properly
  • Octal and hexadecimal numerics are not recognized as a single token
  • Comments are not treated properly
: LetterNumber LetterNumber :: GeneralCategoryTBGeneralCategoryNl: Number, Letter Alengthlength :: [a] -> Int[]aIntlength returns the length of a finite list as an Int. It is an instance of the more general Data.List.genericLength, the result type of which may be any kind of number. )leftAppleftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)% ArrowApplyaabcaEitherbdEithercdAny instance of ArrowApply can be made into an instance of ArrowChoice by defining left = leftApp. )leftleft :: ArrowChoice a => a b c -> a (Either b d) (Either c d)S ArrowChoiceaabcaEitherbdEithercd$LeftLeft :: a ->  Either a baEitherabAlastlast :: [a] -> a[]aaHExtract the last element of a list, which must be finite and non-empty. +LastLast :: Maybe a -> Last a  MaybeaLasta+Lastnewtype Last a 8Maybe monoid returning the rightmost non-Nothing value. )KleisliKleisli :: a -> m b ->  Kleisli m a b f ambKleislimab)Kleislinewtype Kleisli m a b Kleisli arrows of a monad.  killThread killThread :: ThreadId -> IO ()G 0 ThreadIdIO()killThread terminates the given thread (GHC only). Any work already done by the thread isn't lost: the computation is suspended until required by another thread. The memory used by the thread will be garbage collected if it isn't referenced from anywhere. The killThread function is defined in terms of throwTo:
killThread tid = throwTo tid (AsyncException ThreadKilled)
 JustJust :: a -> Maybe a0  aMaybeajoinjoin ::  Monad m => m (m a) -> m a ~ MonadmmmamaThe join function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level. BIxclass  Ord a => Ix aWThe Ix class is used to map a contiguous subrange of values in a type onto integers. It is used primarily for array indexing (see the array package). The first argument (l,u) of each of these operations is a pair specifying the lower and upper bounds of a contiguous subrange of values. An implementation is entitled to assume the following laws about these operations: Minimal complete instance: range, index and inRange. Aiterateiterate :: (a -> a) -> a -> [a]F/aaa[]aiterate f x returns an infinite list of repeated applications of f to x:
iterate f x == [x, f x, f (f x), ...]
:isUpperisUpper :: Char -> Bool;,CharBoolSelects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj. :isSymbolisSymbol :: Char -> BoolC4CharBoolPSelects Unicode symbol characters, including mathematical and currency symbols. A isSuffixOf isSuffixOf :: Eq a => [a] -> [a] -> BoolEqa[]a[]aBoolThe isSuffixOf function takes two lists and returns True iff the first list is a suffix of the second. Both lists must be finite. IsStringclass IsString amClass for string-like datastructures; used by the overloaded string extension (-foverloaded-strings in GHC). :isSpaceisSpace :: Char -> BoolCharBool{Selects white-space characters in the Latin-1 range. (In Unicode terms, this includes spaces and some control characters.) isSignedisSigned ::  Bits a => a -> BooloBitsaaBool: isSeparator isSeparator :: Char -> BoolCharBool0Selects Unicode space and separator characters. : isPunctuation isPunctuation :: Char -> BoolvgCharBooldSelects Unicode punctuation characters, including various kinds of connectors, brackets and quotes. :isPrintisPrint :: Char -> Bool0!CharBoolaSelects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces). A isPrefixOf isPrefixOf :: Eq a => [a] -> [a] -> BoolEqa[]a[]aBooluThe isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second. : isOctDigit isOctDigit :: Char -> BoolCharBool=Selects ASCII octal digits, i.e. '0'..'7'. :isNumberisNumber :: Char -> Bool~oCharBool`Selects Unicode numeric characters, including digits from various scripts, Roman numerals, etc.  isNothing isNothing :: Maybe a -> BoolA,MaybeaBoolVThe isNothing function returns True iff its argument is Nothing. :isMarkisMark :: Char -> BoolCharBoolbSelects Unicode mark characters, e.g. accents and the like, which combine with preceding letters. :isLowerisLower :: Char -> BoolCharBool<Selects lower-case alphabetic Unicode characters (letters). :isLetterisLetter :: Char -> Bool7(CharBoolSelects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to Data.Char.isAlpha. :isLatin1isLatin1 :: Char -> BoolPACharBoolxSelects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set.  isJustisJust :: Maybe a -> Bool%  MaybeaBool`The isJust function returns True iff its argument is of the form Just _. A isInfixOf isInfixOf :: Eq a => [a] -> [a] -> Bool ! Eqa[]a[]aBoolThe isInfixOf function takes two lists and returns True iff the first list is contained, wholly and intact, anywhere within the second. Example:
isInfixOf "Haskell" "I really like Haskell." -> True
isInfixOf "Ial" "I really like Haskell." -> False
: isHexDigit isHexDigit :: Char -> Bool"r"CharBool{Selects ASCII hexadecimal digits, i.e. '0'..'9', 'a'..'f', 'A'..'F'. isEOFisEOF :: IO Bool?#2#IOBoolgThe computation isEOF is identical to hIsEOF, except that it works only on stdin. :isDigitisDigit :: Char -> Bool##CharBool7Selects ASCII digits, i.e. '0'..'9'. isCurrentThreadBoundisCurrentThreadBound :: IO Bool$$IOBoolReturns True if the calling thread is bound, that is, if it is safe to use foreign libraries that rely on thread-local state from the calling thread. : isControl isControl :: Char -> Bool%%CharBooldSelects control characters, which are the non-printing characters of the Latin-1 subset of Unicode. ZIsCharclass IsChar c)&: isAsciiUpper isAsciiUpper :: Char -> Bool&z&CharBooleSelects ASCII upper-case letters, i.e. characters satisfying both isAscii and isUpper. : isAsciiLower isAsciiLower :: Char -> BoolN'?'CharBooleSelects ASCII lower-case letters, i.e. characters satisfying both isAscii and isLower. :isAsciiisAscii :: Char -> Bool ('CharBooliSelects the first 128 characters of the Unicode character set, corresponding to the ASCII character set. : isAlphaNum isAlphaNum :: Char -> Bool((CharBool Selects alphabetic or numeric digit Unicode characters. Note that numeric digits outside the ASCII range are selected by this function but not by isDigit. Such digits may be part of identifiers but are not used by the printer and reader to represent numbers. :isAlphaisAlpha :: Char -> Bool/* *CharBoolSelects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to Data.Char.isLetter. 4IORefdata IORef a!+*A mutable variable in the IO monad IOModedata IOMode{+% IOExceptiondata  IOException+Exceptions that occur in the IO monad. An IOException records a more specific error type, a descriptive string and maybe the handle that was used when the error was flagged. % IOException IOException ::  IOException ->  Exception,, IOException ExceptionuThese are the standard IO exceptions generated by Haskell's IO operations. See also System.IO.Error. %ioErrorsioErrors ::  Exception ->  Maybe IOError-- ExceptionMaybeIOError%ioErrorioError :: IOError -> IO a6.!.IOErrorIOa0Raise an IOError in the IO monad. IOdata IO a.A value of type IO a is a computation which, when performed, does some I/O before returning a value of type a. There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main. IO is a monad, so IO actions can be combined using either the do-notation or the >> and >>= operations from the Monad class. : intToDigit intToDigit :: Int -> Char{1m1IntCharConvert an Int in the range 0..15 to the corresponding single digit Char. This function fails on other inputs, and generates lower-case hexadecimal digits. K intPtrToPtr intPtrToPtr :: IntPtr -> Ptr a22IntPtrPtra+casts an IntPtr to a Ptr KIntPtrdata IntPtr2RA signed integral type that can be losslessly converted to and from Ptr. A intersperse intersperse :: a -> [a] -> [a]33a[]a[]aThe intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example,
intersperse ',' "abcde" == "a,b,c,d,e"
A intersectBy  intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]!54aaBool[]a[]a[]aSThe intersectBy function is the non-overloaded version of intersect. A intersect intersect :: Eq a => [a] -> [a] -> [a]55Eqa[]a[]a[]a3The intersect function takes the list intersection of two lists. For example,
[1,2,3,4] `intersect` [2,4,6,8] == [2,4]
If the first list contains duplicates, so will the result. It is a special case of intersectBy, which allows the programmer to supply their own equality test. A intercalate intercalate :: [a] -> [[a]] -> [a]77[]a[][]a[]aintercalate xs xss is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result. interactinteract :: (String -> String) -> IO ()88StringStringIO()The interact function takes a function of type String->String 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.  Int8data Int8:8-bit signed integer type  Int64data Int64g:64-bit signed integer type  Int32data Int32:32-bit signed integer type  Int16data Int16:16-bit signed integer type !IntInt :: Integer -> Lexemel;X;IntegerLexemeInteger literal  Intdata Int;A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class. AinsertBy insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]#=<aaOrderinga[]a[]a-The non-overloaded version of insert. Ainsertinsert ::  Ord a => a -> [a] -> [a]==Ordaa[]a[]apThe insert function takes an element and a list and inserts the element into the list at the last position where it is still less than or equal to the next element. In particular, if the list is sorted before the call, the result will also be sorted. It is a special case of insertBy, which allows the programmer to supply their own comparison function. @insert insert :: HashTable key val -> key -> val -> IO ()?? HashTablekeyvalkeyvalIO()Inserts a key/value mapping into the hash table. Note that insert doesn't remove the old entry from the table - the behaviour is like an association list, where lookup returns the most-recently-inserted mapping for a key in the table. The reason for this is to keep insert as efficient as possible. If you need to update a mapping, then we provide update. BinRangeinRange :: Ix a => (a, a) -> a -> BoolAAIxa(,)aaaBoolInrInr :: b -> :+: a b-BBb:+:abInlInl :: a -> :+: a bBlBa:+:abAinitsinits :: [a] -> [[a]]BB[]a[][]aThe inits function returns all initial segments of the argument, shortest first. For example,
inits "abc" == ["","a","ab","abc"]
: InitialQuote InitialQuote :: GeneralCategoryCCGeneralCategoryPi: Punctuation, Initial quote Ainitinit :: [a] -> [a]DD/D[]a[]a^Return all the elements of a list except the last one. The list must be finite and non-empty. %IndexOutOfBoundsIndexOutOfBounds :: String -> ArrayException"EEStringArrayExceptionCAn attempt was made to index an array outside its declared bounds. Bindexindex :: Ix a => (a, a) -> a -> IntEEIxa(,)aaaInt;imagPartimagPart :: RealFloat a =>  Complex a -> a]F9F RealFloataComplexaa1Extracts the imaginary part of a complex number. !IdentIdent :: String -> LexemeFFStringLexeme4Haskell identifier, e.g. foo, Baz 5idid :: a -> a\GSGaaIdentity function.  hWaitForInput hWaitForInput :: Handle -> Int -> IO BoolGGHandleIntIOBoolComputation hWaitForInput hdl t waits until input is available on handle hdl. It returns True as soon as input is available on hdl, or False if no input is available within t milliseconds. If t is less than zero, then hWaitForInput waits indefinitely. This operation may fail with: NOTE for GHC users: unless you use the -threaded flag, hWaitForInput t where t >= 0 will block all other Haskell threads for the duration of the call. It behaves like a safe foreign call in this respect. hTellhTell :: Handle ->  IO IntegerJJHandleIOIntegerhShowhShow :: Handle ->  IO StringaKHKHandleIOStringhShow is in the IO monad, and gives more comprehensive output than the (pure) instance of Show for Handle. hSetPosnhSetPosn ::  HandlePosn -> IO ()QL8L HandlePosnIO()VIf a call to hGetPosn hdl returns a position p, then computation hSetPosn p sets the position of hdl to the position it held at the time of the call to hGetPosn. This operation may fail with:  hSetFileSize hSetFileSize :: Handle -> Integer -> IO (),NNHandleIntegerIO()|hSetFileSize hdl size truncates the physical file with handle hdl to size bytes. hSetEchohSetEcho :: Handle -> Bool -> IO ()OOHandleBoolIO()<Set the echoing status of a handle connected to a terminal.  hSetBuffering hSetBuffering :: Handle ->  BufferMode -> IO ()OOHandle BufferModeIO()uComputation hSetBuffering hdl mode sets the mode of buffering for handle hdl on subsequent reads and writes. If the buffer mode is changed from BlockBuffering or LineBuffering to NoBuffering, then
  • if hdl is writable, the buffer is flushed as for hFlush;
  • if hdl is not writable, the contents of the buffer is discarded.
This operation may fail with:
  • isPermissionError if the handle has already been used for reading or writing and the implementation does not allow the buffering mode to be changed.
hSetBinaryModehSetBinaryMode :: Handle -> Bool -> IO ()RRHandleBoolIO()qSelect binary mode (True) or text mode (False) on a open handle. (See also openBinaryFile.) hSeek hSeek :: Handle -> SeekMode -> Integer -> IO ()SSHandleSeekModeIntegerIO()Computation hSeek hdl mode i sets the position of handle hdl depending on mode. The offset i is given in terms of 8-bit bytes. If hdl is block- or line-buffered, then seeking to a position which is not in the current buffer will first cause any items in the output buffer to be written to the device, and then cause the input buffer to be discarded. Some handles may not be seekable (see hIsSeekable), or only support a subset of the possible positioning operations (for instance, it may only be possible to seek to the end of a tape, or to a positive offset from the beginning or current position). It is not possible to set a negative I/O position, or for a physical file, an I/O position beyond the current end-of-file. This operation may fail with: hReadyhReady :: Handle -> IO BoolWWHandleIOBoolComputation hReady hdl indicates whether at least one item is available for input from handle hdl. This operation may fail with:
  • System.IO.Error.isEOFError if the end of file has been reached.
 hPutStrLn hPutStrLn :: Handle -> String -> IO ()>Y!YHandleStringIO():The same as hPutStr, but adds a newline character. hPutStrhPutStr :: Handle -> String -> IO ()YYHandleStringIO().Computation hPutStr hdl s writes the string s to the file or channel managed by hdl. This operation may fail with: hPutCharhPutChar :: Handle -> Char -> IO ()[{[HandleCharIO()yComputation hPutChar hdl ch writes the character ch to the file or channel managed by hdl. Characters may be buffered if buffering is enabled for hdl. This operation may fail with: hPutBufNonBlocking hPutBufNonBlocking :: Handle -> Ptr a -> Int -> IO Int]]HandlePtraIntIOInthPutBuf hPutBuf :: Handle -> Ptr a -> Int -> IO ()C^^HandlePtraIntIO()hPutBuf hdl buf count writes count 8-bit bytes from the buffer buf to the handle hdl. It returns (). This operation may fail with:
  • ResourceVanished if the handle is a pipe or socket, and the reading end is closed. (If this is a POSIX system, and the program has not asked to ignore SIGPIPE, then a SIGPIPE may be delivered instead, whose default action is to terminate the program).
Z HPrintfTypeclass  HPrintfType tG`The HPrintfType class provides the variable argument magic for hPrintf. Its implementation is intentionally not visible from this module. ZhPrintfhPrintf :: HPrintfType r => Handle -> String -> rpaHa HPrintfTyperHandleStringrSimilar to printf, except that output is via the specified Handle. The return type is restricted to (IO a). hPrinthPrint ::  Show a => Handle -> a -> IO ()|bYbShowaHandleaIO()Computation hPrint hdl t writes the string representation of t given by the shows function to the file or channel managed by hdl and appends a newline. This operation may fail with:
  • System.IO.Error.isFullError if the device is full; or
  • System.IO.Error.isPermissionError if another system resource limit would be exceeded.
 hLookAhead hLookAhead :: Handle -> IO CharodXdHandleIOCharComputation hLookAhead returns the next character from the handle without removing it from the input buffer, blocking until a character is available. This operation may fail with:  hIsWritable hIsWritable :: Handle -> IO BooleeHandleIOBoolhIsTerminalDevicehIsTerminalDevice :: Handle -> IO BoolYfBfHandleIOBool'Is the handle connected to a terminal?  hIsSeekable hIsSeekable :: Handle -> IO BoolffHandleIOBool hIsReadable hIsReadable :: Handle -> IO BoolVg?gHandleIOBoolhIsOpenhIsOpen :: Handle -> IO BoolggHandleIOBoolhIsEOFhIsEOF :: Handle -> IO BoolhhHandleIOBoolyFor a readable handle hdl, hIsEOF hdl returns True if no further input can be taken from hdl or for a physical file, if the current I/O position is equal to the length of the file. Otherwise, it returns False. NOTE: hIsEOF may block, because it is the same as calling hLookAhead and checking for an EOF exception.  hIsClosed hIsClosed :: Handle -> IO BooliiHandleIOBoolhGetPosnhGetPosn :: Handle ->  IO HandlePosnkjNjHandleIO HandlePosnComputation hGetPosn hdl returns the current I/O position of hdl as a value of the abstract type HandlePosn. hGetLinehGetLine :: Handle ->  IO StringakHkHandleIOStringComputation hGetLine hdl reads a line from the file or channel managed by hdl. This operation may fail with:
  • isEOFError if the end of file is encountered when reading the first character of the line.
If hGetLine encounters end-of-file at any other point while reading in a line, it is treated as a line terminator and the (partial) line is returned. hGetEchohGetEcho :: Handle -> IO BoolimRmHandleIOBool<Get the echoing status of a handle connected to a terminal.  hGetContents hGetContents :: Handle ->  IO StringnmHandleIOStringComputation hGetContents hdl returns the list of characters corresponding to the unread portion of the channel or file managed by hdl, which is put into an intermediate state, semi-closed. In this state, hdl is effectively closed, but items are read from hdl on demand and accumulated in a special list returned by hGetContents hdl. Any operation that fails because a handle is closed, also fails if a handle is semi-closed. The only exception is hClose. A semi-closed handle becomes closed:
  • if hClose is applied to it;
  • if an I/O error occurs when reading an item from the handle;
  • or once the entire contents of the handle has been read.
Once a semi-closed handle becomes closed, the contents of the associated list becomes fixed. The contents of this final list is only partially specified: it will contain at least all the items of the stream that were evaluated prior to the handle becoming closed. Any I/O errors encountered while a handle is semi-closed are simply discarded. This operation may fail with: hGetCharhGetChar :: Handle -> IO Char5ssHandleIOCharComputation hGetChar hdl reads a character from the file or channel managed by hdl, blocking until a character is available. This operation may fail with: hGetBufNonBlocking hGetBufNonBlocking :: Handle -> Ptr a -> Int -> IO IntttHandlePtraIntIOInthGetBufNonBlocking hdl buf count reads data from the handle hdl into the buffer buf until either EOF is reached, or count 8-bit bytes have been read, or there is no more data available to read immediately. hGetBufNonBlocking is identical to hGetBuf, except that it will never block waiting for data to become available, instead it returns only whatever data is available. To wait for data to arrive before calling hGetBufNonBlocking, use hWaitForInput. If the handle is a pipe or socket, and the writing end is closed, hGetBufNonBlocking will behave as if EOF was reached.  hGetBuffering hGetBuffering :: Handle ->  IO BufferModewwHandleIO BufferModecComputation hGetBuffering hdl returns the current buffering mode for hdl. hGetBuf hGetBuf :: Handle -> Ptr a -> Int -> IO IntxxHandlePtraIntIOInthGetBuf hdl buf count reads data from the handle hdl into the buffer buf until either EOF is reached or count 8-bit bytes have been read. It returns the number of bytes actually read. This may be zero if EOF was reached before any data was read (or if count is zero). hGetBuf never raises an EOF exception, instead it returns a value smaller than count. If the handle is a pipe or socket, and the writing end is closed, hGetBuf will behave as if EOF was reached. hFlushhFlush :: Handle -> IO ()P{;{HandleIO()The action hFlush hdl causes any items buffered for output in handle hdl to be sent immediately to the operating system. This operation may fail with:
  • isFullError if the device is full;
  • isPermissionError if a system resource limit would be exceeded. It is unspecified whether the characters in the buffer are discarded or retained under these circumstances.
 hFileSize hFileSize :: Handle ->  IO Integeri}O}HandleIOIntegerFor a handle hdl which attached to a physical file, hFileSize hdl returns the size of that file in 8-bit bytes. % HeapOverflow HeapOverflow :: AsyncExceptionN~=~AsyncExceptionThe program's heap is reaching its limit, and the program should take action to reduce the amount of live data it has. Notes:
  • It is undefined which thread receives this exception.
  • GHC currently does not throw HeapOverflow exceptions.
Aheadhead :: [a] -> a[]aa>Extract the first element of a list, which must be non-empty. hClosehClose :: Handle -> IO ()D/HandleIO()Computation hClose hdl makes handle hdl closed. Before the computation finishes, if hdl is writable its buffer is flushed as for hFlush. Performing hClose on a handle that has already been closed has no effect; doing so is not an error. All other operations on a closed handle will fail. If hClose fails for any reason, any further operations (apart from hClose) on the handle will still fail as if hdl had been successfully closed. > HasResolutionclass  HasResolution a}' hashUnique hashUnique :: Unique -> Intۂ˂UniqueIntHashes a Unique into an Int. Two Uniques may hash to the same value, although in practice this is unlikely. The Int returned makes a good hash key. @ HashTabledata  HashTable key valɃ@ hashString hashString :: String -> Int32+StringInt32=A sample hash function for Strings. We keep multiplying by the golden ratio and adding. The implementation is:
hashString = foldl' f golden
  where f m c = fromIntegral (ord c) * magic + hashInt32 m
        magic = 0xdeadbeef
Where hashInt32 works just as hashInt shown above. Knuth argues that repeated multiplication by the golden ratio will minimize gaps in the hash space, and thus it's a good choice for combining together multiple keys to form one. Here we know that individual characters c are often small, and this produces frequent collisions if we use ord c alone. A particular problem are the shorter low ASCII and ISO-8859-1 character strings. We pre-multiply by a magic twiddle factor to obtain a good distribution. In fact, given the following test:
testp :: Int32 -> Int
testp k = (n - ) . length . group . sort . map hs . take n $ ls
  where ls = [] : [c : l | l <- ls, c <- ['\0'..'\xff']]
        hs = foldl' f golden
        f m c = fromIntegral (ord c) * k + hashInt32 m
        n = 100000
We discover that testp magic = 0. @hashInthashInt :: Int -> Int32IntInt32A sample (and useful) hash function for Int and Int32, implemented by extracting the uppermost 32 bits of the 64-bit result of multiplying by a 33-bit constant. The constant is from Knuth, derived from the golden ratio:
golden = round ((sqrt 5 - 1) * 2^32)
We get good key uniqueness on small inputs (a problem with previous versions): (length $ group $ sort $ map hashInt [-32767..65536]) == 65536 + 32768  HandlePosndata  HandlePosn% handleJust  handleJust :: (Exception -> Maybe b) ->  (b -> IO a) -> IO a -> IO a^" ExceptionMaybebbIOaIOaIOaUA version of catchJust with the arguments swapped around (see handle). %handlehandle :: (Exception -> IO a) -> IO a -> IO aB ExceptionIOaIOaIOaA version of catch with the arguments swapped around; useful in situations where the code for the handler is shorter. For example:
do handle (\e -> exitWith (ExitFailure 1)) $
   ...
Handledata HandleAuHaskell defines operations to read and write characters from and to files, represented by values of type Handle. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:
  • whether it manages input or output or both;
  • whether it is open, closed or semi-closed;
  • whether the object is seekable;
  • whether buffering is disabled, or enabled on a line or block basis;
  • a buffer (whose length may be zero).
Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the Show and Eq classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to == only to itself; no attempt is made to compare the internal state of different handles for equality. GHC note: a Handle will be automatically closed when the garbage collector detects that it has become unreferenced by the program. However, relying on this behaviour is not generally recommended: the garbage collector is unpredictable. If possible, use explicit an explicit hClose to close Handles when they are no longer required. GHC does not currently attempt to free up file descriptors when they have run out, it is your responsibility to ensure that this doesn't happen. guardguard :: MonadPlus m => Bool -> m ()* MonadPlusmBoolm()guard b is return () if b is True, and mzero if b is False. CGTGT :: OrderingޕOrderingAgroupBygroupBy :: (a -> a -> Bool) -> [a] -> [[a]]uLaaBool[]a[][]aKThe groupBy function is the non-overloaded version of group. Agroupgroup :: Eq a => [a] -> [[a]]/ Eqa[]a[][]aThe group function takes a list and returns a list of lists 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. ( getZipList getZipList ::  ZipList a -> [a]"ZipLista[]a%getUncaughtExceptionHandlergetUncaughtExceptionHandler :: IO (Exception -> IO ())IO ExceptionIO()+getSumgetSum :: Sum a -> aSumaaT getProgName getProgName ::  IO StringXIIOStringComputation getProgName returns the name of the program as it was invoked. However, this is hard-to-impossible to implement on some non-Unix OSes, so instead, for maximum portability, we just return the leafname of the program as invoked. Even then there are some differences between platforms: on Windows, for example, a program invoked as foo is probably really FOO.EXE, and that is what getProgName will return. + getProduct getProduct ::  Product a -> ar^ProductaagetLinegetLine ::  IO StringIOStringSRead a line from the standard input device (same as hGetLine stdin). +getLastgetLast :: Last a -> Maybe av\LastaMaybea+getFirstgetFirst :: First a -> Maybe aŝFirstaMaybeaTgetEnvironmentgetEnvironment :: IO [(String, String)]Z6IO[](,)StringStringgetEnvironment retrieves the entire environment as a list of (key,value) pairs. If an environment entry does not contain an '=' character, the key is the whole entry and the value is the empty string. TgetEnvgetEnv :: String ->  IO StringStringIOStringComputation getEnv var returns the value of the environment variable var. This computation may fail with:
  • System.IO.Error.isDoesNotExistError if the environment variable does not exist.
+getDualgetDual :: Dual a -> aDualaaS getCPUTime getCPUTime ::  IO IntegerG7IOIntegerComputation getCPUTime returns the number of picoseconds CPU time used by the current program. The precision of this result is implementation-dependent.  getContents getContents ::  IO String:+IOStringThe getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin). (getConstgetConst ::  Const a b -> a7"ConstabagetChargetChar :: IO Char~qIOCharXRead a character from the standard input device (same as hGetChar stdin). TgetArgsgetArgs ::  IO [String])IO[]StringtComputation getArgs returns a list of the program's command line arguments (not including the program name). +getAnygetAny :: Any -> BoolAnyBool+getAllgetAll :: All -> BoolA3AllBoolA genericTake genericTake :: Integral i => i -> [a] -> [a]ХIntegralii[]a[]aThe genericTake function is an overloaded version of take, which accepts any Integral value as the number of elements to take. AgenericSplitAtgenericSplitAt :: Integral i => i -> [b] ->  ([b], [b])٦Integralii[]b(,)[]b[]bThe genericSplitAt function is an overloaded version of splitAt, which accepts any Integral value as the position at which to split. AgenericReplicategenericReplicate :: Integral i => i -> a -> [a];Integraliia[]aThe genericReplicate function is an overloaded version of replicate, which accepts any Integral value as the number of repetitions to make. A genericLength genericLength ::  Num i => [b] -> iM4Numi[]biThe genericLength function is an overloaded version of length. In particular, instead of returning an Int, it returns any type which is an instance of Num. It is, however, less efficient than length. A genericIndex genericIndex :: Integral a => [b] -> a -> bIntegrala[]bab~The genericIndex function is an overloaded version of !!, which accepts any Integral value as the index. A genericDrop genericDrop :: Integral i => i -> [a] -> [a]ΫIntegralii[]a[]aThe genericDrop function is an overloaded version of drop, which accepts any Integral value as the number of elements to drop. :generalCategorygeneralCategory :: Char -> GeneralCategoryެĬCharGeneralCategory/The Unicode general category of the character. :GeneralCategorydata GeneralCategoryOuUnicode General Categories (column 2 of the UnicodeData table) in the order they are listed in the Unicode standard.  gcast2gcast2 :: (Typeable2 t, Typeable2 t') =>  c (t a b) -> Maybe (c (t' a b)); Typeable2t Typeable2t'ctabMaybect'abCast for * -> * -> *  gcast1gcast1 :: (Typeable1 t, Typeable1 t') => c (t a) -> Maybe (c (t' a))_ Typeable1t Typeable1t'ctaMaybect'aCast for * -> *  gcastgcast :: (Typeable a, Typeable b) => c a ->  Maybe (c b)ׯTypeableaTypeablebcaMaybecb9A flexible variation parameterised in a type constructor  funResultTy funResultTy :: TypeRep -> TypeRep ->  Maybe TypeRep߰TypeRepTypeRepMaybeTypeRepApplies a type to a function type. Returns: Just u if the first argument represents a function of type t -> u and the second argument represents a function of type t. Otherwise, returns Nothing. KFunPtrdata FunPtr aA value of type FunPtr a is a pointer to a function callable from foreign code. The type a will normally be a foreign type, a function type with zero or more arguments where
  • the argument types are marshallable foreign types, i.e. Char, Int, Prelude.Double, Prelude.Float, Bool, Data.Int.Int8, Data.Int.Int16, Data.Int.Int32, Data.Int.Int64, Data.Word.Word8, Data.Word.Word16, Data.Word.Word32, Data.Word.Word64, Ptr a, FunPtr a, Foreign.StablePtr.StablePtr a or a renaming of any of these using newtype.
  • the return type is either a marshallable foreign type or has the form Prelude.IO t where t is a marshallable foreign type or ().
A value of type FunPtr a may be a pointer to a foreign function, either returned by another foreign function or imported with a a static address import like
foreign import ccall "stdlib.h &free"
  p_free :: FunPtr (Ptr a -> IO ())
or a pointer to a Haskell function created using a wrapper stub declared to produce a FunPtr of the correct type. For example:
type Compare = Int -> Int -> Bool
foreign import ccall "wrapper"
  mkCompare :: Compare -> IO (FunPtr Compare)
Calls to wrapper stubs like mkCompare allocate storage, which should be released with Foreign.Ptr.freeHaskellFunPtr when no longer required. To convert FunPtr values to corresponding Haskell functions, one can define a dynamic stub for the specific foreign type, e.g.
type IntFunction = CInt -> IO ()
foreign import ccall "dynamic" 
  mkFun :: FunPtr IntFunction -> IntFunction
Functorclass Functor fCThe Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:
fmap id  ==  id
fmap (f . g)  ==  fmap f . fmap g
The instances of Functor for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws. fstfst :: (a, b) -> a(,)aba'Extract the first component of a pair.  fromString fromString :: IsString a => String -> aO2IsStringaStringa fromMaybe fromMaybe :: a -> Maybe a -> aaMaybeaaThe fromMaybe function takes a default value and and Maybe value. If the Maybe is Nothing, it returns the default values; otherwise, it returns the value contained in the Maybe. @fromListfromList ::  Eq key => (key -> Int32) ->  [(key, val)] -> IO (HashTable key val)hEqkeykeyInt32[](,)keyvalIO HashTablekeyvalvConvert a list of key/value pairs into a hash table. Equality on keys is taken from the Eq instance for the key type.  fromJustfromJust :: Maybe a -> a9'Maybeaa~The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.  fromDynamic fromDynamic :: Typeable a => Dynamic -> Maybe aATypeableaDynamicMaybeasConverts a Dynamic object back into an ordinary Haskell value of the correct type. See also fromDyn. fromDynfromDyn :: Typeable a => Dynamic -> a -> a7TypeableaDynamicaawConverts a Dynamic object back into an ordinary Haskell value of the correct type. See also fromDynamic. 2 freeStablePtr freeStablePtr ::  StablePtr a -> IO ()&  StablePtraIO()Dissolve the association between the stable pointer and the Haskell value. Afterwards, if the stable pointer is passed to deRefStablePtr or freeStablePtr, the behaviour is undefined. However, the stable pointer may still be passed to castStablePtrToPtr, but the Foreign.Ptr.Ptr () value returned by castStablePtrToPtr, in this case, is undefined (in particular, it may be Foreign.Ptr.nullPtr). Nevertheless, the call to castStablePtrToPtr is guaranteed not to diverge. KfreeHaskellFunPtrfreeHaskellFunPtr :: FunPtr a -> IO ()FunPtraIO()Release the storage associated with the given FunPtr, which must have been obtained from a wrapper stub. This should be called whenever the return value from a foreign import wrapper function is no longer required; otherwise, the storage it uses will leak. :FormatFormat :: GeneralCategoryGeneralCategoryCf: Other, Format ?forM_forM_ :: (Foldable t, Monad m) => t a ->  (a -> m b) -> m ()~FoldabletMonadmtaambm()9forM_ is mapM_ with its arguments flipped. forM_forM_ ::  Monad m => [a] ->  (a -> m b) -> m ()VMonadm[]aambm()8forM_ is mapM_ with its arguments flipped HforMforM :: (Traversable t, Monad m) => t a ->  (a -> m b) -> m (t b)t1 TraversabletMonadmtaambmtb7forM is mapM with its arguments flipped. forMforM ::  Monad m => [a] ->  (a -> m b) -> m [b]@ Monadm[]aambm[]b6forM is mapM with its arguments flipped forkOSforkOS :: IO () ->  IO ThreadIdIO()IOThreadIdLike forkIO, this sparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. However, forkOS uses operating system-supplied multithreading support to create a new operating system thread. The new thread is bound, which means that all foreign calls made by the IO computation are guaranteed to be executed in this new operating system thread; also, the operating system thread is not used for any other foreign calls. This means that you can use all kinds of foreign libraries from this thread (even those that rely on thread-local state), without the limitations of forkIO. Just to clarify, forkOS is only necessary if you need to associate a Haskell thread with a particular OS thread. It is not necessary if you only need to make non-blocking foreign calls (see Control.Concurrent#osthreads). Neither is it necessary if you want to run threads in parallel on a multiprocessor: threads created with forkIO will be shared out amongst the running CPUs (using GHC, -threaded, and the +RTS -N runtime option). forkIOforkIO :: IO () ->  IO ThreadIdIO()IOThreadIdSparks off a new thread to run the IO computation passed as the first argument, and returns the ThreadId of the newly created thread. The new thread will be a lightweight thread; if you want to use a foreign library that uses thread-local storage, use Control.Concurrent.forkOS instead. GHC note: the new thread inherits the blocked state of the parent (see Control.Exception.block). foreverforever ::  Monad m => m a -> m ()Monadmmam();forever act repeats the action infinitely. L ForeignPtrdata  ForeignPtr ae`The type ForeignPtr represents references to objects that are maintained in a foreign language, i.e., that are not part of the data structures usually managed by the Haskell storage manager. The essential difference between ForeignPtrs and vanilla memory references of type Ptr a is that the former may be associated with finalizers. A finalizer is a routine that is invoked when the Haskell storage manager detects that - within the Haskell heap and stack - there are no more references left that are pointing to the ForeignPtr. Typically, the finalizer will, then, invoke routines in the foreign language that free the resources bound by the foreign object. The ForeignPtr is parameterised in the same way as Ptr. The type argument of ForeignPtr should normally be an instance of class Storable. ?for_for_ :: (Foldable t, Applicative f) => t a ->  (a -> f b) -> f ()|:Foldablet Applicativeftaafbf()<for_ is traverse_ with its arguments flipped. Hforfor :: "(Traversable t, Applicative f) => t a ->  (a -> f b) -> f (t b)z1 Traversablet Applicativeftaafbftb:for is traverse with its arguments flipped. ?foldrM foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m by8FoldabletMonadmabmbbtambbMonadic fold over the elements of a structure, associating to the right, i.e. from right to left. Afoldr1foldr1 ::  (a -> a -> a) -> [a] -> aO5aaa[]aa}foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty lists. ?foldr1foldr1 :: Foldable t =>  (a -> a -> a) -> t a -> a\4Foldabletaaataa?foldr' foldr' :: Foldable t =>  (a -> b -> b) -> b -> t a -> bFoldabletabbbtabOFold over the elements of a structure, associating to the right, but strictly. Afoldr foldr ::  (a -> b -> b) -> b -> [a] -> babbb[]abfoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
?foldr foldr :: Foldable t =>  (a -> b -> b) -> b -> t a -> bsHFoldabletabbbtabHfoldMapDefaultfoldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m* TraversabletMonoidmamtam^This function may be used as a value for Data.Foldable.foldMap in a Foldable instance. ?foldMapfoldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m+FoldabletMonoidmamtamfoldM_ foldM_ ::  Monad m => (a -> b -> m a) -> a -> [b] -> m ()Monadmabmaa[]bm(),Like foldM, but discards the result. foldM foldM ::  Monad m => (a -> b -> m a) -> a -> [b] -> m avMonadmabmaa[]bmaThe foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue where '(>>)' and the `folded function' are not commutative.
foldM f a1 [x1, x2, ..., xm ]
==
do
  a2 <- f a1 x1
  a3 <- f a2 x2
  ...
  f am xm
If right-to-left evaluation is required, the input list should be reversed. ?foldlM foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m a?FoldabletMonadmabmaatbmaaMonadic fold over the elements of a structure, associating to the left, i.e. from left to right. Afoldl1'foldl1' ::  (a -> a -> a) -> [a] -> aaaa[]aa"A strict version of foldl1 Afoldl1foldl1 ::  (a -> a -> a) -> [a] -> aaaa[]aa}foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty lists. ?foldl1foldl1 :: Foldable t =>  (a -> a -> a) -> t a -> aFoldabletaaataaAfoldl' foldl' ::  (a -> b -> a) -> a -> [b] -> a= abaa[]ba"A strict version of foldl. ?foldl' foldl' :: Foldable t =>  (a -> b -> a) -> a -> t b -> aFoldabletabaatbaNFold over the elements of a structure, associating to the left, but strictly. Afoldl foldl ::  (a -> b -> a) -> a -> [b] -> aabaa[]ba&foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
The list must be finite. ?foldl foldl :: Foldable t =>  (a -> b -> a) -> a -> t b -> ahFoldabletabaatba?Foldableclass Foldable tData structures that can be folded. Minimal complete definition: foldMap or foldr. For example, given a data type
data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)
a suitable instance would be
instance Foldable Tree
   foldMap f Empty = mempty
   foldMap f (Leaf x) = f x
   foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r
This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. ?foldfold :: (Foldable t, Monoid m) => t m -> m:FoldabletMonoidmtmmH fmapDefault fmapDefault :: Traversable t => (a -> b) -> t a -> t b TraversabletabtatbSThis function may be used as a value for fmap in a Functor instance. fmapfmap ::  Functor f => (a -> b) -> f a -> f bFunctorfabfafb5flip flip ::  (a -> b -> c) -> b -> a -> c-abcbac[flip f takes its (first) two arguments in the reverse order of f. fixIOfixIO ::  (a -> IO a) -> IO aaIOaIOa>Fixeddata Fixed a5fixfix :: (a -> a) -> aj\aaafix f is the least fixed point of the function f, i.e. the least defined x such that f x = x. )firstfirst ::  Arrow a => a b c -> a (b, d) (c, d)MArrowaabca(,)bd(,)cd+FirstFirst :: Maybe a -> First aMaybeaFirsta+Firstnewtype First a7Maybe monoid returning the leftmost non-Nothing value. A findIndices findIndices ::  (a -> Bool) -> [a] -> [Int]aBool[]a[]IntThe findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order. A findIndex findIndex ::  (a -> Bool) -> [a] ->  Maybe IntaBool[]aMaybeIntThe findIndex function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or Nothing if there is no such element. Afindfind ::  (a -> Bool) -> [a] -> Maybe a0 aBool[]aMaybeaThe find function takes a predicate and a list and returns the first element in the list matching the predicate, or Nothing if there is no such element. ?findfind :: Foldable t =>  (a -> Bool) -> t a -> Maybe ap?FoldabletaBooltaMaybeaThe find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element. : FinalQuote FinalQuote :: GeneralCategory~lGeneralCategoryPf: Punctuation, Final quote %finallyfinally :: IO a -> IO b -> IO aIOaIObIOaRA specialised variant of bracket with just a computation to run afterward. L FinalizerPtrtype  FinalizerPtr a = FunPtr (Ptr a -> IO ())A Finalizer is represented as a pointer to a foreign function that, at finalisation time, gets as an argument a plain pointer variant of the foreign pointer that the finalizer is associated with. LFinalizerEnvPtrtype FinalizerEnvPtr env a% = FunPtr (Ptr env -> Ptr a -> IO ())LfinalizeForeignPtrfinalizeForeignPtr ::  ForeignPtr a -> IO ()sU ForeignPtraIO()OCauses the finalizers associated with a foreign pointer to be run immediately. filterMfilterM ::  Monad m =>  (a -> m Bool) -> [a] -> m [a]c-MonadmamBool[]am[]a8This generalizes the list-based filter function. Afilterfilter ::  (a -> Bool) -> [a] -> [a]aBool[]a[]afilter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]
FilePathtype FilePath = StringFile and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file. 9FalseFalse :: BoolBoolfailfail ::  Monad m => String -> m a{\MonadmStringmaUexitWithexitWith :: ExitCode -> IO aExitCodeIOaComputation exitWith code throws ExitException code. Normally this terminates the program, returning code to the program's caller. Before the program terminates, any open or semi-closed handles are first closed. A program that fails in any other way is treated as if it had called exitFailure. A program that terminates successfully without calling exitWith explicitly is treated as it it had called exitWith ExitSuccess. As an ExitException is not an IOError, exitWith bypasses the error handling in the IO monad and cannot be intercepted by catch from the Prelude. However it is an Exception, and can be caught using the functions of Control.Exception. This means that cleanup computations added with Control.Exception.bracket (from Control.Exception) are also executed properly on exitWith. U ExitSuccess ExitSuccess :: ExitCodeExitCode"indicates successful termination; U exitFailure exitFailure :: IO a>4IOaThe computation exitFailure is equivalent to exitWith (ExitFailure exitfail), where exitfail is implementation-dependent. U ExitFailure ExitFailure :: Int -> ExitCodeQ?IntExitCodeindicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system). % ExitException ExitException :: ExitCode ->  ExceptionqExitCode Exception/The ExitException exception is thrown by System.Exit.exitWith (and System.Exit.exitFailure). The ExitCode argument is the value passed to System.Exit.exitWith. An unhandled ExitException exception in the main thread will cause the program to be terminated with the given exit code. UExitCodedata ExitCode% Exceptiondata  Exception")The type of exceptions. Every kind of system-generated exception has a constructor in the Exception type, and values of other types may be injected into Exception by coercing them to Dynamic (see the section on Dynamic Exceptions: Control.Exception#DynamicExceptions). %evaluateevaluate :: a -> IO aaIOa)Forces its argument to be evaluated when the resultant IO action is executed. It can be used to order evaluation with respect to other IO operations; its semantics are given by
evaluate x `seq` y    ==>  y
evaluate x `catch` f  ==>  (return $! x) `catch` f
evaluate x >>= f      ==>  (return $! x) >>= f
Note: the first equation implies that (evaluate x) is not the same as (return $! x). A correct definition is
evaluate x = (return $! x) >>= return
% errorCalls errorCalls ::  Exception ->  Maybe StringB# ExceptionMaybeString% ErrorCall ErrorCall :: String ->  ExceptionString ExceptionThe ErrorCall exception is thrown by error. The String argument of ErrorCall is the string passed to error when it was called. =Eqclass Eq aw ?The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq. Minimal complete definition: either == or /=. CEQEQ :: Ordering  Ordering!EOFEOF :: Lexeme, # Lexeme+EndoEndo :: a -> a -> Endo a y aaEndoa+Endonewtype Endo a /The monoid of endomorphisms under composition. : EnclosingMark EnclosingMark :: GeneralCategoryM ; GeneralCategoryMe: Mark, Enclosing (emptyempty :: Alternative f => f a   AlternativeffaA elemIndices elemIndices :: Eq a => a -> [a] -> [Int]F # Eqaa[]a[]IntThe elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order. A elemIndex elemIndex :: Eq a => a -> [a] ->  Maybe Intc=Eqaa[]aMaybeIntThe elemIndex function returns the index of the first element in the given list which is equal (by ==) to the query element, or Nothing if there is no such element. Aelemelem :: Eq a => a -> [a] -> BoolrEqaa[]aBoolielem is the list membership predicate, usually written in infix form, e.g., x `elem` xs. ?elemelem :: (Foldable t, Eq a) => a -> t a -> Bool\FoldabletEqaataBool)Does the element occur in the structure? $either either :: (a -> c) -> (b -> c) ->  Either a b -> cG!acbcEitherabcCase analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b. $Eitherdata Either a b@The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b. The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct"). >E6data E6*>E12data E12T dynTypeRep dynTypeRep :: Dynamic -> TypeRepDynamicTypeRep% dynExceptions dynExceptions ::  Exception ->  Maybe Dynamic= ExceptionMaybeDynamic% DynException DynException :: Dynamic ->  ExceptionDynamic ExceptionnDynamically typed exceptions (see section on Dynamic Exceptions: Control.Exception#DynamicExceptions). dynApplydynApply :: Dynamic -> Dynamic ->  Maybe DynamicDynamicDynamicMaybeDynamicdynAppdynApp :: Dynamic -> Dynamic -> Dynamic&DynamicDynamicDynamicDynamicdata DynamicXA value of type Dynamic is an object encapsulated together with its type. A Dynamic may only represent a monomorphic value; an attempt to create a value of type Dynamic from a polymorphically-typed expression will result in an ambiguity error (see toDyn). Showing a value of type Dynamic returns a pretty-printed representation of the object's type; useful for debugging. +DualDual :: a -> Dual aI8aDuala+Dualnewtype Dual azLThe dual of a monoid, obtained by swapping the arguments of mappend. A dropWhile dropWhile ::  (a -> Bool) -> [a] -> [a]F&aBool[]a[]adropWhile p xs returns the suffix remaining after takeWhile p xs:
dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
dropWhile (< 9) [1,2,3] == []
dropWhile (< 0) [1,2,3] == [1,2,3]
Adropdrop :: Int -> [a] -> [a]Int[]a[]adrop n xs returns the suffix of xs after the first n elements, or [] if n > length xs:
drop 6 "Hello World!" == "World!"
drop 3 [1,2,3,4,5] == [4,5]
drop 3 [1,2] == []
drop 3 [] == []
drop (-1) [1,2] == [1,2]
drop 0 [1,2] == [1,2]
It is an instance of the more general Data.List.genericDrop, in which n may be of any integral type. >divMod'divMod' :: (Real a, Integral b) => a -> a -> (b, a)RealaIntegralbaa(,)ba8generalisation of divMod to any instance of Real % DivideByZero DivideByZero :: ArithExceptionl[ArithException>div'div' :: (Real a, Integral b) => a -> a -> bRealaIntegralbaab5generalisation of div to any instance of Real : digitToInt digitToInt :: Char -> IntsCharInt Convert a single digit Char to the corresponding Int. This function fails unless its argument satisfies isHexDigit, but recognises both upper and lower-case hexadecimal digits (i.e. '0'..'9', 'a'..'f', 'A'..'F'). 2deRefStablePtrdeRefStablePtr ::  StablePtr a -> IO a!  StablePtraIOaObtain the Haskell value referenced by a stable pointer, i.e., the same value that was passed to the corresponding call to makeStablePtr. If the argument to deRefStablePtr has already been freed using freeStablePtr, the behaviour of deRefStablePtr is undefined. %DenormalDenormal :: ArithException"w"ArithExceptionD denominator denominator :: Integral a => Ratio a -> a#"IntegralaRatioaaExtract the denominator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive. AdeleteFirstsBy deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a];$$aaBool[]a[]a[]aThe deleteFirstsBy function takes a predicate and two lists and returns the first list with the first occurrence of each element of the second list removed. AdeleteBy deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]u%O%aaBoola[]a[]agThe deleteBy function behaves like delete, but takes a user-supplied equality predicate. Adeletedelete :: Eq a => a -> [a] -> [a]U&4&Eqaa[]a[]adelete x removes the first occurrence of x from its list argument. For example,
delete 'a' "banana" == "bnana"
It is a special case of deleteBy, which allows the programmer to supply their own equality test. @deletedelete :: HashTable key val -> key -> IO ()'' HashTablekeyvalkeyIO()%Remove an entry from the hash table. : DecimalNumber DecimalNumber :: GeneralCategoryd(R(GeneralCategoryNd: Number, Decimal %DeadlockDeadlock ::  Exception(( ExceptionThere are no runnable threads, so the program is deadlocked. The Deadlock exception is raised in the main thread only (see also: Control.Concurrent). :DashPunctuationDashPunctuation :: GeneralCategory))GeneralCategoryPd: Punctuation, Dash Acyclecycle :: [a] -> [a]6*!*[]a[]acycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists. curry curry ::  ((a, b) -> c) -> a -> b -> cQ+3+(,)abcabcCcurry converts an uncurried function to a curried function. :CurrencySymbolCurrencySymbol :: GeneralCategory++GeneralCategorySc: Symbol, Currency ScpuTimePrecisioncpuTimePrecision :: Integera,W,IntegerThe cpuTimePrecision constant is the smallest measurable difference in CPU time that the implementation can record, and is given as an integral number of picoseconds. :ControlControl :: GeneralCategoryc-Q-GeneralCategoryCc: Other, Control 5constconst :: a -> b -> a--abaConstant function. (ConstConst :: a ->  Const a b9.$.aConstab(Constnewtype Const a bn.:ConnectorPunctuationConnectorPunctuation :: GeneralCategory..GeneralCategoryPc: Punctuation, Connector ; conjugate conjugate :: RealFloat a =>  Complex a ->  Complex a/[/ RealFloataComplexaComplexaA concatMap concatMap ::  (a -> [b]) -> [a] -> [b] 0/a[]b[]a[]b8Map a function over a list and concatenate the results. ? concatMap concatMap :: Foldable t =>  (a -> [b]) -> t a -> [b]00Foldableta[]bta[]bYMap a function over all the elements of a container and concatenate the resulting lists. Aconcatconcat :: [[a]] -> [a]11[][]a[]aConcatenate a list of lists. ?concatconcat :: Foldable t => t [a] -> [a]42 2Foldablett[]a[]a?The concatenation of all the elements of a container of lists. ;Complexdata RealFloat a => Complex a2 Complex numbers are an algebraic type. For a complex number z, abs z is a number with the magnitude of z, but oriented in the positive real direction, whereas signum z has the phase of z, but unit magnitude.  complementBit complementBit ::  Bits a => a -> Int -> aA4(4BitsaaInta complement complement ::  Bits a => a -> a44BitsaaaVcompilerVersioncompilerVersion :: Version44Version`The version of compilerName with which the program was compiled or is being interpreted. V compilerName compilerName :: String55StringXThe Haskell implementation with which the program was compiled or is being interpreted. C comparing  comparing ::  Ord a => (b -> a) -> b -> b -> Ordering6t6OrdababbOrdering
comparing p x y = compare (p x) (p y)
Useful combinator for use in conjunction with the xxxBy family of functions from Data.List, for example:
... sortBy (comparing fst) ...
Ccomparecompare ::  Ord a => a -> a -> Ordering77OrdaaaOrdering:ClosePunctuationClosePunctuation :: GeneralCategoryT8B8GeneralCategoryPe: Punctuation, Close clearBitclearBit ::  Bits a => a -> Int -> a88BitsaaInta;ciscis :: RealFloat a => a ->  Complex aT909 RealFloataaComplexa:chrchr :: Int -> Char99IntCharAThe Prelude.toEnum method restricted to the type Data.Char.Char. !CharChar :: Char -> Lexeme5:$:CharLexemeCharacter literal :Chardata Chars:dThe character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 charachers), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char. To convert a Char to or from the corresponding Int value defined by Unicode, use Prelude.toEnum and Prelude.fromEnum from the Prelude.Enum class respectively (or equivalently ord and chr).  catMaybes catMaybes ::  [Maybe a] -> [a]D=&=[]Maybea[]anThe catMaybes function takes a list of Maybes and returns a list of all the Just values. % catchJust catchJust ::  Exception -> Maybe b -> IO a -> b -> IO a -> IO az>B> ExceptionMaybebIOabIOaIOahThe function catchJust is like catch, but it takes an extra argument which is an exception predicate, a function which selects which type of exceptions we're interested in. There are some predefined exception predicates for useful subsets of exceptions: ioErrors, arithExceptions, and so on. For example, to catch just calls to the error function, we could use
result <- catchJust errorCalls thing_to_try handler
Any other exceptions which are not matched by the predicate are re-raised, and may be caught by an enclosing catch or catchJust. %catchDyncatchDyn :: Typeable exception => IO a -> (exception -> IO a) -> IO aA`ATypeable exceptionIOa exceptionIOaIOa6Catch dynamic exceptions of the required type. All other exceptions are re-thrown, including dynamic exceptions of the wrong type. When using dynamic exceptions it is advisable to define a new datatype to use for your exception type, to avoid possible clashes with dynamic exceptions used in other libraries. %catch catch :: IO a ->  Exception -> IO a -> IO aiC@CIOa ExceptionIOaIOaThis is the simplest of the exception-catching functions. It takes a single argument, runs it, and if an exception is raised the "handler" is executed, with the value of the exception passed as an argument. Otherwise, the result is returned as normal. For example:
catch (openFile f ReadMode) 
    (\e -> hPutStr stderr ("Couldn't open "++f++": " ++ show e))
For catching exceptions in pure (non-IO) expressions, see the function evaluate. Note that due to Haskell's unspecified evaluation order, an expression may return one of several possible exceptions: consider the expression error "urk" + 1 `div` 0. Does catch execute the handler passing ErrorCall "urk", or ArithError DivideByZero? The answer is "either": catch makes a non-deterministic choice about which exception to catch. If you call it again, you might get a different exception back. This is ok, because catch is an IO computation. Note that catch catches all types of exceptions, and is generally used for "cleaning up" before passing on the exception using throwIO. It is not good practice to discard the exception and continue, without first checking the type of the exception (it might be a ThreadKilled, for example). In this case it is usually better to use catchJust and select the kinds of exceptions to catch. Also note that the Prelude also exports a function called Prelude.catch with a similar type to catch, except that the Prelude version only catches the IO and user families of exceptions (as required by Haskell 98). We recommend either hiding the Prelude version of Prelude.catch when importing Control.Exception:
import Prelude hiding (catch)
or importing Control.Exception qualified, to avoid name-clashes:
import qualified Control.Exception as C
and then using C.catch 2castStablePtrToPtrcastStablePtrToPtr ::  StablePtr a -> Ptr ()KtK StablePtraPtr()rCoerce a stable pointer to an address. No guarantees are made about the resulting value, except that the original stable pointer can be recovered by castPtrToStablePtr. In particular, the address may not refer to an accessible memory location and any attempt to pass it to the member functions of the class Foreign.Storable.Storable leads to undefined behaviour. 2castPtrToStablePtrcastPtrToStablePtr :: Ptr () ->  StablePtr aMjMPtr() StablePtra[The inverse of castStablePtrToPtr, i.e., we have the identity
sp == castPtrToStablePtr (castStablePtrToPtr sp)
for any stable pointer sp on which freeStablePtr has not been executed yet. Moreover, castPtrToStablePtr may only be applied to pointers that have been produced by castStablePtrToPtr. KcastPtrToFunPtrcastPtrToFunPtr :: Ptr a -> FunPtr bYO?OPtraFunPtrbCasts a Ptr to a FunPtr. Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption. KcastPtrcastPtr :: Ptr a -> Ptr bPPPtraPtrbFThe castPtr function casts a pointer from one type to another. KcastFunPtrToPtrcastFunPtrToPtr :: FunPtr a -> Ptr bQiQFunPtraPtrbCasts a FunPtr to a Ptr. Note: this is valid only on architectures where data and function pointers range over the same set of addresses, and should only be used for bindings to external libraries whose interface already relies on this assumption. K castFunPtr castFunPtr :: FunPtr a -> FunPtr bSRFunPtraFunPtrb>Casts a FunPtr to a FunPtr of a different type. LcastForeignPtrcastForeignPtr ::  ForeignPtr a ->  ForeignPtr bSS ForeignPtra ForeignPtrbUThis function casts a ForeignPtr parameterised by one type into another type.  castcast :: (Typeable a, Typeable b) => a -> Maybe bT}TTypeableaTypeablebaMaybebThe type-safe cast operation  BufferModedata  BufferModeU,Three kinds of buffering are supported: line-buffering, block-buffering or no-buffering. These modes have the following effects. For output, items are written out, or flushed, from the internal buffer according to the buffer mode:
  • line-buffering: the entire output buffer is flushed whenever a newline is output, the buffer overflows, a System.IO.hFlush is issued, or the handle is closed.
  • block-buffering: the entire buffer is written out whenever it overflows, a System.IO.hFlush is issued, or the handle is closed.
  • no-buffering: output is written immediately, and never stored in the buffer.
An implementation is free to flush the buffer more frequently, but not less frequently, than specified above. The output buffer is emptied as soon as it has been written out. Similarly, input occurs according to the buffer mode for the handle:
  • line-buffering: when the buffer for the handle is not empty, the next item is obtained from the buffer; otherwise, when the buffer is empty, characters up to and including the next newline character are read into the buffer. No characters are available until the newline character is available or the buffer is full.
  • block-buffering: when the buffer for the handle becomes empty, the next block of data is read into the buffer.
  • no-buffering: the next input item is read and returned. The System.IO.hLookAhead operation implies that even a no-buffered handle may require a one-character buffer.
The default buffering mode when a handle is opened is implementation-dependent and may depend on the file system object which is attached to that handle. For most implementations, physical files will normally be block-buffered and terminals will normally be line-buffered. Abreakbreak ::  (a -> Bool) -> [a] ->  ([a], [a])\\aBool[]a(,)[]a[]abreak, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:
break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])
break p is equivalent to span (not . p). %bracketOnErrorbracketOnError :: IO a -> a -> IO b -> a -> IO c -> IO ca_4_IOaaIObaIOcIOcqLike bracket, but only performs the final action if there was an exception raised by the in-between computation. %bracket_ bracket_ :: IO a -> IO b -> IO c -> IO cb`;`IOaIObIOcIOc_A variant of bracket where the return value from the first computation is not required. %bracketbracket :: IO a -> a -> IO b -> a -> IO c -> IO coaBaIOaaIObaIOcIOcWhen you want to acquire a resource, do some work with it, and then release the resource, it is a good idea to use bracket, because bracket will install the necessary exception handler to release the resource in the event that an exception is raised during the computation. If an exception is raised, then bracket will re-raise the exception (after performing the release). A common example is opening a file:
bracket
  (openFile "filename" ReadMode)
  (hClose)
  (\handle -> do { ... })
The arguments to bracket are in this order so that we can partially apply it, e.g.:
withFile name mode = bracket (openFile name mode) hClose
9Booldata BoolMdThe Bool type is an enumeration. It is defined with False first so that the corresponding Prelude.Enum instance will give Prelude.fromEnum False the value zero, and Prelude.fromEnum True the value 1. %BlockedOnDeadMVarBlockedOnDeadMVar ::  Exceptionee ExceptionThe current thread was executing a call to Control.Concurrent.MVar.takeMVar that could never return, because there are no other references to this MVar. %BlockedIndefinitelyBlockedIndefinitely ::  Exceptionff ExceptionThe current thread was waiting to retry an atomic memory transaction that could never become possible to complete because there are no other threads referring to any of the TVars involved. BlockBufferingBlockBuffering ::  Maybe Int ->  BufferModeggMaybeInt BufferModeblock-buffering should be enabled if possible. The size of the buffer is n items if the argument is Just n and is otherwise implementation-dependent. %blockblock :: IO a -> IO ahhIOaIOaApplying block to a computation will execute that computation with asynchronous exceptions blocked. That is, any thread which attempts to raise an exception in the current thread with Control.Exception.throwTo will be blocked until asynchronous exceptions are enabled again. There's no need to worry about re-enabling asynchronous exceptions; that is done automatically on exiting the scope of block. Threads created by Control.Concurrent.forkIO inherit the blocked state from the parent; that is, to start a thread in blocked mode, use block $ forkIO .... This is particularly useful if you need to establish an exception handler in the forked thread before any asynchronous exceptions are received. bitSizebitSize ::  Bits a => a -> Int lkBitsaaIntBitsclass  Num a => Bits aElThe Bits class defines bitwise operations over integral types.
  • Bits are numbered from 0 with bit 0 being the least significant bit.
Minimal complete definition: .&., .|., xor, complement, (shift or (shiftL and shiftR)), (rotate or (rotateL and rotateR)), bitSize and isSigned. bitbit ::  Bits a => Int -> a*nnBitsaInta4atomicModifyIORefatomicModifyIORef :: IORef a ->  (a -> (a, b)) -> IO bnnIORefaa(,)abIObAtomically modifies the contents of an IORef. This function is useful for using IORef in a safe way in a multithreaded program. If you only have one IORef, then using atomicModifyIORef to access and modify it will prevent race conditions. Extending the atomicity to multiple IORefs is problematic, so it is recommended that if you need to do anything more complicated then using Control.Concurrent.MVar.MVar instead is a good idea. %asyncExceptionsasyncExceptions ::  Exception -> Maybe AsyncException3q q ExceptionMaybeAsyncException%AsyncExceptiondata AsyncExceptionsqAsynchronous exceptions %AsyncExceptionAsyncException :: AsyncException ->  Exception rqAsyncException ExceptionsAsynchronous exceptions (see section on Asynchronous Exceptions: Control.Exception#AsynchronousExceptions). ?asumasum :: (Foldable t, Alternative f) => t (f a) -> f asrFoldablet Alternativeftfafa@The sum of a collection of actions, generalizing concat. % assertions assertions ::  Exception ->  Maybe Stringss ExceptionMaybeString%AssertionFailedAssertionFailed :: String ->  ExceptionHt2tString ExceptionThis exception is thrown by the assert operation when the condition fails. The String argument contains the location of the assertion in the source program. %assertassert :: Bool -> a -> aQuBuBoolaa7If the first argument evaluates to True, then the result is the second argument. Otherwise an AssertionFailed exception is raised, containing a String with the source file and line number of the call to assert. Assertions can normally be turned on or off with a compiler flag (for GHC, assertions are normally on unless optimisation is turned on with -O or the -fignore-asserts option is given). When assertions are turned off, the first argument to assert is ignored, and the second argument is returned as the result. ) ArrowZeroclass  Arrow a =>  ArrowZero aw) ArrowPlusclass ArrowZero a =>  ArrowPlus ax) ArrowMonad ArrowMonad :: a () b -> ArrowMonad a bxmxa()b ArrowMonadab) ArrowMonadnewtype ArrowApply a =>  ArrowMonad a bxThe ArrowApply class is equivalent to Monad: any monad gives rise to a Kleisli arrow, and any instance of ArrowApply defines a monad. ) ArrowLoopclass  Arrow a =>  ArrowLoop ayThe loop operator expresses computations in which an output value is fed back as input, even though the computation occurs only once. It underlies the rec value recursion construct in arrow notation. ) ArrowChoiceclass  Arrow a =>  ArrowChoice azChoice, for arrows that support it. This class underlies the if and case constructs in arrow notation. Any instance must define left. The other combinators have sensible default definitions, which may be overridden for efficiency. ) ArrowApplyclass  Arrow a =>  ArrowApply a+|?Some arrows allow application of arrow inputs to other inputs. )Arrowclass Arrow a|The basic arrow class. Any instance must define either arr or pure (which are synonyms), as well as >>> and first. The other combinators have sensible default definitions, which may be overridden for efficiency. %ArrayExceptiondata ArrayException})Exceptions generated by array operations %ArrayExceptionArrayException :: ArrayException ->  Exception~a~ArrayException ExceptionlExceptions raised by array-related operations. (NOTE: GHC currently does not throw ArrayExceptions). )arrarr ::  Arrow a => (b -> c) -> a b c\:Arrowabcabc%arithExceptionsarithExceptions ::  Exception -> Maybe ArithException ExceptionMaybeArithException%ArithExceptiondata ArithException/"The type of arithmetic exceptions %ArithExceptionArithException :: ArithException ->  ExceptionӀArithException ExceptionExceptions raised by arithmetic operations. (NOTE: GHC currently does not throw ArithExceptions except for DivideByZero). Varcharch :: StringString:The machine architecture on which the program is running. DapproxRationalapproxRational :: RealFrac a => a -> a -> RationaldBRealFracaaaRational.approxRational, applied to two real fractional numbers x and epsilon, returns the simplest rational number within epsilon of x. A rational number y is said to be simpler than another y' if Any real interval contains a unique simplest rational; in particular, note that 0/1 is the simplest rational of all. ( Applicativeclass  Functor f =>  Applicative f܄$A functor with application. Instances should satisfy the following laws: The Functor instance should satisfy

fmap f x = pure f <*> x
If f is also a Monad, define pure = return and (<*>) = ap. +appEndoappEndo :: Endo a -> a -> agSEndoaaa AppendMode AppendMode :: IOModeIOMode appendFile appendFile :: FilePath -> String -> IO ()2FilePathStringIO()The computation appendFile file str function appends the string str, to the file file. Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.
main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])
)appapp :: ArrowApply a => a (a b c, b) cJ ArrowApplyaa(,)abcbcapap ::  Monad m =>  m (a -> b) -> m a -> m bҋMonadmmabmambIn many situations, the liftM operations can be replaced by uses of ap, which promotes function application.
return f `ap` x1 `ap` ... `ap` xn
is equivalent to
liftMn f x1 x2 ... xn
Aanyany ::  (a -> Bool) -> [a] -> Bool%aBool[]aBoolmApplied to a predicate and a list, any determines if any element of the list satisfies the predicate. ?anyany :: Foldable t =>  (a -> Bool) -> t a -> Bool FoldabletaBooltaBoolIDetermines whether any element of the structure satisfies the predicate. +AnyAny :: Bool -> AnyBoolAny+Anynewtype Any"Boolean monoid under disjunction. Aandand :: [Bool] -> BoolZE[]BoolBooland returns the conjunction of a Boolean list. For the result to be True, the list must be finite; False, however, results from a False value at a finite index of a finite or infinite list. ?andand :: Foldable t => t Bool -> BoolFoldablettBoolBooland returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end. ( Alternativeclass Applicative f =>  Alternative fɑ"A monoid on applicative functors. Aallall ::  (a -> Bool) -> [a] -> Bool]@aBool[]aBoollApplied to a predicate and a list, all determines if all elements of the list satisfy the predicate. ?allall :: Foldable t =>  (a -> Bool) -> t a -> BoolW,FoldabletaBooltaBoolHDetermines whether all elements of the structure satisfy the predicate. +AllAll :: Bool -> AllݓBoolAll+Allnewtype All"Boolean monoid under conjunction. KalignPtralignPtr :: Ptr a -> Int -> Ptr aPtraIntPtraGiven an arbitrary address and an alignment constraint, alignPtr yields the next higher address that fulfills the alignment constraint. An alignment constraint x is fulfilled by any address divisible by x. This operation is idempotent.  alignment alignment :: Storable a => a -> Int$ StorableaaIntLaddForeignPtrFinalizerEnv addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env ->  ForeignPtr a -> IO ()̖FinalizerEnvPtrenvaPtrenv ForeignPtraIO()like addForeignPtrFinalizerEnv but allows the finalizer to be passed an additional environment parameter to be passed to the finalizer. The environment passed to the finalizer is fixed by the second argument to addForeignPtrFinalizerEnv LaddForeignPtrFinalizeraddForeignPtrFinalizer :: FinalizerPtr a ->  ForeignPtr a -> IO ()Ř FinalizerPtra ForeignPtraIO()This function adds a finalizer to the given foreign object. The finalizer will run before all other finalizers for the same object which have already been registered. addForeignPtrFinalizeraddForeignPtrFinalizer ::  ForeignPtr a -> IO () -> IO () ForeignPtraIO()IO()This function adds a finalizer to the given ForeignPtr. The finalizer will run after the last reference to the foreign object is dropped, but before all previously registered finalizers for the same object.  AbsoluteSeek AbsoluteSeek :: SeekModeG<SeekMode3the position of hdl is set to i. )^>> (^>>) ::  Arrow a => (b -> c) -> a c d -> a b d Arrowabcacdabd%Precomposition with a pure function. )^<< (^<<) ::  Arrow a => (c -> d) -> a b c -> a b dŜArrowacdabcabd>Postcomposition with a pure function (right-to-left variant). A\\ (\\) :: Eq a => [a] -> [a] -> [a][Eqa[]a[]a[]atThe \\ function is list difference ((non-associative). In the result of xs \\ ys, the first occurrence of each element of ys in turn (if any) has been removed from xs. Thus
(xs ++ ys) \\ xs == ys.
It is a special case of deleteFirstsBy, which allows the programmer to supply their own equality test. )>>^ (>>^) ::  Arrow a => a b c -> (c -> d) -> a b d\Arrowaabccdabd&Postcomposition with a pure function. )>>> (>>>) ::  Arrow a => a b c -> a c d -> a b dBArrowaabcacdabd>>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bҠMonadmmaambmb>> (>>) ::  Monad m => m a -> m b -> m bT-Monadmmambmb>=> (>=>) ::  Monad m =>  (a -> m b) ->  (b -> m c) -> a -> m c̡Monadmambbmcamc-Left-to-right Kleisli composition of monads. C>= (>=) ::  Ord a => a -> a -> BoolOrdaaaBoolC> (>) ::  Ord a => a -> a -> Bool OrdaaaBool=== (==) :: Eq a => a -> a -> Boolv^EqaaaBool=<< (=<<) ::  Monad m =>  (a -> m b) -> m a -> m bڣMonadmambmamb(<|> (<|>) :: Alternative f => f a -> f a -> f ai Alternativeffafafa<=< (<=<) ::  Monad m =>  (b -> m c) ->  (a -> m b) -> a -> m cBMonadmbmcambamcWRight-to-left Kleisli composition of monads. '(>=>)', with the arguments flipped C<= (<=) ::  Ord a => a -> a -> BoolOrdaaaBool)<<^ (<<^) ::  Arrow a => a c d -> (b -> c) -> a b dnArrowaacdbcabd=Precomposition with a pure function (right-to-left variant). )<<< (<<<) ::  Arrow a => a c d -> a b c -> a b dk;ArrowaacdabcabdARight-to-left composition, for a better fit with arrow notation. )<+> (<+>) :: ArrowPlus a => a b c -> a b c -> a b cG ArrowPlusaabcabcabc(<*> (<*>) :: Applicative f =>  f (a -> b) -> f a -> f b Applicativeffabfafb(<**> (<**>) :: Applicative f => f a ->  f (a -> b) -> f bO Applicativeffafabfb;A variant of <*> with the arguments reversed. (<* (<*) :: Applicative f => f a -> f b -> f aJ Applicativeffafbfa?Sequence actions, discarding the value of the second argument. (<$> (<$>) ::  Functor f => (a -> b) -> f a -> f bFunctorfabfafbA synonym for fmap. (<$ (<$) ::  Functor f => a -> f b -> f aFunctorfafbfaReplace the value. C< (<) ::  Ord a => a -> a -> Bool0OrdaaaBool:+:data :+: a b^;:+ (:+) :: a -> a ->  Complex aǬaaComplexaKforms a complex number from its real and imaginary rectangular components. :*: (:*:) :: a -> b -> :*: a bzdab:*:ab:*:data :*: a b=/= (/=) :: Eq a => a -> a -> BoolEqaaaBool.|. (.|.) ::  Bits a => a -> a -> akBitsaaaa.&. (.&.) ::  Bits a => a -> a -> aخBitsaaaa5. (.) :: (b -> c) -> (a -> b) -> a -> ckRbcabac)+++ (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')B ArrowChoiceaabcab'c'aEitherbb'Eithercc'A++ (++) :: [a] -> [a] -> [a][]a[]a[]aAppend two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
If the first list is not finite, the result is the first list. (*> (*>) :: Applicative f => f a -> f b -> f b Applicativeffafbfb>Sequence actions, discarding the value of the first argument. )*** (***) ::  Arrow a => a b c -> a b' c' -> a (b, b') (c, c') ŲArrowaabcab'c'a(,)bb'(,)cc')&&& (&&&) ::  Arrow a => a b c -> a b c' ->  a b (c, c')wArrowaabcabc'ab(,)cc'9&& (&&) :: Bool -> Bool -> BoolBoolBoolBoolBoolean "and" D% (%) :: Integral a => a -> a -> Ratio aIntegralaaaRatioa5$ ($) :: (a -> b) -> a -> b ababA!! (!!) :: [a] -> Int -> akW[]aIntaList index (subscript) operator, starting from 0. It is an instance of the more general Data.List.genericIndex, which takes an index of any integral type. || (||) :: Bool -> Bool -> BoolnYBoolBoolBool Boolean "or" zipWith3 zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]3abcd[]a[]b[]c[]dThe zipWith3 function takes a function which combines three elements, as well as three lists and returns a list of their point-wise combination, analogous to zipWith. zipWith zipWith ::  (a -> b -> c) -> [a] -> [b] -> [c]~Uabc[]a[]b[]czipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two lists to produce the list of corresponding sums. zip3 zip3 :: [a] -> [b] -> [c] ->  [(a, b, c)]ι[]a[]b[]c[](,,)abcVzip3 takes three lists and returns a list of triples, analogous to zip. zipzip :: [a] -> [b] -> [(a, b)]Һ[]a[]b[](,)abzip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.  writeFile writeFile :: FilePath -> String -> IO ()ȻFilePathStringIO()wThe computation writeFile file str function writes the string str, to the file file. wordswords :: String -> [String]String[]String[words breaks a string up into a list of words, which were delimited by white space.  userError userError :: String -> IOErrorkStringIOErrorConstruct an IOError value with a string describing the error. The fail method of the IO instance of the Monad class raises a userError, thus:
instance Monad IO where 
  ...
  fail s = ioError (userError s)
unzip3unzip3 ::  [(a, b, c)] -> ([a], [b], [c])־[](,,)abc(,,)[]a[]b[]cgThe unzip3 function takes a list of triples and returns three lists, analogous to unzip. unzipunzip :: [(a, b)] ->  ([a], [b])ǿ[](,)ab(,)[]a[]biunzip transforms a list of pairs into a list of first components and a list of second components. unwordsunwords :: [String] -> String[]StringString_unwords is an inverse operation to words. It joins words with separating spaces. until until ::  (a -> Bool) -> (a -> a) -> a -> aaBoolaaaa[until p f yields the result of applying f until p holds. unsafePerformIOunsafePerformIO :: IO a -> afWIOaaThis is the "back door" into the IO monad, allowing IO computation to be performed at any time. For this to be safe, the IO computation should be free of side effects and independent of its environment. If the I/O computation wrapped in unsafePerformIO performs side effects, then the relative order in which those side effects take place (relative to the main I/O trunk, or other calls to unsafePerformIO) is indeterminate. You have to be careful when writing and compiling modules that use unsafePerformIO:
  • Use {-# NOINLINE foo #-} as a pragma on any function foo that calls unsafePerformIO. If the call is inlined, the I/O may be performed more than once.
  • Use the compiler flag -fno-cse to prevent common sub-expression elimination being performed on the module, which might combine two side effects that were meant to be separate. A good example is using multiple global variables (like test in the example below).
  • Make sure that the either you switch off let-floating, or that the call to unsafePerformIO cannot float outside a lambda. For example, if you say: f x = unsafePerformIO (newIORef []) you may get only one reference cell shared between all calls to f. Better would be f x = unsafePerformIO (newIORef [x]) because now it can't float outside the lambda.
It is less well known that unsafePerformIO is not type safe. For example:
test :: IORef [a]
test = unsafePerformIO $ newIORef []

main = do
	      writeIORef test [42]
	      bang <- readIORef test
	      print (bang :: [Char])
This program will core dump. This problem with polymorphic references is well known in the ML community, and does not arise with normal monadic use of references. There is no easy way to make it impossible once you use unsafePerformIO. Indeed, it is possible to write coerce :: a -> b with the help of unsafePerformIO. So be careful! unlinesunlines :: [String] -> String[]StringStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each.  undefined undefined :: a}yaA special case of error. It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which undefined appears. uncurryuncurry ::  (a -> b -> c) -> (a, b) -> cabc(,)abcCuncurry converts a curried function to a function on pairs. truncatetruncate :: (RealFrac a, Integral b) => a -> b|URealFracaIntegralbabTrueTrue :: BoolBool toRational toRational ::  Real a => a -> Rational' RealaaRational toInteger toInteger :: Integral a => a -> IntegerIntegralaaIntegertoEnumtoEnum ::  Enum a => Int -> aEnumaIntatanhtanh :: Floating a => a -> a`HFloatingaaatantan :: Floating a => a -> aFloatingaaa takeWhile takeWhile ::  (a -> Bool) -> [a] -> [a]?aBool[]a[]a/takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:
takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
takeWhile (< 9) [1,2,3] == [1,2,3]
takeWhile (< 0) [1,2,3] == []
taketake :: Int -> [a] -> [a]Int[]a[]atake n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs:
take 5 "Hello World!" == "Hello"
take 3 [1,2,3,4,5] == [1,2,3]
take 3 [1,2] == [1,2]
take 3 [] == []
take (-1) [1,2] == []
take 0 [1,2] == []
It is an instance of the more general Data.List.genericTake, in which n may be of any integral type. tailtail :: [a] -> [a][]a[]aHExtract the elements after the head of a list, which must be non-empty. sumsum ::  Num a => [a] -> akNuma[]aaFThe sum function computes the sum of a finite list of numbers. succsucc ::  Enum a => a -> a#Enumaaasubtractsubtract ::  Num a => a -> a -> a|NumaaaaStringtype String = [Char]gA String is a list of characters. String constants in Haskell are values of type String. sqrtsqrt :: Floating a => a -> a}FloatingaaasplitAtsplitAt :: Int -> [a] ->  ([a], [a])Int[]a(,)[]a[]aqsplitAt n xs returns a tuple where first element is xs prefix of length n and second element is the remainder of the list:
splitAt 6 "Hello World!" == ("Hello ","World!")
splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
splitAt 1 [1,2,3] == ([1],[2,3])
splitAt 3 [1,2,3] == ([1,2,3],[])
splitAt 4 [1,2,3] == ([1,2,3],[])
splitAt 0 [1,2,3] == ([],[1,2,3])
splitAt (-1) [1,2,3] == ([],[1,2,3])
It is equivalent to (take n xs, drop n xs). splitAt is an instance of the more general Data.List.genericSplitAt, in which n may be of any integral type. spanspan ::  (a -> Bool) -> [a] ->  ([a], [a])aBool[]a(,)[]a[]aspan, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list:
span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3] == ([1,2,3],[])
span (< 0) [1,2,3] == ([],[1,2,3])
span p xs is equivalent to (takeWhile p xs, dropWhile p xs) sndsnd :: (a, b) -> bR?(,)abb(Extract the second component of a pair. sinhsinh :: Floating a => a -> aFloatingaaasinsin :: Floating a => a -> a:"Floatingaaasignumsignum ::  Num a => a -> aNumaaa significand significand :: RealFloat a => a -> a RealFloataaa showString showString :: String -> ShowShVStringShowSjutility function converting a String to a show function that simply prepends the string unchanged.  showsPrec showsPrec ::  Show a => Int -> a -> ShowSQ4ShowaIntaShowS showSigned  showSigned ::  Real a => a -> ShowS -> Int -> a -> ShowSRealaaShowSIntaShowS<Converts a possibly-negative Real value to a string. showsshows ::  Show a => a -> ShowSShowaaShowS7equivalent to showsPrec with a precedence of 0. ShowStype ShowS = String -> StringThe shows functions return a function that prepends the output String to an existing String. This allows constant-time concatenation of results using function composition.  showParen showParen :: Bool -> ShowS -> ShowSJ3BoolShowSShowSxutility function that surrounds the inner show function with parentheses when the Bool parameter is True.  showOctshowOct :: Integral a => a -> ShowS1IntegralaaShowS<Show non-negative Integral numbers in base 8. showListshowList ::  Show a => [a] -> ShowSShowa[]aShowS showIntAtBase  showIntAtBase :: Integral a => a ->  (Int -> Char) -> a -> ShowScIntegralaaIntCharaShowSShows a non-negative Integral number using the base specified by the first argument, and the character representation specified by the second.  showIntshowInt :: Integral a => a -> ShowSIntegralaaShowS=Show non-negative Integral numbers in base 10.  showHexshowHex :: Integral a => a -> ShowSG+IntegralaaShowS=Show non-negative Integral numbers in base 16.  showGFloat showGFloat :: RealFloat a =>  Maybe Int -> a -> ShowS RealFloataMaybeIntaShowSShow a signed RealFloat value using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise. In the call showGFloat digs val, if digs is Nothing, the value is shown to full precision; if digs is Just d, then at most d digits after the decimal point are shown.  showFloat showFloat :: RealFloat a => a -> ShowS: RealFloataaShowSShow a signed RealFloat value to full precision using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999, and scientific notation otherwise.  showFFloat showFFloat :: RealFloat a =>  Maybe Int -> a -> ShowSx RealFloataMaybeIntaShowSXShow a signed RealFloat value using standard decimal notation (e.g. 245000, 0.0015). In the call showFFloat digs val, if digs is Nothing, the value is shown to full precision; if digs is Just d, then at most d digits after the decimal point are shown.  showEFloat showEFloat :: RealFloat a =>  Maybe Int -> a -> ShowSj RealFloataMaybeIntaShowS`Show a signed RealFloat value using scientific (exponential) notation (e.g. 2.45e2, 1.5e-3). In the call showEFloat digs val, if digs is Nothing, the value is shown to full precision; if digs is Just d, then at most d digits after the decimal point are shown. showCharshowChar :: Char -> ShowSO?CharShowSkutility function converting a Char to a show function that simply prepends the character unchanged. showshow ::  Show a => a -> StringShowaaStringShowclass Show aL.Conversion of values to readable Strings. Minimal complete definition: showsPrec or show. Derived instances of Show have the following properties, which are compatible with derived instances of Text.Read.Read:
  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a
the derived instance of Show is equivalent to
instance (Show a) => Show (Tree a) where

       showsPrec d (Leaf m) = showParen (d > app_prec) $
            showString "Leaf " . showsPrec (app_prec+1) m
         where app_prec = 10

       showsPrec d (u :^: v) = showParen (d > up_prec) $
            showsPrec (up_prec+1) u . 
            showString " :^: "      .
            showsPrec (up_prec+1) v
         where up_prec = 5
Note that right-associativity of :^: is ignored. For example,
  • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
 sequence_ sequence_ ::  Monad m => [m a] -> m ()Monadm[]mam()QEvaluate each action in the sequence from left to right, and ignore the results. sequencesequence ::  Monad m => [m a] -> m [a]Monadm[]mam[]aREvaluate each action in the sequence from left to right, and collect the results. scanr1scanr1 ::  (a -> a -> a) -> [a] -> [a]waaa[]a[]aPscanr1 is a variant of scanr that has no starting value argument. scanr scanr ::  (a -> b -> b) -> b -> [a] -> [b]qNabbb[]a[]buscanr is the right-to-left dual of scanl. Note that
head (scanr f z xs) == foldr f z xs.
scanl1scanl1 ::  (a -> a -> a) -> [a] -> [a]bBaaa[]a[]ascanl1 is a variant of scanl that has no starting value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
scanl scanl ::  (a -> b -> a) -> a -> [b] -> [a]yVabaa[]b[]ascanl 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.
 scaleFloat scaleFloat :: RealFloat a => Int -> a -> a RealFloataIntaaroundround :: (RealFrac a, Integral b) => a -> bqJRealFracaIntegralbabRightRight :: b ->  Either a bbEitherabreversereverse :: [a] -> [a]'[]a[]amreverse xs returns the elements of xs in reverse order. xs must be finite. returnreturn ::  Monad m => a -> m aMonadmama replicate replicate :: Int -> a -> [a]dPInta[]arepeatrepeat :: a -> [a]a[]aZrepeat x is an infinite list, with x the value of every element. remrem :: Integral a => a -> a -> a}bIntegralaaaareciprecip :: Fractional a => a -> a Fractionalaaa realToFrac realToFrac :: (Real a, Fractional b) => a -> bjEReala Fractionalbab%general coercion to fractional types RealFracclass (Real a, Fractional a) => RealFrac aXExtracting components of fractions. Minimal complete definition: properFraction  RealFloatclass (RealFrac a, Floating a) =>  RealFloat aEfficient, machine-independent access to the components of a floating-point number. Minimal complete definition: all except exponent, significand, scaleFloat and atan2 Realclass (Num a, Ord a) => Real a readsPrec readsPrec ::  Read a => Int -> ReadS a ReadaIntReadSa readSigned readSigned ::  Real a => ReadS a -> ReadS afRealaReadSaReadSaOReads a signed Real value, given a reader for an unsigned value. readsreads ::  Read a => ReadS a3ReadaReadSa7equivalent to readsPrec with a precedence of 0. ReadStype ReadS a = String -> [(a, String)] A parser for a type a, represented as a function that takes a String and returns a list of possible parses as (a,String) pairs. Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ReadP).  readParen readParen :: Bool -> ReadS a -> ReadS aX7BoolReadSaReadSareadParen True p parses what p parses, but surrounded with parentheses. readParen False p parses what p parses, but optionally surrounded with parentheses.  readOctreadOct ::  Num a => ReadS a x NumaReadSa+Read an unsigned number in octal notation. readLnreadLn ::  Read a => IO a  ReadaIOaFThe readLn function combines getLine and readIO. readListreadList ::  Read a =>  ReadS [a]  ReadaReadS[]areadIOreadIO ::  Read a => String -> IO a*  ReadaStringIOaThe readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.  readIntreadInt ::  Num a => a -> Char -> Bool -> Char -> Int -> ReadS a N NumaaCharBoolCharIntReadSaEReads an unsigned Integral value in an arbitrary base.  readHexreadHex ::  Num a => ReadS a  NumaReadSa_Read an unsigned number in hexadecimal notation. Both upper or lower case letters are allowed.  readFloat readFloat :: RealFrac a => ReadS a  RealFracaReadSaZReads an unsigned RealFrac value, expressed in decimal scientific notation. readFilereadFile :: FilePath ->  IO StringFilePathIOStringThe readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.  readDecreadDec ::  Num a => ReadS aNumaReadSa-Read an unsigned number in decimal notation. readread ::  Read a => String -> a4ReadaStringalThe read function reads input from a string, which must be completely consumed by the input process. Readclass Read a Parsing of Strings, producing values. Minimal complete definition: readsPrec (or, for GHC only, readPrec) Derived instances of Read make the following assumptions, which derived instances of Text.Show.Show obey:
  • If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).
  • Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
  • If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
  • The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.
For example, given the declarations
infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a
the derived instance of Read in Haskell 98 is equivalent to
instance (Read a) => Read (Tree a) where

        readsPrec d r =  readParen (d > app_prec)
                         (\r -> [(Leaf m,t) |
                                 ("Leaf",s) <- lex r,
                                 (m,t) <- readsPrec (app_prec+1) s]) r

                      ++ readParen (d > up_prec)
                         (\r -> [(u:^:v,w) |
                                 (u,s) <- readsPrec (up_prec+1) r,
                                 (":^:",t) <- lex s,
                                 (v,w) <- readsPrec (up_prec+1) t]) r

          where app_prec = 10
                up_prec = 5
Note that right-associativity of :^: is unused. The derived instance in GHC is equivalent to
instance (Read a) => Read (Tree a) where

        readPrec = parens $ (prec app_prec $ do
                                 Ident "Leaf" <- lexP
                                 m <- step readPrec
                                 return (Leaf m))

                     +++ (prec up_prec $ do
                                 u <- step readPrec
                                 Symbol ":^:" <- lexP
                                 v <- step readPrec
                                 return (u :^: v))

          where app_prec = 10
                up_prec = 5

        readListPrec = readListPrecDefault
Rationaltype Rational = Ratio IntegerArbitrary-precision rational numbers, represented as a ratio of two Integer values. A rational number may be constructed using the % operator. quotRemquotRem :: Integral a => a -> a -> (a, a)Integralaaa(,)aaquotquot :: Integral a => a -> a -> aK0IntegralaaaaputStrLnputStrLn :: String -> IO ()StringIO()9The same as putStr, but adds a newline character. putStrputStr :: String -> IO ()B-StringIO()UWrite a string to the standard output device (same as hPutStr stdout). putCharputChar :: Char -> IO ()CharIO()YWrite a character to the standard output device (same as hPutChar stdout). properFractionproperFraction :: (RealFrac a, Integral b) => a -> (b, a)RealFracaIntegralba(,)baproductproduct ::  Num a => [a] -> aQ8Numa[]aaNThe product function computes the product of a finite list of numbers. printprint ::  Show a => a -> IO () ShowaaIO()The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline. For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
predpred ::  Enum a => a -> a"!Enumaaapipi :: Floating a => aN";"Floatingaa otherwise otherwise :: Bool""Boolotherwise is defined as the value True. It helps to make guards more readable. eg.
f x | x < 0     = ...
    | otherwise = ...
Orderingdata Orderingb#Represents an ordering relationship between two values: less than, equal to, or greater than. An Ordering is returned by compare. Ordclass Eq a => Ord a'$The Ord class is used for totally ordered datatypes. Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects. Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types. oror :: [Bool] -> Bool&x&[]BoolBoolor returns the disjunction of a Boolean list. For the result to be False, the list must be finite; True, however, results from a True value at a finite index of a finite or infinite list. oddodd :: Integral a => a -> Bool''IntegralaaBoolNumclass (Eq a, Show a) => Num a (\Basic numeric class. Minimal complete definition: all except negate or (-) nullnull :: [a] -> Bool(([]aBoolTest whether a list is empty. NothingNothing :: Maybe a))MaybeanotElemnotElem :: Eq a => a -> [a] -> Bool)w)Eqaa[]aBool/notElem is the negation of elem. notnot :: Bool -> Bool**BoolBoolBoolean "not" negatenegate ::  Num a => a -> a{*h*NumaaaMonadclass Monad m*The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Minimal complete definition: >>= and return. Instances of Monad should satisfy the following laws:
return a >>= k  ==  k a
m >>= return  ==  m
m >>= (\x -> k x >>= h)  ==  (m >>= k) >>= h
Instances of both Monad and Functor should additionally satisfy the law:
fmap f xs  ==  xs >>= return . f
The instances of Monad for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws. modmod :: Integral a => a -> a -> a..Integralaaaaminimumminimum ::  Ord a => [a] -> a /.Orda[]aaminimum returns the minimum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of minimumBy, which allows the programmer to supply their own comparison function. minBoundminBound ::  Bounded a => a=0+0Boundedaaminmin ::  Ord a => a -> a -> a00Ordaaaamaybe maybe :: b -> (a -> b) -> Maybe a -> b#11babMaybeab The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result. Maybedata Maybe a^2-The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error. The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Data.Either.Either type. maximummaximum ::  Ord a => [a] -> a44Orda[]aamaximum returns the maximum value from a list, which must be non-empty, finite, and of an ordered type. It is a special case of maximumBy, which allows the programmer to supply their own comparison function. maxBoundmaxBound ::  Bounded a => a#66Boundedaamaxmax ::  Ord a => a -> a -> a6r6OrdaaaamapM_mapM_ ::  Monad m =>  (a -> m b) -> [a] -> m ()76Monadmamb[]am()SmapM_ f is equivalent to sequence_ . map f. mapMmapM ::  Monad m =>  (a -> m b) -> [a] -> m [b]87Monadmamb[]am[]bQmapM f is equivalent to sequence . map f. mapmap :: (a -> b) -> [a] -> [b]88ab[]a[]bmap f xs is the list obtained by applying f to each element of xs, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]
LTLT :: Ordering99Orderinglookuplookup :: Eq a => a -> [(a, b)] -> Maybe b`:2:Eqaa[](,)abMaybebIlookup key assocs looks up a key in an association list. logBaselogBase :: Floating a => a -> a -> a ;;Floatingaaaaloglog :: Floating a => a -> a;g;Floatingaaalineslines :: String -> [String];;String[]String}lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.  lexDigits lexDigits ::  ReadS String<<ReadSString,Reads a non-empty string of decimal digits. lexlex ::  ReadS String(==ReadSStringThe lex function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, lex returns a single successful `lexeme' consisting of the empty string. (Thus lex "" = [("","")].) If there is no legal lexeme at the beginning of the input string, lex fails (i.e. returns []). This lexer is not completely faithful to the Haskell lexical syntax in the following respects:
  • Qualified names are not handled properly
  • Octal and hexadecimal numerics are not recognized as a single token
  • Comments are not treated properly
lengthlength :: [a] -> IntB@1@[]aIntlength returns the length of a finite list as an Int. It is an instance of the more general Data.List.genericLength, the result type of which may be any kind of number. LeftLeft :: a ->  Either a bSA=AaEitherablcmlcm :: Integral a => a -> a -> aAAIntegralaaaaelcm x y is the smallest positive integer that both x and y divide. lastlast :: [a] -> asBdB[]aaHExtract the last element of a list, which must be finite and non-empty. JustJust :: a -> Maybe aCBaMaybeaiterateiterate :: (a -> a) -> a -> [a]|CeCaaa[]aiterate f x returns an infinite list of repeated applications of f to x:
iterate f x == [x, f x, f (f x), ...]
isNegativeZeroisNegativeZero :: RealFloat a => a -> BoolD|D RealFloataaBoolisNaNisNaN :: RealFloat a => a -> BoolED RealFloataaBool isInfinite isInfinite :: RealFloat a => a -> BoolxE\E RealFloataaBoolisIEEEisIEEE :: RealFloat a => a -> BoolEE RealFloataaBoolisDenormalizedisDenormalized :: RealFloat a => a -> BoolbFFF RealFloataaBoolioErrorioError :: IOError -> IO aFFIOErrorIOa0Raise an IOError in the IO monad. IOErrortype IOError = IOException3G%The Haskell 98 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Control.Exception.Exception. In Haskell 98, this is an opaque type. IOdata IO aHA value of type IO a is a computation which, when performed, does some I/O before returning a value of type a. There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main. IO is a monad, so IO actions can be combined using either the do-notation or the >> and >>= operations from the Monad class. interactinteract :: (String -> String) -> IO ()KkKStringStringIO()The interact function takes a function of type String->String 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. Integralclass (Real a, Enum a) => Integral aLqIntegral numbers, supporting integer division. Minimal complete definition: quotRem and toInteger Integerdata IntegerxMArbitrary-precision integers. Intdata IntMA fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class. initinit :: [a] -> [a]NN[]a[]a^Return all the elements of a list except the last one. The list must be finite and non-empty. idid :: a -> aOOaaIdentity function. headhead :: [a] -> aOO[]aa>Extract the first element of a list, which must be non-empty. GTGT :: OrderingjP_POrderinggetLinegetLine ::  IO StringPPIOStringSRead a line from the standard input device (same as hGetLine stdin).  getContents getContents ::  IO String[QLQIOStringThe getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin). getChargetChar :: IO Char?R2RIOCharXRead a character from the standard input device (same as hGetChar stdin). gcdgcd :: Integral a => a -> a -> aSRIntegralaaaagcd x y is the greatest (positive) integer that divides both x and y; for example gcd (-3) 6 = 3, gcd (-3) (-6) = 3, gcd 0 4 = 4. gcd 0 0 raises a runtime error. Functorclass Functor fZTCThe Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:
fmap id  ==  id
fmap (f . g)  ==  fmap f . fmap g
The instances of Functor for lists, Data.Maybe.Maybe and System.IO.IO defined in the Prelude satisfy these laws. fstfst :: (a, b) -> aUU(,)aba'Extract the first component of a pair.  fromRational fromRational :: Fractional a => Rational -> aVwV FractionalaRationala fromRatfromRat :: RealFloat a => Rational -> aWV RealFloataRationala fromIntegral fromIntegral :: (Integral a, Num b) => a -> bWqWIntegralaNumbab%general coercion from integral types  fromInteger fromInteger ::  Num a => Integer -> a)XXNumaIntegerafromEnumfromEnum ::  Enum a => a -> IntXxXEnumaaInt Fractionalclass  Num a =>  Fractional aXFractional numbers, supporting real division. Minimal complete definition: fromRational and (recip or (/)) foldr1foldr1 ::  (a -> a -> a) -> [a] -> aYYaaa[]aa}foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty lists. foldr foldr ::  (a -> b -> b) -> b -> [a] -> bZZabbb[]abfoldr, applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
foldl1foldl1 ::  (a -> a -> a) -> [a] -> aK\1\aaa[]aa}foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty lists. foldl foldl ::  (a -> b -> a) -> a -> [b] -> aJ]-]abaa[]ba&foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
The list must be finite. fmapfmap ::  Functor f => (a -> b) -> f a -> f b^^Functorfabfafbfloorfloor :: (RealFrac a, Integral b) => a -> by_R_RealFracaIntegralbab floatToDigits floatToDigits :: RealFloat a => Integer -> a ->  ([Int], Int))`_ RealFloataIntegera(,)[]IntIntifloatToDigits takes a base and a non-negative RealFloat number, and returns a list of digits and an exponent. In particular, if x>=0, and
floatToDigits base x = ([d1,d2,...,dn], e)
then
  1. n >= 1
  2. x = 0.d1d2...dn * (base**e)
  3. 0 <= di <= base-1
 floatRange floatRange :: RealFloat a => a ->  (Int, Int)ba RealFloataa(,)IntInt floatRadix floatRadix :: RealFloat a => a -> Integerbtb RealFloataaIntegerFloatingclass Fractional a => Floating abTrigonometric and hyperbolic functions and related functions. Minimal complete definition: pi, exp, log, sin, cos, sinh, cosh, asin, acos, atan, asinh, acosh and atanh  floatDigits floatDigits :: RealFloat a => a -> IntSd8d RealFloataaIntFloatdata FloatdSingle-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type. flip flip ::  (a -> b -> c) -> b -> a -> ceveabcbac[flip f takes its (first) two arguments in the reverse order of f. filterfilter ::  (a -> Bool) -> [a] -> [a]bfBfaBool[]a[]afilter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]
FilePathtype FilePath = StringKgFile and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file. FalseFalse :: Bool\hUhBoolfailfail ::  Monad m => String -> m ahhMonadmStringmaexponentexponent :: RealFloat a => a -> Int7ii RealFloataaIntexpexp :: Floating a => a -> ai~iFloatingaaaerrorerror :: String -> aiiStringa<error stops execution and displays an error message. Eqclass Eq aMj?The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq. Minimal complete definition: either == or /=. EQEQ :: OrderingkkOrdering enumFromTo enumFromTo ::  Enum a => a -> a -> [a]El(lEnumaaa[]aenumFromThenTo enumFromThenTo ::  Enum a => a -> a -> a -> [a]llEnumaaaa[]a enumFromThen enumFromThen ::  Enum a => a -> a -> [a][m>mEnumaaa[]aenumFromenumFrom ::  Enum a => a -> [a]mmEnumaa[]aEnumclass Enum amClass Enum defines operations on sequentially ordered types. The enumFrom... methods are used in Haskell's translation of arithmetic sequences. Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details. For any type that is an instance of class Bounded as well as Enum, the following should hold:
enumFrom     x   = enumFromTo     x maxBound
enumFromThen x y = enumFromThenTo x y bound
  where
    bound | fromEnum y >= fromEnum x = maxBound
          | otherwise                = minBound
 encodeFloat encodeFloat :: RealFloat a => Integer -> Int -> a@ss RealFloataIntegerIntaelemelem :: Eq a => a -> [a] -> BoolssEqaa[]aBoolielem is the list membership predicate, usually written in infix form, e.g., x `elem` xs. either either :: (a -> c) -> (b -> c) ->  Either a b -> cttacbcEitherabcCase analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b. Eitherdata Either a buThe Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b. The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").  dropWhile dropWhile ::  (a -> Bool) -> [a] -> [a]wwaBool[]a[]adropWhile p xs returns the suffix remaining after takeWhile p xs:
dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
dropWhile (< 9) [1,2,3] == []
dropWhile (< 0) [1,2,3] == [1,2,3]
dropdrop :: Int -> [a] -> [a]By(yInt[]a[]adrop n xs returns the suffix of xs after the first n elements, or [] if n > length xs:
drop 6 "Hello World!" == "World!"
drop 3 [1,2,3,4,5] == [4,5]
drop 3 [1,2] == []
drop 3 [] == []
drop (-1) [1,2] == [1,2]
drop 0 [1,2] == [1,2]
It is an instance of the more general Data.List.genericDrop, in which n may be of any integral type. Doubledata Double{Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type. divModdivMod :: Integral a => a -> a -> (a, a),||Integralaaa(,)aadivdiv :: Integral a => a -> a -> a||Integralaaaa decodeFloat decodeFloat :: RealFloat a => a -> (Integer, Int)+}} RealFloataa(,)IntegerIntcyclecycle :: [a] -> [a]}l}[]a[]acycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists. curry curry ::  ((a, b) -> c) -> a -> b -> c~~~(,)abcabcCcurry converts an uncurried function to a curried function. coshcosh :: Floating a => a -> a@(Floatingaaacoscos :: Floating a => a -> aFloatingaaaconstconst :: a -> b -> aabaConstant function.  concatMap concatMap ::  (a -> [b]) -> [a] -> [b]ga[]b[]a[]b8Map a function over a list and concatenate the results. concatconcat :: [[a]] -> [a]"[][]a[]aConcatenate a list of lists. comparecompare ::  Ord a => a -> a -> OrderingOrdaaaOrderingChardata ChardThe character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) characters (see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 charachers), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char. To convert a Char to or from the corresponding Int value defined by Unicode, use Prelude.toEnum and Prelude.fromEnum from the Prelude.Enum class respectively (or equivalently ord and chr). ceilingceiling :: (RealFrac a, Integral b) => a -> b΄RealFracaIntegralbabcatchcatch :: IO a -> (IOError -> IO a) -> IO aW.IOaIOErrorIOaIOaThe catch function establishes a handler that receives any IOError raised in the action protected by catch. An IOError is caught by the most recent handler established by catch. These handlers are not selective: all IOErrors are caught. Exception propagation must be explicitly provided in a handler by re-raising any unwanted exceptions. For example, in
f = catch g (\e -> if IO.isEOFError e then return [] else ioError e)
the function f returns [] when an end-of-file exception (cf. System.IO.Error.isEOFError) occurs in g; otherwise, the exception is propagated to the next outer handler. When an exception propagates outside the main program, the Haskell system prints the associated IOError value and exits the program. Non-I/O exceptions are not caught by this variant; to catch all exceptions, use Control.Exception.catch from Control.Exception. breakbreak ::  (a -> Bool) -> [a] ->  ([a], [a])raBool[]a(,)[]a[]abreak, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:
break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])
break p is equivalent to span (not . p). Boundedclass Bounded aThe Bounded class is used to name the upper and lower limits of a type. Ord is not a superclass of Bounded since types that are not totally ordered may also have upper and lower bounds. The Bounded class may be derived for any enumeration type; minBound is the first constructor listed in the data declaration and maxBound is the last. Bounded may also be derived for single-constructor datatypes whose constituent types are in Bounded. Booldata BoolThe Bool type is an enumeration. It is defined with False first so that the corresponding Prelude.Enum instance will give Prelude.fromEnum False the value zero, and Prelude.fromEnum True the value 1. atanhatanh :: Floating a => a -> a)Floatingaaaatan2atan2 :: RealFloat a => a -> a -> a RealFloataaaaatanatan :: Floating a => a -> aFloatingaaaasTypeOfasTypeOf :: a -> a -> a[OaaaasTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second. asinhasinh :: Floating a => a -> ayFloatingaaaasinasin :: Floating a => a -> aڑFloatingaaa appendFile appendFile :: FilePath -> String -> IO ()uVFilePathStringIO()The computation appendFile file str function appends the string str, to the file file. Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.
main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])
anyany ::  (a -> Bool) -> [a] -> BooljaBool[]aBoolmApplied to a predicate and a list, any determines if any element of the list satisfies the predicate. andand :: [Bool] -> BoolJ5[]BoolBooland returns the conjunction of a Boolean list. For the result to be True, the list must be finite; False, however, results from a False value at a finite index of a finite or infinite list. allall ::  (a -> Bool) -> [a] -> BoolyaBool[]aBoollApplied to a predicate and a list, all determines if all elements of the list satisfy the predicate. acoshacosh :: Floating a => a -> aeMFloatingaaaacosacos :: Floating a => a -> aƗFloatingaaaabsabs ::  Num a => a -> aNumaaa^^ (^^) :: (Fractional a, Integral b) => a -> b -> a FractionalaIntegralbaba^ (^) :: (Num a, Integral b) => a -> b -> a3NumaIntegralbaba>>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bÙMonadmmaambmb>> (>>) ::  Monad m => m a -> m b -> m bEMonadmmambmb>= (>=) ::  Ord a => a -> a -> BoolOrdaaaBool> (>) ::  Ord a => a -> a -> Bool!OrdaaaBool== (==) :: Eq a => a -> a -> BoolvEqaaaBool=<< (=<<) ::  Monad m =>  (a -> m b) -> m a -> m bMonadmambmamb<= (<=) ::  Ord a => a -> a -> BooltOrdaaaBool< (<) ::  Ord a => a -> a -> BoolOrdaaaBool/= (/=) :: Eq a => a -> a -> BoolgOEqaaaBool/ (/) :: Fractional a => a -> a -> aܝ Fractionalaaaa. (.) :: (b -> c) -> (a -> b) -> a -> cX?bcabac- (-) ::  Num a => a -> a -> aNumaaaa++ (++) :: [a] -> [a] -> [a]-[]a[]a[]aAppend two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]
If the first list is not finite, the result is the first list. + (+) ::  Num a => a -> a -> alVNumaaaa** (**) :: Floating a => a -> a -> aߠĠFloatingaaaa* (*) ::  Num a => a -> a -> aF0Numaaaa&& (&&) :: Bool -> Bool -> BoolBoolBoolBoolBoolean "and" $! ($!) :: (a -> b) -> a -> b ababDStrict (call-by-value) application, defined in terms of seq. $ ($) :: (a -> b) -> a -> b¢abab!! (!!) :: [a] -> Int -> a$[]aIntaList index (subscript) operator, starting from 0. It is an instance of the more general Data.List.genericIndex, which takes an index of any integral type.  Wordmodule Data.WordUnsigned integer types. YWeakmodule System.Mem.Weak;KIn general terms, a weak pointer is a reference to an object that is not followed by the garbage collector - that is, the existence of a weak pointer to an object has no effect on the lifetime of that object. A weak pointer can be de-referenced to find out whether the object it refers to is still alive or not, and if so to return the object itself. Weak pointers are particularly useful for caches and memo tables. To build a memo table, you build a data structure mapping from the function argument (the key) to its result (the value). When you apply the function to a new argument you first check whether the key/value pair is already in the memo table. The key point is that the memo table itself should not keep the key and value alive. So the table should contain a weak pointer to the key, not an ordinary pointer. The pointer to the value must not be weak, because the only reference to the value might indeed be from the memo table. So it looks as if the memo table will keep all its values alive for ever. One way to solve this is to purge the table occasionally, by deleting entries whose keys have died. The weak pointers in this library support another approach, called finalization. When the key referred to by a weak pointer dies, the storage manager arranges to run a programmer-specified finalizer. In the case of memo tables, for example, the finalizer could remove the key/value pair from the memo table. Another difficulty with the memo table is that the value of a key/value pair might itself contain a pointer to the key. So the memo table keeps the value alive, which keeps the key alive, even though there may be no other references to the key so both should die. The weak pointers in this library provide a slight generalisation of the basic weak-pointer idea, in which each weak pointer actually contains both a key and a value. IVersionmodule Data.VersionA general library for representation and manipulation of versions. Versioning schemes are many and varied, so the version representation provided by this library is intended to be a compromise between complete generality, where almost no common functionality could reasonably be provided, and fixing a particular versioning scheme, which would probably be too restrictive. So the approach taken here is to provide a representation which subsumes many of the versioning schemes commonly in use, and we provide implementations of Eq, Ord and conversion to/from String which will be appropriate for some applications, but not all. PUtilsmodule Foreign.Marshal.Utils#Utilities for primitive marshaling 3Unsafemodule System.IO.Unsafeݮ"Unsafe" IO operations. 'Uniquemodule Data.Unique(4An abstract interface to a unique symbol generator. Typesmodule System.Posix.Types{POSIX data types: Haskell equivalents of the types defined by the <sys/types.h> C header on a POSIX system. Typesmodule Foreign.C.TypesF3Mapping of C types to corresponding Haskell types.  Typeablemodule Data.Typeable The Typeable class reifies types to some extent by associating type representations to types. These type representations can be compared, and one can in turn define a type-safe cast operation. To this end, an unsafe cast is guarded by a test for type (representation) equivalence. The module Data.Dynamic uses Typeable for an implementation of dynamics. The module Data.Generics uses Typeable and type-safe cast (but not dynamics) to support the "Scrap your boilerplate" style of generic programming. Twinsmodule Data.Generics.Twins"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides support for multi-parameter traversal, which is also demonstrated with generic operations like equality. Tuplemodule Data.Tuple0The tuple data types, and associated functions. H Traversablemodule Data. TraversableMClass of data structures that can be traversed from left to right, performing an action on each element. See also Note that the functions mapM and sequence generalize Prelude functions of the same names from lists to any Traversable functor. To avoid ambiguity, either import the Prelude hiding these names or qualify uses of these function names with an alias for this module. JTracemodule Debug.TraceThe trace function. &Timeoutmodule System.TimeoutQ<Attach a timeout event to arbitrary IO computations. Textmodule Data.Generics.TextŸ"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides generic operations for text serialisation of terms. Stringmodule Foreign.C.StringUtilities for primitive marshalling of C strings. The marshalling converts each Haskell character, representing a Unicode code point, to one or more bytes in a manner that, by default, is determined by the current locale. As a consequence, no guarantees can be made about the relative length of a Haskell string and its corresponding C string, and therefore all the marshalling routines include memory allocation. The translation between Unicode and the encoding of the current locale may be lossy. Stringmodule Data.Stringݻ#Things related to the String type. GStrictmodule Data.STRef.Strict9MMutable references in the (strict) ST monad (re-export of Data.STRef) 8Strictmodule Control.Monad.ST.Strictż;The strict ST monad (re-export of Control.Monad.ST) ESTRefmodule Data.STRef1-Mutable references in the (strict) ST monad. Storablemodule Foreign.StorableThe module Foreign.Storable provides most elementary support for marshalling and is part of the language-independent portion of the Foreign Function Interface (FFI), and will normally be imported via the Foreign module. 2 StablePtrmodule Foreign. StablePtrxThis module is part of the Foreign Function Interface (FFI) and will usually be imported via the module Foreign. X StableNamemodule System.Mem. StableNamew9Stable names are a way of performing fast (O(1)), not-quite-exact comparison between objects. Stable names solve the following problem: suppose you want to build a hash table with Haskell objects as keys, but you want to use pointer equality for comparison; maybe because the keys are large and hashing would be slow, or perhaps because the keys are infinite in size. We can't build a hash table using the address of the object as the key, because objects get moved around by the garbage collector, meaning a re-hash would be necessary after every garbage collection. 6STmodule Control.Monad.STThis library provides support for strict state threads, as described in the PLDI '94 paper by John Launchbury and Simon Peyton Jones Lazy Functional State Threads. QShowmodule Text.ShowWConverting values to readable strings: the Show class and associated functions. Schemesmodule Data.Generics.SchemesZ"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides frequently used generic traversal schemes. 1 SampleVarmodule Control.Concurrent. SampleVarQSample variables #ReadPrecmodule Text.ParserCombinators.ReadPrec@This library defines parser combinators for precedence parsing.  ReadPmodule Text.ParserCombinators.ReadP.PThis is a library of parser combinators, originally written by Koen Claessen. It parses all alternatives in parallel, so it never keeps hold of the beginning of the input string, a common source of space leaks with other parsers. The '(+++)' choice combinator is genuinely commutative; it makes no difference which branch is "shorter". !Readmodule Text.ReadeConverting strings to values. The Text.Read library is the canonical library to import for Read-class facilities. For GHC only, it offers an extended and much improved Read class, which constitutes a proposed alternative to the Haskell 98 Read. In particular, writing parsers is easier, and the parsers are much more efficient. DRatiomodule Data.RatioC'Standard functions on rational numbers 0QSemNmodule Control.Concurrent.QSemNMQuantity semaphores in which each thread may wait for an arbitrary "amount". /QSemmodule Control.Concurrent.QSem3Simple quantity semaphores. KPtrmodule Foreign.PtrThis module provides typed pointers to foreign data. It is part of the Foreign Function Interface (FFI) and will normally be imported via the Foreign module. ZPrintfmodule Text.PrintfWA C printf like formatter. Preludemodule PreludeThe Prelude: a standard module imported by default into all Haskell modules. For more documentation, see the Haskell 98 Report http://www.haskell.org/onlinereport/. OPoolmodule Foreign.Marshal.PoolThis module contains support for pooled memory management. Under this scheme, (re-)allocations belong to a given pool, and everything in a pool is deallocated when the pool itself is deallocated. This is useful when Foreign.Marshal.Alloc.alloca with its implicit allocation and deallocation is not flexible enough, but explicit uses of Foreign.Marshal.Alloc.malloc and free are too awkward. COrdmodule Data.OrdC Orderings  Numericmodule Numeric}^Odds and ends, mostly functions for reading and showing RealFloat-like kind of values. -MVarmodule Control.Concurrent.MVarSynchronising variables +Monoidmodule Data.MonoidcThe Monoid class with various general-purpose instances. Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://citeseer.ist.psu.edu/jones95functional.html) Advanced School of Functional Programming, 1995. Monadmodule Control.MonadfThe Functor, Monad and MonadPlus classes, with some useful operations on monads. WMemmodule System.Mem?Memory-related system things.  Maybemodule Data.Maybe+The Maybe type, and associated operations. Marshalmodule Foreign.MarshalMarshalling support AListmodule Data.List4Operations on lists. "Lexmodule Text.Read.Lex{.The cut-down Haskell lexer, used by Text.Read FLazymodule Data.STRef.Lazy)Mutable references in the lazy ST monad. 7Lazymodule Control.Monad.ST.LazyBThis module presents an identical interface to Control.Monad.ST, except that the monad delays evaluation of state operations until a value depending on them is required. BIxmodule Data.IxThe Ix class is used to map a contiguous subrange of values in type onto integers. It is used primarily for array indexing (see the array package). 4IORefmodule Data.IORef$Mutable references in the IO monad. IOmodule System.IO;The standard IO library.  Internalsmodule System.Posix. InternalsPOSIX support layer for the standard libraries. This library is built on *every* platform, including Win32. Non-posix compliant in order to support the following features: * S_ISSOCK (no sockets in POSIX)  Intmodule Data.IntSigned integer types  Instancesmodule Data.Generics. Instances"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module instantiates the class Data for Prelude-like datatypes. (This module does not export anything. It really just defines instances.) * Instancesmodule Control.Monad. Instances'Functor and Monad instances for (->) r and Functor instances for (,) a and Either a. VInfomodule System.Info[Information about the characteristics of the host system lucky enough to run your program. @ HashTablemodule Data. HashTable{An implementation of extensible hash tables, as described in Per-Ake Larson, Dynamic Hash Tables, CACM 31(4), April 1988, pp. 446--457. The implementation is also derived from the one in GHC's runtime system (ghc/rts/Hash.{c,h}). RGetOptmodule System.Console.GetOptThis library provides facilities for parsing the command-line options in a standalone program. It is essentially a Haskell port of the GNU getopt library. Genericsmodule Data.Generics"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. To scrap your boilerplate it is sufficient to import the present module, which simply re-exports all themes of the Data.Generics library. [ Functionsmodule Text.Show. FunctionsOptional instance of Text.Show.Show for functions:
instance Show (a -> b) where
	showsPrec _ _ = showString \"\<function\>\"
5Functionmodule Data.Function9Simple combinators working solely on and with functions. L ForeignPtrmodule Foreign. ForeignPtrThe ForeignPtr type and operations. This module is part of the Foreign Function Interface (FFI) and will usually be imported via the Foreign module. Foreignmodule ForeignfA collection of data types, classes, and functions for interfacing with another programming language. ?Foldablemodule Data.FoldableloClass of data structures that can be folded to a summary value. Many of these functions generalize Prelude, Control.Monad and Data.List functions of the same names from lists to any Foldable functor. To avoid ambiguity, either import those modules hiding these names or qualify uses of these function names with an alias for this module. >Fixedmodule Data.Fixed This module defines a "Fixed" type for fixed-precision arithmetic. The parameter to Fixed is any type that's an instance of HasResolution. HasResolution has a single method that gives the resolution of the Fixed type. Parameter types E6 and E12 (for 10^6 and 10^12) are defined, as well as type synonyms for Fixed E6 and Fixed E12. This module also contains generalisations of div, mod, and divmod to work with any Real instance. ,Fixmodule Control.Monad.FixMonadic fixpoints. For a detailed discussion, see Levent Erkok's thesis, Value Recursion in Monadic Computations, Oregon Graduate Institute, 2002. UExitmodule System.ExitExiting the program. % Exceptionmodule Control. Exception~This module provides support for raising and catching both built-in and user-defined exceptions. In addition to exceptions thrown by IO operations, exceptions may be thrown by pure code (imprecise exceptions) or by external events (asynchronous exceptions), but may only be caught in the IO monad. For more details, see:
  • A semantics for imprecise exceptions, by Simon Peyton Jones, Alastair Reid, Tony Hoare, Simon Marlow, Fergus Henderson, in PLDI'99.
  • Asynchronous exceptions in Haskell, by Simon Marlow, Simon Peyton Jones, Andy Moran and John Reppy, in PLDI'01.
Errormodule System.IO.ErrorStandard IO Errors. NErrormodule Foreign.Marshal.ErroryRoutines for testing return values and raising a userError exception in case of values indicating an error state. MErrormodule Foreign.C.ErrorCC-specific Marshalling support: Handling of C "errno" error codes. =Eqmodule Data.Eq/ Equality T Environmentmodule System. Environmentw8Miscellaneous information about the system environment. $Eithermodule Data.Either,The Either type, and associated operations. Dynamicmodule Data.DynamicCThe Dynamic interface provides basic support for dynamic types. Operations for injecting values of arbitrary type into a dynamically typed value, Dynamic, are provided, together with operations for converting dynamic values into a concrete (monomorphic) type. SCPUTimemodule System.CPUTimeThe standard CPUTime library.  Concurrentmodule Foreign. ConcurrentIFFI datatypes and operations that use or require concurrency (GHC only).  Concurrentmodule Control. ConcurrentbGA common interface to a collection of useful concurrency abstractions. ;Complexmodule Data.ComplexComplex numbers. <Coercemodule Unsafe.Coerce$The highly unsafe primitive unsafeCoerce converts a value from any type to any other type. Needless to say, if you use this function, it is your responsibility to ensure that the old and new types have identical internal representations, in order to prevent runtime corruption. The types for which unsafeCoerce is representation-safe may differ from compiler to compiler (and version to version).
  • Documentation for correct usage in GHC will be found under 'unsafeCoerce#' in GHC.Base (around which unsafeCoerce is just a trivial wrapper).
  • In nhc98, the only representation-safe coercions are between Enum types with the same range (e.g. Int, Int32, Char, Word32), or between a newtype and the type that it wraps.
:Charmodule Data.CharP)The Char type and associated operations. .Chanmodule Control.Concurrent.ChanUnbounded channels. Cmodule Foreign.C1Bundles the C specific FFI library functionality 9Boolmodule Data.BoolV,The Bool type and related functions. Bitsmodule Data.Bits/This module defines bitwise operations for signed and unsigned integers. Instances of the class Bits for the Int and Integer types are available from this module, and instances for explicitly sized integral types are available from the Data.Int and Data.Word modules. Basicsmodule Data.Generics.Basics"Scrap your boilerplate" --- Generic programming in Haskell. See http://www.cs.vu.nl/boilerplate/. This module provides the Data class with its primitives for generic programming. basepackage baseBasic libraries This package contains the Prelude and its support libraries, and a large collection of useful libraries ranging from data structures to parsing combinators and debugging utilities. )Arrowmodule Control.ArrowBasic arrow definitions, based on Generalising Monads to Arrows, by John Hughes, Science of Computer Programming 37, pp67-111, May 2000. plus a couple of definitions (returnA and loop) from A New Notation for Arrows, by Ross Paterson, in ICFP 2001, Firenze, Italy, pp229-240. See these papers for the equations these combinators are expected to satisfy. These papers and more information on arrows can be found at http://www.haskell.org/arrows/. Arraymodule Foreign.Marshal.Array*Marshalling support: routines allocating, storing, and retrieving Haskell lists that are represented as arrays in the foreign language ( Applicativemodule Control. ApplicativeThis module describes a structure intermediate between a functor and a monad: it provides pure expressions and sequencing, but no binding. (Technically, a strong lax monoidal functor.) For more details, see Applicative Programming with Effects, by Conor McBride and Ross Paterson, online at http://www.soi.city.ac.uk/~ross/papers/Applicative.html. This interface was introduced for parsers by Niklas Rjemo, because it admits more sharing than the monadic interface. The names here are mostly based on recent parsing work by Doaitse Swierstra. This class is also useful with instances of the Data.Traversable.Traversable class. Allocmodule Foreign.Marshal.Alloc:Marshalling support: basic routines for memory allocation Aliasesmodule Data.Generics.Aliases)"Scrap your boilerplate" --- Generic programming in Haskell See http://www.cs.vu.nl/boilerplate/. The present module provides a number of declarations for typical generic function types, corresponding type case, and others. [  l U > *   ~ s _ N 7  |qbA4!u\B$~ofZK;0'kU>3 TextShow FunctionsTextPrintfSystemMemWeakSystemMem StableNameSystemMemSystemInfoSystemExitSystem EnvironmentSystemCPUTimeSystemConsoleGetOptTextShowForeignMarshalUtilsForeignMarshalPoolForeignMarshalErrorForeignCErrorForeign ForeignPtrForeignPtrDebugTraceDataVersionData TraversableDataSTRefStrictDataSTRefLazyDataSTRefDataRatioDataOrdDataIxDataListData HashTableDataFoldableDataFixedDataEqUnsafeCoerceDataComplexDataCharDataBoolControlMonadSTStrictControlMonadSTLazyControlMonadSTDataFunctionDataIORefSystemIOUnsafeForeign StablePtrControl Concurrent SampleVarControl ConcurrentQSemNControl ConcurrentQSemControl ConcurrentChanControl ConcurrentMVarControlMonadFixDataMonoidControlMonad InstancesControlArrowControl ApplicativeDataUniqueSystemTimeoutControl ExceptionDataEitherTextParserCombinatorsReadPrecTextReadLexTextReadNumericDataDynamicForeignCTypesSystemPosix InternalsSystemIOErrorSystemIODataBitsDataStringDataTupleForeignCStringForeignStorableForeignMarshalAllocForeignMarshalArrayForeignMarshalControl ConcurrentForeignCSystemPosixTypesForeignForeign ConcurrentTextParserCombinatorsReadPDataWordDataIntDataMaybeDataTypeableControlMonadPreludeDataGenericsTwinsDataGenericsTextDataGenericsSchemesDataGenericsAliasesDataGenerics InstancesDataGenericsBasicsDataGenerics base3.0.1.07http://haskell.org/ghc/docs/latest/html/libraries/base/2http://haskell.org/ghc/docs/latest/html/libraries/