HOOG, q% 2z5!$%&'%%* + - ./0 @@>>  1<<\\66  ""''PP2 hh]],,3 ]]44;;4^^  55<<566==6  \\^^  77>>788??8__!!:<!,,=!"$%''>  #)--\**^))+._xx++II**,,AAa/kttwz~   $$))558:@@CCginnrrwx~~   "$%++37==@@BBJJMNUUWWZZacnpvx|wbY/0AAk|!!;<BBQQ  (*3466;<BCQQYYee  ''22QQVWabmnzz||&'--<<VVXX^_eenott||c1278=AMMOPRSVVYYefjjptwy|  $$++009:@@FGMMRRUUehoorrwxzz||  ##*-0055<=DDPPZZ``beppxy  56;;?EZZhhjjllppss{{mvd37BCEEJLPQ[[aajjrtvv{{  ##%%,,/0:>CDSSyy    $$00335577@@BBKLOQjjoowwzz  $088;;WY^^ijssww#%..77ue00379:ADFFJMPSVVYY]]`cefjlooqtv|  &(7::@FHILMOQUUWZafiil} #&),,12sf36JJaaccjjqqss{{ "22::ABX[^_ccqq  %*119<CCEEJJQSnnvv{|  !!&,..HKRRVVddmoqq~~$$/159JJNN``ffllsg458;PQqq!!''6689JJhino(/<<CCMNWWaajjlptt}}::?@BEHJTWYZ^^``rr..99CCEEHKXXikrr  shQ22OORSYY__ii#$--77@@YZeehhoorryy||  Jooww~5688AAWY``y}.GMMyy{{} )),,:Ai36:;BDFFJJMNRSVVYY^_abefjjmoqqss  !!%-/0236799AAHHSS\]dirruu{{  !"&&)*..068:<<BCEEJpjk000ptwz3399GHQQUU``zz**4477<<AA#ZZ$%OQXX``wyl00368DJJMNXXZZ\\aapu    &&)).3557:AAGHQQfgiiwx~~    "#%'**..0037<<??EEHIMMUUaaccnpvx}mm66::KK[[ddjjtt{{%%.029IJTTW\bbefhhoprs}}  55BBNNnnvvzz9;;FGLLNPTTWXZ[__fhnnqqzz||$%HI&mn38:;CGJLNNRSVV[[^_abeillqqstvvyy||  #$')++/0338]aaccggiikknntuyz}}  !")*,,./22558:<<??BCFFJJLMOjllnpttvyjo024588=CFFKLNNQSV]acefjjpvyy{|  #$''*+117:=>BVXaccelpqsz    "#%%**,-/277<<BBDDFGJJMMPQSSUU``hhj|fp457799;;BCHNRSVVXXZZ\\ccef""''114577LMTT__alrrz{   %%//228?FFJJMNfimmssuuyy|dq&&mm!!UUNOSS(,HI\\nnr39;;?@BDFFN]`bjjqqttw{  $%'(,-5599?@LLNOSSX\__bcflnxzz|}  ""%%))++33568:=@BCJJMNPPWY`ilmqu{| bs/288ACPPSS\\^fkkno~  #$&'+,005699??BBJJMPUUaacchhkkqrx~    #&',,/6>?AHPQVVXZ``dfllrrtx}_t004578:;ADFFMNRSVV`cejlosswy||~   "$((--4578::>@CCEEKLOOQVY\__aacceehhjlpprsuuyz}  ""(/568?BFIJ6\u00CC\\ddqqvv{|    $$77@@BBW[aaccggiikkyz  !"'*;?CCJJQQUU|| //36SSVVYYahppz{U[v457DDMMtt  ))55DD\\ggii%%55*+1277FGJJLLPPYY~~GG``ssxx..w&W]ll##>>yy%%66GGJJ #<S}~2G``ssyy/22:Ax3BBNNRSVVef//FF]]  HHORyy  ..YYjjll..77::TTll00y?CGGUVXXccefjjss||""45;<PPTTVV__ll::@@BBMMYYeemmssuu}}',1288;;=>FGbbmn||&'FFOPVV[[Zz36]]oo66  &&EE99NNhh2A| BC #]ZGGb()Z->gZAllFZAny%Z BlockReasonZBoolZCCharYCClockYCDevZYCDoubleYCFloatXCIno`XCIntXCIntMaxWCIntPtrWCLDouble/WCLLongVCLongVCModeWVCOffVCPidUCPtrdiffUCSChar7UCShortT CSigAtomicTCSize_TCSsizeTCTimeSCUCharSCUIntUSCUIntMax SCUIntPtrRCULLong}RCULong5RCUShortQCWcharQChanQCharwQComplexlQ ConsoleEventLQConstrCQ ConstrRep:QDataRep1QDataType+QDoubleQDynamicPE12PE6PEitherPErrnoP ExceptionPFdhPFixity_PFloatFPGeneralCategory$PHashDataPIOPIdOInsertsOIntOInt16OInt32OInt64OInt8gOIntPtrOIntegerOLexemeNMaybeNNestedAtomicallyN NoMethodError}NNonTerminationdNOrderingTNPCNPatternMatchFail*NQSem NQSemNNReadPMReadPrecM RecConErrorM RecSelErrorM RecUpdErrorMSTMM StableNameuMTVarjMThreadIdTM ThreadStatusGMTimeout+MUnique#MVersionMWordLWord16LWord32LWord64LWord8LWordPtrCLZipList.L[::]L[]K TraversableFoldable Applicative AlternativeMonadFix MonadPlusFunctorMonadFunctor Applicative ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorableEqOrdShowReadTypeableOrdEqTypeableShow ExceptionEqShowOrdEqShowEqOrdTypeable Typeable1 Typeable1 Typeable1FunctorMonadTypeableShow ExceptionTypeableShow ExceptionTypeableShow ExceptionFunctorMonad MonadPlusFunctorMonad MonadPlusTypeableTypeableTypeableShow ExceptionMonad MonadPlusMonoidDataIxTypeableShow ExceptionTypeableShow ExceptionTypeableShow Exception TraversableFoldable Applicative AlternativeMonadFix MonadPlusFunctorMonadShowEq PrintfArgDataBitsIx ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEq PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorable PrintfArgDataStorableBitsIxEqFunctor Applicative ApplicativeMonadFixShowEqIxBoundedShowReadEnumOrdEq PrintfArgDataStorableShowEq ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqTypeable ExceptionShowEqEq Typeable2 HasResolution HasResolution ExceptionTypeableShow PrintfArgDataStorableShowShowEqShowEqShowEqReadShowEnumOrdEqTypeable Typeable1 PrintfArgIsCharDataStorableIx 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 ReadShowTypeableBitsIntegralBoundedRealStorableEnumNumOrdEqDataStorableIxShowOrdEqMonoidBoundedShowReadOrdEqMonoidBoundedShowReadOrdEqArrow ArrowChoice ArrowApply ArrowLoopCategoryMonoidDataEqOrdIxZ ByteCount]CString] CStringLen]CWString] CWStringLen] ClockTick]ConIndex]DeviceID] EpochTime}]FileIDv]FileModen] FileOffsetg]FilePathZ]FinalizerEnvPtr'] FinalizerPtr]IOError\IPr\Limit\Micro\Pico\Prec\ProcessGroupID\ ProcessID\Rational\ReadSk\ SampleVarI\ShowS.\String!\[]Char[]Char[]CharaMVar(,)IntMVaraa[]Char[](,)a[]CharRatioIntegerCPidCPidIntFixedE12FixedE6CLong(,)IntInt IOExceptionaFunPtrPtraIO()envaFunPtrPtrenvPtraIO()[]CharCOffCModeCInoCTimeCDevIntCClock(,)PtrCWcharIntPtrCWchar(,)PtrCCharIntPtrCCharCSize([tabcde_fWg܄hi~j~k{~l{mxn voksp pqorksftbuav`w^z}^i^p^l^i^s^t^ZipList#`e`o`r^a_i^t^e^m^o^d^e_IOModep_a_m_p(_e/_d6_at_mB_oI_nP_aW_d^_ WrappedMonadr{_r_o_w_ WrappedArrowo_n_a_d_ WrappedMonadr_r_o_w_ WrappedArrowr `d`Word#`1`3`6j`8[`p<`tC`rJ`WordPtrWord84q`Word642`Word326`Word16Word#a`k`WeakWorde`r`s`iaoanaVersionnbpas0ae7ar>aiEanLatSaeZaraarhauoapvat}aAsyncExceptionpaearacaaasaealaeatataearaGeneralCategoryd2bi bqbube"bUniquee9bfubrEbfLblSboZbwabArithExceptioni|bnbebdbeblbebmbebnbtbArrayExceptionheidrKdvdybccpbeca/crcecpcTypeRepb6cl=ceDcTypeable1c2c3c4c5c6c7yc Typeable7 Typeable6 Typeable5 Typeable4 Typeable3 Typeable2 Typeable1odn dTyCona"dr)dTVar#ieEinripQitXir_i StablePtrayimiei StableNameaicie3jiinigicioimibiiiniiinigjm jajrjkjGeneralCategoryGeneralCategorymOjeVje]jxdjckjerjpyjtjijojnj SomeExceptionojujtjdjojwjnj ConsoleEventwjShowskShowSekk$kfWkm0ko7kd>keEkSeekModer^koekmlkesknzkdkSeekModemkpklkekvkakrk SampleVaraoelikgkhktkEitheranc/mllqtlt lu'lr.ln5lituEtaLttStiZtoatnhtGeneralCategoryutmtbtetrtGeneralCategoryetttttetrtGeneralCategorydtOrdeur uiunug"uOrderingeut@uaudmuiQuoXun_uOptDescretus{ucuruOptDescrruguArgDescrnupuuunucutuuuautuiuovn vGeneralCategoryexxoEvu1vm8vNuma\xbxmwnvrvtevavhqvixvnvgvMaybesvsvivgvnvevdvGeneralCategoryevpvDataReps\wtvewr wmwiwn!wa(wt/wi6wo=wnDwNonTerminationpcwajwcqwixwnwgwmwawrwkwGeneralCategoryewtwhwowdwewrwrwowrw NoMethodErroruxf"xf)xe0xr7xi>xnExgLx BufferModercxgjxArgDescrsxtxexdxaxtxoxmxixcxaxlxlxyxNestedAtomicallyac{i?{ozu?yvyayryMVar#0yMVar#tFyaMybTyl[yebyaybnyyuyt|yeyayryryayyy#yMutableByteArray#ryryayyy#y MutableArray#dznza8zozi!zd(zMonoidd?zMonadfzpXzl_zufzsmz MonadPlusizxzMonadFixizfzizezrzl{szyzmzbzozlzGeneralCategorye{t{t{e#{r*{GeneralCategorycF{rM{oT{Microt{yo{bv{e}{Maybeh{s{y{m{b{o{l{GeneralCategorya_~e}i|o{g|sb|w{e|r|c|a|s|e#|l*|e1|t8|t?|eF|rM|GeneralCategorysi|op|fw|p~|r|e|c|i|s|i|o|n|ArithExceptiono|f|f| ConsoleEventm}n|e}b]}s}e}p}a%}r,}a3}t:}oA}rH}GeneralCategoryud}fk}fr}ey}r}i}n}g} BufferModei}t}LimitfL~t}x}e}m}e}Lexemet}e~r ~n~u~m"~b)~e0~r7~GeneralCategorytS~Eithersf~tm~Lastl~e~i~s~l~i~Kleisliu~s~t~MaybedgƂnopmsx~IxcHstr!i(n/g6IsStringhOaVr]IsCharrtIPrIOemrefIORefodeIOModer0xcepti on IOExceptionr7o>rEIOErrort[ybpiep IOErrorTypedWf=itInt #ہ1Ł368cYeprՀe܀pDataReptrIntPtrgeAr!a(l/IntegralrHIntegero`ngsntur| ConstrRepInt84Int642Int326́Int16Int#tialq uot!e(GeneralCategoryiDxKFixitye^xeolustzofboundsArrayExceptionn͂oԂrۂeHandlerentLexemeaσeup!r(i/n6t=fDtKyRpYe` HPrintfTypea|poverflowAsyncExceptionnssۃh=resolu tion& HasResolutiontDaKbRlYe` HashTabledzleHandleprHandlerosnȄ HandlePosneneralc ate"g)o0r7y>GeneralCategorydSi[lȆor΅uwn~cptrFunPtrtorFunctoraՅc܅tional Fractionallr&eUm2a9t@GeneralCategoryi\gcnjpqtxr ForeignPtrdableFoldableoφaֆt݆c)i repDataRepngFloatingo0n7s>tErL ConstrRepln·rxqei}tyFixitydFixedstFirstaՇl܇iquoteGeneralCategoryz e'r.e^p:tArH FinalizerPtrnevlpstzrFinalizerEnvPtrei<moވpatňḧFilePathffset FileOffsetod#e*FileModedCFileIDFd 1p6di8nopKq?rxcitcne'fsucʼnc̉eӉsډsExitCodeailu reExitCodex.c5e<pCtJiQoXn_ Exceptionoud|eExitCodeeption Exception Exceptionrn)orcall ErrorCallo0ErrnoEqoRcYh`tginmue| EpochTimefLexemec݋dȋumEnumoϋEndolosingmark#GeneralCategoryt?hFeMrTEitherE62wE12a eio@u$ynaexcŌěpӌtڌion Exceptionmi cDynamica+l2DualuawLnSDownbhloevDoublevidebyzerōo̍ArithExceptionacfgn0vic eidDeviceIDo7r>mEaLlSArithExceptionanuul|tHandlerimalnumbȎeώr֎GeneralCategorydlockDeadlockst,a3DatarrtKyRpYe`DataTypeeypDataRephpunctuaɏtЏi׏oޏnGeneralCategoryaXc dfLhijrl1m opst[uՐwGcsStZraihnogvCWStringlen CWStringLenharŐCWcharc6iϑlrshort CUShortr$e+n2c9y@sGyNmUb\ocljGeneralCategorylongCULongongCULLongn֑tݑCUIntmptrCUIntPtrax$CUIntMaxh=aDrKCUCharibmiepCTimechsistringCStringl̒eӒnڒ CStringLenizeCSsizeg5ze&CSizea<tCoJmQiXc_ CSigAtomicozrtCShortharCSCharitɓrГdדiޓffCPtrdiffdCPidfm˕n$ins{t:rAoHlOGeneralCategoryci ConsoleEventoєtConstrConstrrep ConstrReplؔeߔevent ConsoleEventec&t-o4r;pBuInPcWt^uealtsizonGeneralCategoryndexConIndexpҕlٕexComplexfCOffode"CModed=loBcn̖sSeZ ConsoleEventpquxnctuationGeneralCategorygӖCLongktick ClockTickon&g-CLLongoDuKbRlYe`CLDoublemypbufCJmpBufnotCIntmpїtؗrߗCIntPtraxCIntMaxCInoa$n>r0CharChanilzp]odskCFposoatCFloatleCFileeoȘuϘb֘lݘeCDoublevCDevh;loc$k+CClockaBrICChart_cekgroyryCategoryhHandleriȝlҚor]uy͙tԙeۙcount ByteCountffe&r-m4o;dBeI BufferModeedakkr ConsoleEventoundedBoundedlĚBooloٚckbe0reas on BlockReasond7ioCnJb͜de8fmosotvm} BlockReasonther BlockReasonv›aɛrЛ BlockReasonoreign cal l' BlockReasonx?cFeMpTt[iboinp BlockReasoneadmvarBlockedOnDeadMVarlԜaۜckhole BlockReasonnd$e+f2i9n@iGtNeUl\ycBlockedIndefinitelyuffering BufferModetϝs֝Bitsb dl8n$prs szync#e*x1c8e?pFtMiTo[nbAsyncExceptionertionfaileǞdΞAssertionFailedg-iȠraHow Arrowaclmp`z8e?rFoM ArrowZerolgunsu ArrowPlusonad ArrowMonadooƟp͟ ArrowLoophoice ArrowChoicepp&l-y4 ArrowApplyyOArray#ehxocve}ptionArrayExceptionArray#tϠh֠eݠxceptionArithExceptiondgo9r@dGeNrUArgOrderensuc|rArgDescrpelicatġiˡvҡe١ Applicativendmo deIOModey+AnygltIePrWn^aetlisvze AlternativeAllcʢrepDataRepoѢnآsߢtr ConstrRepdr #Addr#s'o.l5u<tCeJsQeXe_kfSeekMode:][]:][::])()$\;r BehF b дIJϧ|Char[]Char[] 3N/Char[]a(,)[]Char[]8AllAnyArithException,ArrayExceptionAssertionFailedAsyncException-BlockedIndefinitely.BlockedOnDeadMVar/Boolphgfed^F?M0 BufferMode1CCharCharConstri ConstrRep DataRep02DataTypejDeadlock3DynamickErrno4 ErrorCall Exception5ExitCode 6FdFixity7GeneralCategory8Handle9 IOErrorType: IOExceptionIOMode;Intonml4GNL<Int32 =IntPtrIntegertsr>Lexeme?NestedAtomically@ NoMethodError NonTerminationAOrdering'PatternMatchFail! RecConError" RecSelError# RecUpdError$SeekModeB SomeExceptionCTyCon0%TypeRepu2,Version1DWordPtraI6(  |{zyxwvqJ  LKJIH)('&{^]\[OHGFEb  RPc,)iSmr:9*resu()IO ExceptionIO()IOaPtrFunPtrbamKleislicba WrappedArrowV()sSTIntInt(,)9IntInteger(,):aa(,)}Yaacat)ab(,)~;am WrappedMonadrasSTyba ArrowMonadUbaConst>baEither@bba'cacatihcba*\T(dba-+b`asSTRefsSTRc'c(,)ba]TypeRep[]TyCon(,)-cta(,)y[]acc(,)$S()IO=OG*)(&%uonjhfbaXW ()Ptr()ReadP()f{()m ~QArithExceptionMaybeAsyncExceptionMaybeBoolIO pU  BufferModeIOCharIO CharReadPCharReadPrec!Char[] U6+ %ConstrMaybeConstr[]DynamicMaybeErrnoIOHandleIOHandleMaybe HandlePosnIO IOExceptionMaybeIntION.IntMaybeYInt[]Z7IntegerIOIntegerRatioPLexemeReadPLexemeReadPrec"PoolIOQSemIOQSemNIOThreadIdIOqTypeRepMaybe1TypeRep[]/UniqueIOVersionReadPaArgDescr<aArgOrderaComplex=ZaDual?aEndoaFirstaFunPtraHandler1aIO1542H.-,+}|zwvVaLastaMaybeI3_aOptDescr aProductLaPtr8caRatioaReadP QaReadPrec $#a StablePtraSumSaZipList4a[]#%]\[WVy>=:987Kacafba|ml*am/.cwsq+b ForeignPtr`bFunPtrebIO `_OMdbMaybeTKbPtrgb[] bfponbmxvutbtcIO~xc[]cfcm&d[]dfeMaybe'e[]f[]g[]h[]rIOrm#"! u[]0 gfedcba(,,,,,,)[]Efedcba(,,,,,)[]Dedcba(,,,,)[]Cdcba(,,,)[]Bcba(,,)[]AdcbEitheraacd(,)bd(,)aXcdEitherbdEithera[c'c(,)b'b(,)a^c'cEitherb'bEithera_dc(,)db(,)aWdcEitherdbEitheraZYa ExceptionEitherIOra IOExceptionEitherIOsabEitherIO3aeEitherIOtba(,)[]@valkey HashTableIO87Char[]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[](,,,)R Char[][]Char[][]a[](,,)Q%CCharPtrIOCWcharPtrIOChar[]IOJI Char[]MaybeChar[]ReadPChar[]ReadPrecChar[][]5 aChanIOSa ForeignPtrIOkiaIORefIOAaMVarIOCaMaybeIOaMaybefjaPtrIOXD$#"! 2 a StableNameIOEa StablePtrIOFa[]IOM;Ta[]Maybe<a[]ReadPa[]ReadPrec a[][]65a[]fka[]macMaybefeatfzatm}bMaybeIObPtrIOb[]mPbcMaybegbtfbtmc[]mkWeakIOvMaybeIOvWeakIOvalMaybeIOmcbcba(,)a&bat'cMaybedvk(,)WeakIOvalkey(,)[]IOlaMVarInt(,)MVarIOBHandleChar[](,)IO IntCCharPtr(,)IOIntCWcharPtr(,)IOaChar[](,)ReadPChar[]a[](,)[]c[]b[](,)mChar[][]IO aIORefWeakIOat'cMaybecChar[]Char[](,)[]IO'0 | @ gEak@ r7k5t8'2eBresresbacIOcIObPtraChar[]Char[]aChar[]a(,)[]Char[]Inthgfedcbagfedcbafedcbara5a4a3a2a1edcbara4a3a2a1 dcbara3a2a1! BoolaaBoolkeykey8Orderingaaaaaaba  bba   cbacbb)ra2a1"rrr':rr'r9ca(,)bayacc(,)xacc$ambabmbacmbaBoolCharBoolaCharInt Exception Exception IOException IOExceptionIntCharInt32key87aaab'ba,)bb(cacb,+*bdc-`e2e16mara1#r'd:9ud0asSTaba(,)abIOaPtrInt`O()IO ExceptionBoolmaChar[]aaIO Exception|aIO IOException}aIOaaIOb54aIOe21aIO exceptionaReadPIntamabIOPoolbIOa~bMaybe ExceptionbMaybeabMaybee543b[]abfabma &vQPcIOa~cmb&dmd/.gcgrIOHandlercrba(,)IOaba(,)Maybeb%cb(,)maaPtrIOabcdbdcrcrbccba(,)aChar[]resb[]Char[]Char[]aIOCCharPtr-aIOCWcharPtr.bIOaPtr_MdcIObPtrChar[]a(,)[]Char[]aIOIntCCharPtr(,)+aIOIntCWcharPtr(,),aChar[]Maybe4Addr#AllAnyArithExceptionArrayExceptionAsyncExceptionBool  BufferModeCCharCIntChar Constr w ConstrRepDataType DoubleDynamicErrno ExceptionExitCodeFdFixityHandle HandlePosn IOErrorType IOException IOModeInt7qp&"!     HIntPtrIntegerPool $#"! QSem%QSemN&SeekMode SomeException'ThreadId*)(TyCon,+TypeRep 322110/.-Unique4Version765WordPtr8a:960/.,))(&  ~~}}|{zyxwvuacc$b''%   de) exception*ikkeyponmr:9vvalpoXtsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9$#R)^XNMaaaReadPbafpobamx()IOaPtrenvPtrFunPtrkj()IOaPtrFunPtrihgfedcbatfedcbatedcbatdcbatbamKleislicba WrappedArrowcbata RealWorldSTaa(,)NMLKam WrappedMonadasSTasSTRefb()aUba(,)PObaConst\baEitherbacatihbatcba -`_^]\\[ZYXWVcbcatihc'ba]c'b'a_^dbaadca+bavalkey HashTableponmlF()IOqb()Ptr()mBool[]BooltCCharPtrCWcharPtrChar[]Y/.-,+*)('&%$#"!         Constr[]0HandleMaybeIntMaybeInt[]1IntegerRatioTypeRep[],aArgDescr aArgOrderRQaChanXWVUTSaComplex[ZYaDual]aEndo^aFirst_aFixeda ForeignPtrjhdcba`aFunPtrgfeaIO+5432~}|{zyxwvutsraIORefaLastaMVar aMaybe JaProductaPtr#ONMkiaRatioaReadPQaReadPreca StableNamea StablePtraSumaZipLista[]Y  `_^]\[ZYXO$ QPONMLKJIHGFEDCBA@??>>==<<;;:98765432Wacgaf ponmllkjam xvutssrat da1m#"! a2m"! a3m! a4m a5mbIOxwbPtrb[] SREDCBA@bfbnmbmubt cIOxc[] EDCBAcfcloseReadPd[]EDCBdmwe[]EDCendReadPenvPtrkjf[]EDg[]EmtopenReadPsepReadPvWeakx[]$ gfedcba(,,,,,,)[]fedcba(,,,,,)[]edcba(,,,,)[]dcba(,,,)[]cba(,,)[]dc(,)db(,)aTba(,)[]TbaEither[]batcdedtcfvalkey(,)[]7aMVarInt(,)MVarIntCCharPtr(,)IIntCWcharPtr(,)J()IOMaybeChar[]MaybeChar[][]1 RQaHandler[]zaMaybe[]aOptDescr[]RQaPtrIO aReadP[]aReadPrec[]a[][]7a[]tyaft|{zam[]ammqamt~}atccdtce:ZZZZZtZiZSZAZ/Z ZYYYYYYYYYxYmY^YSY=Y2Y#YY YYXXXXXXXtX\XIX2XXXWWpWaWRW?W0WW WwU\UQUBUTTTrTbTWTLT=T.TT TSSSSSSSeSUSES5S%SSSRRRRRRRRRoRLRAR6R+R RRRQQQQQQQQyQ^QOQDQ9Q.Q#QQ QPPPPPwPhP]PNPCP0PPOOOOOOOOOvOaOLO7O,O!OOONNNNNNNNNNtNeNZNONDN&N NNMMMMMMMMtM^MSM9M#MMMLLLLLLLqLPL0LLLKKKKKKKKwKlKYKJK?K.KKKJJJJJJJJJJJtJiJ^JSJDJ5J*JJJ JIIIIIIIIIIrI[IDI-IIHHHHHrHSHAHH HGGGGGvGdGDG3GGFFFFF}FgFHF-FFEEEEuEOE9E'E EDDDDyDaDOD!D DCCCCCCyC\CJC+C CBBBBBzBdBYBNB7B'BBAAAAAAAzAkA\AQAFA;A0A!AAA@@@@@l@V@C@0@@ @???????l?U?B?/???>>>>q>S>2>>=====u=\=C=0=%==<<<<<<[<7<<;;;;;`;I;); ;::::]:F:$: :9999y9b9@9)9 98888888w8`8U8J8;8$8887777777797.777766666666n6\6J686&66 66555555555v5k5U5J505%5554444444x4i4^4O4D4144333333333u3N3+3322222R2G242!22211111111w1g1X1A1.11 10000000|0q0W0;0)000////////i/S/H/.///.....}.k.`.U.J.?.4.).. .-------u-j-S-H-=-.-#---,,,,,,,s,h,M,2,,,+++++++t+d+T+I+9+(+ +*****x*f*L*;***))))))o)=)") )(((((Z(B()((''''''n'R'%'''&&&&{&^&A&/&&&%%%%v%g%D%(%% %$$$$$p$T$E$6$$$$#####n#X#M#B#7#,## #"""""""u"c"M"B"7","!"" ""!!!!!!!!x!Z!K!5!!      u ^ =   k`UJ+vcXM>$kX;(whY?0!wUJ9!yg\I6'jO& DataaDataawEqkeyX" Exceptione1 Exceptione2 Exceptione Exceptione Exceptione ExceptioneDataaDataa MonadPlusmDataaMonadmsArrowabVtArrowaArrowaDataaOrdafMonadmSU<Monadm=Monadm>Monadm?Monadm@Monadm$RealaShowS<ShowS%\Monoidm Traversablet[FoldabletMonoidm; ApplicativefJJ: ApplicativefI<]_Foldablet^&QSFoldabletRT$MonadmMonadmbFoldabletMonadmXFoldabletMonadmYMonadmZMonadmTV TraversabletZ[MN Traversablet]MFunctorf9 ApplicativefRU`FoldabletVWa%'eqFoldabletfrK%F#@StringStringFoldablet?Foldabletrt57hB@A},NFilePathStringFilePathStringStringStringStringStringlMonadm]FoldabletMonadm[Monadm TraversabletghMonadm\MonadmZMonadm+&MonadFixm8MonadmWMonadm ApplicativefFoldablet Applicativef TraversabletFoldabletNumaOrdaStringNumaOrdaString^H#ReadS,IOErrorY245StringDataaDataaStringStringStringRealaReadSReadS$StorableaUString)*+IntegraliIntegraliIntegralirTypeable exceptionpq Exceptione} ExceptioneItu ExceptioneqDataah IntegralaShowSNumaReadSNuma#@ShowaShowS RealFloataShowS IntegralaShowSStorableaShowamIntegralbNuman FractionalaIntegralb ;IntegralbRealFracaIntegralaNumb FractionalbReala IntegralbRealaEnumaz RealFloataRealaanOrda]_a0Numa_MonoidaIntegralac Fractionala^FloatingaWXBitsaxOrdaefij[ejkOrdadhYiEqaEnumaNIntegralaRealFracaRational} RealFloataZ IntegralbRealaIntegrala' RealFloatao(Numa Fractionalapqvwy{)*.67Floatinga1EnumaBitsaTypeablea RealFloata9Integrala HasResolutiona 1345BitsaiBitsa{EStorablea RealFloataEnumaBitsa|TypeableaDataa{Dataa RealFloataNumaIntegralaBitsaEqaFoldablet Monadm\Functorf ApplicativefStorableaStorableaEqaOrdaEqaEqaEqa<StorableaEnuma7ShowaStringGEqa`KX:RealaRationalkStorableaEqaStorablea_EqaStorableaTypeableaTypeablebx(*+Showa:StorableaFJ SampleVar/ RealFloataLIntegralbRealFraca RealFloata RealFloataDStringStringCShowSty}PStringsTypeable exceptionvwx Exceptione)u ExceptionesStorableaqStorableanoStorableaprStorableauvStorableawtStorableamStorablea RealFloataNuma RealFloataDataaReadaReadSStorablea%AShowaShowS  RealFloata8EnumaBitsa0yConIndexMonadmMonadm4g-OyPrec>^StorableayIHjStorableaNOStorableaPIOErrorIOErrorIOError  IOErrorIOErrorStringFilePathIOErrorFilePathIOErrorStringIOErrorStringIOErrorFilePathIOErrorIOError   (FilePathIOErrorStringShowa HPrintfTyperStringString Stringno/4IOError)StringsTypeableatTypeableaKzConIndexbConIndexw~StringuStringStringStringpDataaConIndex9StringString8=ShowS,     #$-.!>ShowSReadS Numa\KO~Monadm MonadPlusm: HasResolutionaStringMP[OFoldabletMonoidm Typeable7tTypeablea Typeable7t Typeable6tTypeablea Typeable6t Typeable5tTypeablea Typeable5t Typeable4tTypeablea Typeable4t Typeable3tTypeablea Typeable3t Typeable2tTypeablea Typeable2tlFoldabletMonadmjMonadm Traversabletd ApplicativefFoldabletc Applicativef TraversabletcoFoldabletOrdaaFoldabletNuma Typeable1tTypeablea Typeable1t~FoldabletFoldabletFoldablet MonadPlusm.FoldabletMonadm,Monadm Traversablet AlternativefFoldablet0 ApplicativefFoldablet/ Applicativef TraversabletFoldabletMonadmrDataaMonadmlnMonadmkmMonadmfMonadm MonadPlusm'Monadm` Applicativef_ ApplicativefR Applicativef^ Applicativefg AlternativefQG Alternativef AlternativefUbcCategorycatopCategorycat~TypeableaTypeablebDataa Typeable2tDataa Typeable1t Typeable2t Typeable2t' Typeable1t Typeable1t'dArrowa ArrowChoiceaqArrowaT ArrowChoiceaQArrowaPArrowaa ArrowPlusa ArrowChoicea0 ArrowChoicea1 ArrowApplya(ArrowaEArrowaH ArrowLoopaNumiIntegralakMonadmiMonadmStorablea;ShowaShowSStorableadpOrda2bNumajMonoida.YL3HG"EqarEqa`S]EqalJOrdaEqa 3eEqa^fD;StorableaStringz&BShowSStringCWStringStringCStringString CWStringLenString CStringLenString PrintfTyperStringStringReadaStringyIsStringaStringStringString StringString]StringOStringZd|StringStringFilePathFilePathDIOErrorString(  String'StringIOErrorStringx{|String[StringStringString5MonadmStringvStringNumaFilePathStringNumaFilePathStringFilePathStringuFFilePathStringFilePathStringFilePathStringStringWStringEBStringStringRealFracaReadSReadaReadSNumaReadS57ReadSReadSReadaReadSStringNumaStringNumaStringNumaStringStringNumaStringReadaStringStringStringStringFilePathStringStringStringBCWStringString=@CStringStringC CWStringLenString>A CStringLenStrings MonadPlusm-Monadm+Monadm>AStringString0/2CBVo/   ReadSReadS')(*!Y StringIntegrala RealFloataRational FractionalaRationalRationalStorableaStorableaStorableaStorableaStorablea|StorableaStorableajStorableas<2Storablea=3StorableaStorablebdCWStringString`bCStringStringvi-D RealFloataShowS.-} SampleVar SampleVar SampleVar SampleVar#Typeable exception Exceptione~IOError? <=T !" ExceptioneIOErrorghFEFinalizerEnvPtrxFinalizerEnvPtr FinalizerPtrw FinalizerPtrnv9L RealFloata RealFloata RealFloataZStringString+FzIxaIxaIxaIxae CWStringLenStringac CStringLenStringkMonoidaFloatingaBoundeda=9Su)R8$'PrecYfTUV!>m4CK`LMcz2c[\]^_`abcdefghijklmnopqrstuvwxyz{|}~TL\A  RSlm  IJUXZ MonadPlusm  AlternativefCategorycat ArrowZeroaArrowa ArrowApplyaStringReadai8ReadaStringNumahStringReada13G StringStringStringStorableaDE SampleVarMStorablea? FinalizerPtrghhtt}} 11 ),..KKccnrLNPQTVXjlpsy|}##&&,,2288:;?@BJQRWY[[]`deggjjllnnpuy} -14689;@EFTVZmoo[_rru "#)/9AH'',,//24;;?@BEGGNRYZ^^ssxx|}  tvv||  $$,,./99]  !#&,1179=@BLPRT\deghmnrsvwy!"$$..1134??AADGUVXX\\_aeloorsxx} 022>"#//33FJMMPQZZ\\dejjlu{{&'..AADDFFOQTTW[__ddklss"#%(..3A    !!$299;;HKMMT`ggi  #%..2GNNSVXX[[``cceehhjjmmrrtt(++--00 j22b -056:hjqtuz{ $),..44;<AACCEEGMOPRRTTXY[[^^bbiknnz{  &&(),,KKOPSTXX^^qqstxx&&((-.@AZ&'//33;;@@CCEEGGMMPQ__cejjmoqquuyy||~~   ..005689=?HIZ[^`eehhtvyy}}**,,..1199X!"&,..0088;;?@BEHKSTVWY[^^``hhjjlqtu{{}}  -177;?CCEEGQTTXXZ[bbgmuvyy||~ )/113A*+//@8TVY[\^_ghjjlqssy#.5577::<<AACDFINNQQSTWW^adfklnnrrwy| '/12CCJJRRac}$&(--112#),..34?@DDJJQQTTWX[[``ghjjnp)),,W#*+-/1178:;=AFGLLPQUUY[^^ggmnpprruu{{  "+,..335689<<??AAHJOQW[^`eehhoorsu{} %),,..22C222222v2f2T2D262"221111111|1l1Z1J161$110000000r0`0L0:0"00///////|/X/D/./ /..d.D.&..-----]-9--,,,m,C,, ,++++v+N+:+++***|*H*.**))))n)Z)D)$)((((f(<(((('''''l'R'4' '&&n&Z&@&&%%%%r%d%P%&%$$$$p$F$$####h#H#*##""""""p"X">"&" "!!!!n!Z!F!,!!!    x b 6   jJ$b.V6tZ.v`H2lT8~dHfD( vX< bJ(Z:(lT8"bB(zbD  v^.vN2zbF(pX>&     v \ @ &       X 8       ~ Z D &      Z : "       f >  gQ9! s_=tA%sS7];eO7eI# }aA'iI1 kQ9yY7qM1]A#iWX6 rL,b>$hP:" fP6 bB ~`H.|`D&`@(lN6 v`J4lJdH*`> jR$K/ iA_+iE! uC c;E%oG%gG-sW=oO1 }gK'lXD.rL2 nN:^:~H0T8xP. eK9!gM1yW9yYAkE#}_C%s]EY?]3 uY5KeO9w]K-O3 mU2"nJx<( zX0 pL2rP.~P2 X( pR2q[9uS;! ݿoE) Ӿ{_E) ϽO-ټcC!ͻzZ4̺pR6ҹr/ָnP4з~^>޶kQ7!kQ- ѴeM+ϳgG/ײ}]=߱mG'ǰ|\:ЯlTB.ܮ`L4ҭzb>֬tV:ګvZ6ߪq[C'ߩũ[3 ϨkEm#צu/ѥS+Ѥ_+գoI"ĢpR6}_AŠeC-ӟsU7ݞeK# ǝ]Cۜ[AoQ;!Ϛ]-љiK)јqY/ϗ{eC˖mQ3ɕ}S1 w[?#ϓoK1ђmM%ߑu_G3 ِcG+ݏˏ|||ӏ|||||||K zipwithm_ zipWithM_zipwithmzipWithMzipwith78zipWith7zipwith6TzipWith6zipwith5pzipWith5zipwith4zipWith4zipwith3zipWith3JzipwithǐzipWithIziplistZipListzip7zip7zip6zip6zip5(zip5zip4<zip4zip3Pzip3HzipgzipG zeroarrow zeroArrowyieldyieldxorxor writestrefʑ writeSTRefwritesamplevarwriteSampleVar writemode WriteModewritelist2chan8writeList2Chan writeioref\ writeIORef writefile{ writeFileF writechan writeChan wrappedmonad WrappedMonad wrappedarrow WrappedArrow wrapmonad WrapMonad wraparrow! WrapArrowwords;wordsE wordptrtoptr\ wordPtrToPtrwordptr{WordPtrword8Word8word64Word64word32“Word32word16ړWord16wordWordX withprogname withProgNamewithpool0withPoolwithmvarLwithMVarwithmanyhwithManywithforeignptrwithForeignPtrwithfilewithFilewithcwstringlenϔwithCWStringLen withcwstring withCWStringwithcstringlenwithCStringLen withcstringA withCStringwithcastringlengwithCAStringLen withcastring withCAStringwithbinaryfilewithBinaryFile witharraylen0ە withArrayLen0 witharraylen withArrayLen witharray0" withArray0 witharrayA withArraywithargs^withArgswithvwithwhenwhenweakWeakW waitqsemn waitQSemNwaitqsemؖwaitQSemvoidvoid versiontags  versionTags versionbranch/ versionBranchversionOVersionVutilsoUtilsU userinterrupt UserInterrupt usererrortype userErrorType usererrorsޗ userErrors usererror userErrorD usageinfo usageInfouppercaseletterCUppercaseLetterupdatedupdateunzip7|unzip7unzip6unzip6unzip5unzip5unzip4Ęunzip4unzip3ܘunzip3CunzipunzipB unwrapmonad unwrapMonad unwraparrow9 unwrapArrowunwordsWunwordsAuntilsuntil@ unsafesttoio unsafeSTToIOunsafeperformiounsafePerformIO? unsafeiotost unsafeIOToST unsafeinterleavestunsafeInterleaveST unsafeinterleaveioDunsafeInterleaveIOunsafeforeignptrtoptrwunsafeForeignPtrToPtr unsafecoerce unsafeCoerceunsafešUnsafeTunlinesۚunlines>unlessunlessuniqueUniqueSunionby-unionByunionEunion ungetchan_ unGetChanunfoldr{unfoldr underflow UnderflowundefinedelementěUndefinedElement undefined undefined=uncurry uncurry<unblock+unblocktypesKTypesQR typereptyconl typeRepTyCon typerepkey typeRepKey typerepargs typeRepArgstyperep͜TypeRep typeofdefault typeOfDefaulttypeof7 typeOf7typeof6default.typeOf6Defaulttypeof6OtypeOf6typeof5defaultptypeOf5Defaulttypeof5typeOf5typeof4defaulttypeOf4Defaulttypeof4ӝtypeOf4typeof3defaulttypeOf3Defaulttypeof3typeOf3typeof2default6typeOf2Defaulttypeof2WtypeOf2typeof1defaultxtypeOf1Defaulttypeof1typeOf1typeoftypeOf typeable7͞ Typeable7 typeable6 Typeable6 typeable5  Typeable5 typeable4' Typeable4 typeable3E Typeable3 typeable2c Typeable2 typeable1 Typeable1typeableTypeableP tyconuqname tyconUQname tyconstring tyConString tyconmodule tyconModuletycon!TyContuple7TupleO trytakemvarS tryTakeMVar tryputmvart tryPutMVartryjusttryJusttrytrytruncateҠtruncate; traverse_ traverse_traverse traverse traversable+ TraversableN transposeO transpose traceshowm traceShowtraceTraceMtracetouppertoUppertouchforeignptr̡touchForeignPtrtotitletoTitle torational  toRational:tolower(toLowertolistAtoList~ tointeger` toInteger9 toexception toException}toenumtoEnum8todyntoDyn|toconstrѢtoConstr{tobooltoBooltitlecaseletter TitlecaseLetterztimeout.TimeoutLtimeoutythrowtoUthrowTovwxthrowio{throwIOtu throwifnull throwIfNull throwifneg_ã throwIfNeg_ throwifneg throwIfNegthrowif_throwIf_throwifthrowIfthrowerrnopathifnullDthrowErrnoPathIfNullthrowerrnopathifminus1_{throwErrnoPathIfMinus1_throwerrnopathifminus1throwErrnoPathIfMinus1throwerrnopathif_throwErrnoPathIf_throwerrnopathifthrowErrnoPathIfthrowerrnopath>throwErrnoPaththrowerrnoifretrymayblock_rthrowErrnoIfRetryMayBlock_throwerrnoifretrymayblockthrowErrnoIfRetryMayBlockthrowerrnoifretry_throwErrnoIfRetry_throwerrnoifretrythrowErrnoIfRetrythrowerrnoifnullretrymayblockQthrowErrnoIfNullRetryMayBlockthrowerrnoifnullretrythrowErrnoIfNullRetrythrowerrnoifnullthrowErrnoIfNull throwerrnoifminus1retrymayblock_ throwErrnoIfMinus1RetryMayBlock_throwerrnoifminus1retrymayblockGthrowErrnoIfMinus1RetryMayBlockthrowerrnoifminus1retry_throwErrnoIfMinus1Retry_throwerrnoifminus1retryŧthrowErrnoIfMinus1Retrythrowerrnoifminus1_throwErrnoIfMinus1_throwerrnoifminus1,throwErrnoIfMinus1 throwerrnoif_W throwErrnoIf_ throwerrnoif| throwErrnoIf throwerrno throwErrno throwdynto throwDynTosthrowdynܨthrowDynrthrowthrowpqthreadwaitwritethreadWaitWriteothreadwaitreadFthreadWaitReadn threadkilledl ThreadKilledlmthreadidThreadIdk threaddelay threadDelayjtestbitѩtestBititanhtanh7tantan6 takewhile takeWhile5htakemvar4takeMVartakeLtake4gtailsetailsftailztail3esymbolSymboldswapmvarswapMVar surrogateϪ SurrogatecsumSum_`sum2absuccsucc1subtract'subtract0 subsequencesG subsequences^sttoioestToIO  stripprefix stripPrefix] stringrep StringRep\ stringconstrǫ StringConstr[stringStringJK/YZstringstricttolazyst%strictToLazyST strictEStrictHIstref`STRefGXstorableStorableFWstepstepstdoutstdoutVstdinʬstdinUstderrstderrT stackoverflow StackOverflowRS stableptr* StablePtrEQ stablenameM StableNameDstiSTCsqrtsqrt. splittyconapp splitTyConAppPsplitatsplitAt-Ospanۭspan,NspacingcombiningmarkSpacingCombiningMarkMspace(SpaceLsortby?sortByKsortUsortJ someexceptionr SomeExceptionHIsomesomeGsndsnd+F skipspacesˮ skipSpaces skipmany1 skipMany1skipmanyskipManysizeof!sizeOfEsinh7sinh*sinJsin)signum_signum( significand| significand' signalqsemn signalQSemN signalqsem signalQSem showversion showVersionD showstyperep showsTypeRepC showstring% showString&B showsprecH showsPrec%A showsignedk showSigned$showsShowS"?shows#@ showparen showParen!>showoctӰshowOct  showlitchar showLitChar= showlistwith showListWith<showlist4showList; showintatbaseY showIntAtBaseshowintyshowIntshowhexshowHex showgfloat showGFloat showfloatϱ showFloat showfixed showFixed: showffloat  showFFloat showefloat, showEFloat showconstrL showConstr9showcharjshowChar8showShowB6show7shiftrshiftR5shiftlʲshiftL4shiftshift3setuncaughtexceptionhandler setUncaughtExceptionHandler2setbit:setBit1 sequencea_V sequenceA_0 sequenceau sequenceA/ sequence_ sequence_-.sequencesequence+,seq׳seqsepby1sepBy1sepbysepByseekmodeSeekMode* seekfromend; SeekFromEnd)secondXsecond(scanr1pscanr1'scanrscanr&scanl1scanl1%scanlscanl$ scalefloat scaleFloat satisfysatisfy samplevar SampleVarA runtimeerror> runtimeErrorrunst[runST runkleisliz runKleisli#runinunboundthreadrunInUnboundThread"runinboundthreadеrunInBoundThread!rtssupportsboundthreadsrtsSupportsBoundThreads round+round rotaterCrotateRrotatel]rotateLrotatevrotaterightsrightsrightRight rightreverse̶reverse  returninorder ReturnInOrderreturnareturnAreturn)return  resolutionM resolution reseterrnom resetErrnoresetreset requireorder RequireOrderreqarg÷ReqArg replicatem_ replicateM_ replicatem replicateM replicate  replicaterepeat?repeat repconstr^ repConstrremvrem relativeseek RelativeSeek recupderror RecUpdError  recselerror RecSelError    recSelErrorrecip#recip recconerror? RecConError  recConError realtofrac realToFracrealpartrealPart reallocbytes reallocBytes reallocarray0 reallocArray0 reallocarray  reallocArrayrealloc(reallocrealfracCRealFrac realfloat` RealFloatrealyReal readwritemode ReadWriteMode readstref readSTRef readsprecں readsPrec readsigned readSigned readsamplevar  readSampleVar reads_to_precF readS_to_Prec reads_to_pi readS_to_PreadsReadSreads readprec_to_s readPrec_to_S readprec_to_p߻ readPrec_to_PreadprecReadPrec@readPrec readparen/ readParen readp_to_sR readP_to_S readp_to_precu readP_to_PrecreadpReadP?readoctpreadOctPreadoct˼readOctreadmvarreadMVarreadmodeReadModereadlnreadLn readlitchar= readLitCharreadlistprecdefaultgreadListPrecDefault readlistprec readListPrecreadlistdefaultreadListDefaultreadlistܽreadList readioref readIORefreadioreadIOreadintp6readIntPreadintQreadIntreadhexplreadHexPreadhexreadHex readfloat readFloatreadfilereadFilereaddecpreadDecPreaddecreadDec readconstr readConstrreadchan6readChanreadNRead>readrational|RationalratioRatio=ratRat rangesizeͿ rangeSizerangerangequotremquotRemquotquotqsemn+QSemN<qsemDQSem;~ puttracemsgc putTraceMsgputstrlnputStrLnputstrputStrputmvarputMVar}putcharputCharpurepurepuncPunc| ptrtowordptr& ptrToWordPtr ptrtointptrI ptrToIntPtrptrcPtr:properfractionproperFractionproductProductproduct processid ProcessID{processgroupidProcessGroupIDz privateuse! PrivateUse printftypeA PrintfType printfarg` PrintfArgprintf{Printf9printfprintprintprimeprimepreludePrelude8prefixPrefixpredpredprecPrecxprecypooledreallocbytes?pooledReallocByteswpooledreallocarray0ppooledReallocArray0vpooledreallocarraypooledReallocArrayu pooledrealloc pooledRealloctpoolednewarray0pooledNewArray0spoolednewarraypooledNewArrayr poolednew@ pooledNewqpooledmallocbytesfpooledMallocBytesppooledmallocarray0pooledMallocArray0opooledmallocarraypooledMallocArrayn pooledmalloc pooledMallocmpool Pool7lpolar"polar pokeelemoff> pokeElemOff pokebyteoff` pokeByteOff pokearray0 pokeArray0k pokearray pokeArrayjpokepokeplusptrplusPtrpicoPicopipiphase phasepfail"pfailhipermute>Permuteg permutations] permutationspermissionerrortypepermissionErrorTypef performgc performGC peekelemoff peekElemOffpeekcwstringlenpeekCWStringLene peekcwstring peekCWStringdpeekcstringlenCpeekCStringLenc peekcstringh peekCStringbpeekcastringlenpeekCAStringLena peekcastring peekCAString` peekbyteoff peekByteOff peekarray0 peekArray0_ peekarray peekArray^peek1peekpatternmatchfailQPatternMatchFail\]paterrorpatError[partitioneitherspartitionEithers partition partition parseversion parseVersionparens parensparagraphseparator1ParagraphSeparatoroverflowWOverflowZ otherwise| otherwise othersymbol OtherSymbolotherpunctuationOtherPunctuation othernumber OtherNumber otherletter OtherLetteros)osord:Ord6ordor\oroptionalzoptionalYoptionOptionWoptionXoptdescrOptDescrVoptargOptArgU opentempfile openTempFileopenpunctuationOpenPunctuationopenfile@openFileopenbinarytempfilefopenBinaryTempFileopenbinaryfileopenBinaryFile onexception onExceptionTonon oldexception OldException5odd oddnumericNumeric4 numerator; numeratornumSNumnullptrinullPtr nullfunptr nullFunPtrnullnullnubbynubBynubnubnothingNothingnotelemnotElem notassigned' NotAssignednotAnotnorepYNoRepnonterminationxNonTerminationQRnonTerminationSnonspacingmarkNonSpacingMarknonexhaustiveguardserrornonExhaustiveGuardsErrorP nomethoderror' NoMethodErrorNOnomethodbindingerrordnoMethodBindingErrorM nobuffering NoBufferingnoargNoArgLnmergeionmergeIO newunique newUniquenewstrefnewSTRefK newstableptr" newStablePtr newsamplevarF newSampleVarJnewqsemnfnewQSemNInewqsemnewQSemHnewpoolnewPoolGnewmvarnewMVarFnewiorefnewIORefnewforeignptrenvnewForeignPtrEnvnewforeignptr_newForeignPtr_ newforeignptrE newForeignPtrnewemptysamplevarsnewEmptySampleVarE newemptymvar newEmptyMVarDnewcwstringlennewCWStringLenC newcwstring newCWStringB newcstringlen  newCStringLenA newcstring. newCString@newchanKnewChan?newcastringlenlnewCAStringLen> newcastring newCAString= newarray0 newArray0<newarraynewArray;newnew:nestedatomicallyNestedAtomically78nestedAtomically9negatePnegatemzerogmzero mythreadid myThreadIdmvarMVar36munch1munch15munchmunch4msummsummplusmplus movebytes moveBytes3 movearray3 moveArray2monoidNMonoid2 monadplusm MonadPlusmonadfixMonadFix1monadMonad10 modifystref modifySTRef/ modifymvar_ modifyMVar_. modifymvar modifyMVar- modifyioref3 modifyIORef modifyioerrorW modifyIOError,modifiersymbol~ModifierSymbolmodifierletterModifierLettermod'mod'modmod mkweakptr mkWeakPtr+ mkweakpair mkWeakPair* mkweakioref/ mkWeakIORefmkweakLmkWeak) mktyconapph mkTyConAppmktyconmkTyCon mkstringtype mkStringTypemkstringconstrmkStringConstr~mkpolarmkPolar} mknoreptype  mkNorepType| mkioerror) mkIOError( mkinttypeG mkIntType{ mkintconstrg mkIntConstrzmkfuntymkFunTyy mkfloattype mkFloatTypex mkfloatconstr mkFloatConstrw mkdatatype mkDataTypevmkconstrmkConstrumkappty#mkAppTytminusptr>minusPtrsminprecYminPrec' minimumbyu minimumByqrminimumminimumopminboundminBoundminminnmicroMicrommfixmfix&mergeiomergeIOlmempty,memptykmemAMem0mconcatWmconcatj maybewiths maybeWith% maybetolist maybeToListi maybepeek maybePeek$maybenewmaybeNew#maybeMaybe/gmaybeh maximumby maximumByefmaximum:maximumcdmaxconstrindexcmaxConstrIndexbmaxboundmaxBoundmaxmaxa mathsymbol MathSymbol`marshalMarshal.mappendmappend_mapmaybe mapMaybe^mapm_$mapM_\]mapmAmapMZ[ mapexceptione mapExceptionXY" mapandunzipm mapAndUnzipMW mapaccumr mapAccumRUV mapaccuml mapAccumLSTmapmapRmanytill manyTill!many1$many1 many9manyQmallocforeignptrbytesbmallocForeignPtrBytesPmallocforeignptrarray0mallocForeignPtrArray0OmallocforeignptrarraymallocForeignPtrArrayNmallocforeignptrmallocForeignPtrM mallocbytes( mallocBytes mallocarray0K mallocArray0 mallocarrayn mallocArraymallocmallocmakestablenamemakeStableName magnitude magnitudeLlowercaseletterLowercaseLetterKlossofprecisionLossOfPrecisionIJloopCloopHlookupYlookupFGlookwlook longestchain longestChainElogbaselogBaseloglog listtomaybe listToMaybeDlistList- lineseparator LineSeparatorClines<linesB linebuffering^ LineBufferingAlimit|Limitliftm5liftM5@liftm4liftM4?liftm3liftM3>liftm2liftM2=liftmliftM<lifta3 liftA3;lifta2!liftA2:lifta8liftA9liftMliftlexpalexP8 lexlitchar{ lexLitChar7lexemeLexeme6 lexdigits lexDigitslexcharlexCharlexLex,lex5 letternumber LetterNumber4 lengtharray08 lengthArray0lengthVlength3leftsqlefts2leftappleftApp1leftLeft/left0lcmlcmlazytostrictstlazyToStrictSTlazyLazy*+lastLast,-last.kleisli=Kleisli*+ killthread^ killThread)justxJust(joinjoin'ixIx)&iterateiterate% isvaliderrno isValidErrnoisusererrortypeisUserErrorType isusererror+ isUserErrorisupperIisUpper$issymboldisSymbol# issuffixof isSuffixOf"isstringIsString!isspaceisSpace issignedisSigned isseparator isSeparator ispunctuation isPunctuationisprint9isPrint isprefixofV isPrefixOfispermissionerrortypeisPermissionErrorType ispermissionerrorisPermissionError  isoctdigit isOctDigitisnumberisNumber isnothing isNothing isnoreptype5 isNorepTypeisnegativezeroZisNegativeZeroisnanyisNaNismarkisMarkislowerisLowerisletterisLetterislatin1isLatin1isjustisJust isinfixof isInfixOf isinfinite4 isInfiniteisillegaloperationerrortypeeisIllegalOperationErrorType isillegaloperationisIllegalOperation isieeeisIEEE ishexdigit isHexDigitisfullerrortypeisFullErrorType  isfullerror) isFullErroriseoferrortypeNisEOFErrorType iseoferrorr isEOFErroriseofisEOFisemptysamplevarisEmptySampleVar isemptymvar isEmptyMVar isemptychan isEmptyChanisdoesnotexisterrortype%isDoesNotExistErrorTypeisdoesnotexisterror[isDoesNotExistErrorisdigitisDigitisdenormalizedisDenormalizediscurrentthreadboundisCurrentThreadBound  iscontrol isControl ischarIsChar  isasciiupper2 isAsciiUpper  isasciilowerV isAsciiLower isasciiuisAsciiisalreadyinuseerrortypeisAlreadyInUseErrorTypeisalreadyinuseerrorisAlreadyInUseErrorisalreadyexistserrortype isAlreadyExistsErrorTypeisalreadyexistserrorDisAlreadyExistsError isalphanumn isAlphaNumisalphaisAlpha isalgtype isAlgTypeirrefutpaterrorirrefutPatErroriorefIORef(iomodeIOMode ioexception# IOExceptionioesetlocationTioeSetLocation ioesethandlez ioeSetHandleioesetfilenameioeSetFileNameioeseterrortypeioeSetErrorTypeioeseterrorstringioeSetErrorString ioerrortype IOErrorTypeioerrors<ioErrorsioerrorWIOErrorioErrorioegetlocationioeGetLocation ioegethandle ioeGetHandleioegetfilenameioeGetFileNameioegeterrortypeioeGetErrorTypeioegeterrorstring:ioeGetErrorStringioYIO' inttodigity intToDigitintrepIntRep intptrtoptr intPtrToPtrintptrIntPtr intersperse intersperse intersectby intersectBy intersect. intersect intercalateN intercalateinteractminteractintegralIntegral intconstr IntConstrint8Int8int64Int64int32Int32int16Int16intInt& instances8 Instances%insertbyUinsertByinsertoinsertinrangeinRangeinitsinits initialquote InitialQuoteinitinitinfoInfo$infix Infixindexoutofbounds+IndexOutOfBounds indexconstrZ indexConstrindexvindeximagpartimagPartillegaloperationerrortypeillegalOperationErrorTypeidentIdentidid hwaitforinput  hWaitForInputhtell>hTellhslexThsLexhshowjhShowhsetposnhSetPosn hsetfilesize hSetFileSizehsetechohSetEcho hsetbuffering hSetBufferinghsetbinarymode hSetBinaryModehseek*hSeekhreadyAhReady hputstrln\ hPutStrLnhputstrxhPutStrhputcharhPutCharhputbufnonblockinghPutBufNonBlockinghputbufhPutBuf hprintftype HPrintfTypehprintfhPrintfhprint3hPrint hlookaheadO hLookAhead hiswritablep hIsWritablehisterminaldevicehIsTerminalDevice hisseekable hIsSeekable hisreadable hIsReadablehisopenhIsOpenhiseofhIsEOF hisclosed4 hIsClosedhgetposnQhGetPosnhgetlinemhGetLinehgetechohGetEcho hgetcontents hGetContentshgetcharhGetCharhgetbufnonblockinghGetBufNonBlocking hgetbuffering hGetBufferinghgetbuf:hGetBufhflushShFlush hfilesizen hFileSize heapoverflow HeapOverflowheadheadhclosehClose hasresolution HasResolution hashunique hashUnique hashtable. HashTable# hashstringQ hashStringhashstablenameuhashStableNamehashinthashInthandlerHandler handleposn HandlePosn handlejust handleJusthandleHandlehandlegunfoldBgunfoldguardZguardgroupbyrgroupBygroupgroupgmaptgmapTgmapqrgmapQrgmapqlgmapQlgmapqigmapQigmapqgmapQgmapmpgmapMpgmapmo-gmapMogmapmDgmapMgfoldl[gfoldl getziplistw getZipListgetuncaughtexceptionhandlergetUncaughtExceptionHandlergetsumgetSum getprogname getProgName getproduct getProductgetopt'0getOpt'getoptIGetOpt"getOptgetlinengetLinegetlastgetLastgetfirstgetFirstgeterrnogetErrnogetenvironmentgetEnvironmentgetenvgetEnvgetdualgetDual getcputime; getCPUTime getcontents\ getContentsgetconstgetConstgetchargetChargetchancontentsgetChanContentsgetargsgetArgsgetanygetAnygetallgetAllget(get generictakeF genericTakegenericsplitatkgenericSplitAtgenericreplicategenericReplicate genericlength genericLength genericindex genericIndex genericdrop genericDropgeneralcategory,GeneralCategorygeneralCategorygcd_gcdgcast2tgcast2gcast1gcast1gcastgcast~gathergather funresultty funResultTy}funptrFunPtr|functor Functor{ functions1 Functions!functionNFunction fullerrortypeo fullErrorTypefstfstz fromstring fromStringy fromrational fromRationalfromratfromRat frommaybe fromMaybexfromlist"fromListwfromjust>fromJustv fromintegral^ fromIntegral frominteger fromInteger fromexception fromExceptionufromenumfromEnum fromdynamic fromDynamictfromdynfromDyns fromconstrm% fromConstrMr fromconstrbG fromConstrBq fromconstrh fromConstrpfromboolfromBool freestableptr freeStablePtrofreepoolfreePoolfreehaskellfunptrfreeHaskellFunPtrnfreefree fractional( FractionalformatDFormatmform_[forM_klformtforMijforkosforkOShforkioforkIOgforeverforeverf foreignptr ForeignPtreforeignForeignfor_for_dfor'forcfoldrm<foldrMbfoldr1Tfoldr1`afoldr'tfoldr'_foldrfoldr]^foldmapdefaultfoldMapDefault\foldmapfoldMap[foldm_foldM_ZfoldmfoldMYfoldlmfoldlMXfoldl1'3foldl1'Wfoldl1Lfoldl1UVfoldl'lfoldl'STfoldlfoldlQRfoldableFoldablePfoldfoldO fmapdefault fmapDefaultNfmapfmapMfloorfloor floattodigits5 floatToDigitsfloatrepVFloatRepL floatranget floatRange floatradix floatRadixfloatingFloating floatdigits floatDigits floatconstr FloatConstrKflipflipJfixst'fixSTfixityBFixityIfixioYfixIOHfixedoFixedGfixFixfixFfirstFirstCDfirstE findindices findIndicesB findindex findIndexAfind find?@ finalquote* FinalQuote>finallyGfinally<= finalizerptrn FinalizerPtr; finalizerfree finalizerFreefinalizerenvptrFinalizerEnvPtr:finalizeforeignptrfinalizeForeignPtr9finalizefinalizefilterm)filterM8filterBfilter7filepath`FilePath6 fileoffset FileOffsetfilemodeFileModefileidFileIDfdFdfailfail5exponentexponentexpexpexitwith2exitWith4 exitsuccessQ ExitSuccess2 exitSuccess3 exitfailure ExitFailure0 exitFailure1 exitexception ExitException/exitcodeExitCode.exitExitexdeveXDEV exception! Exception,- ewouldblockM eWOULDBLOCKevenhevenevaluateevaluate*+euserseUSERSetxtbsyeTXTBSY etoomanyrefs eTOOMANYREFS etimedout eTIMEDOUTetimeeTIMEestale,eSTALEesrmntDeSRMNTesrch[eSRCHespipereSPIPEesocktnosupporteSOCKTNOSUPPORT eshutdown eSHUTDOWN errorcalls errorCalls) errorcall ErrorCall&'(error ErrorerrorerrnotoioerrorQ errnoToIOErrorerrnop Errnoerremote eRREMOTE erpcmismatch  eRPCMISMATCHerofs eROFSeremote eREMOTEeremchg eREMCHGerange eRANGEeq) Eq% eprototypeI  ePROTOTYPEeprotonosupportn ePROTONOSUPPORTeproto ePROTO eprogunavail  ePROGUNAVAIL eprogmismatch  ePROGMISMATCH eprocunavail  ePROCUNAVAILeproclim ePROCLIM epochtime4  EpochTimeepipeN ePIPE epfnosupportk  ePFNOSUPPORTeperm ePERM eopnotsupp  eOPNOTSUPPeok eOK eoferrortype  eofErrorTypeeof EOF$enxio eNXIO environment&  Environment enumfromtoG  enumFromToenumfromthentok enumFromThenTo enumfromthen  enumFromThenenumfrom enumFromenum Enumenotty eNOTTYenotsock eNOTSOCK enotempty  eNOTEMPTYenotdir2 eNOTDIRenotconnM eNOTCONNenotblkh eNOTBLKenosys eNOSYSenostr eNOSTRenosr eNOSRenospc eNOSPC enoprotoopt  eNOPROTOOPTenoneteNONETenomsgeNOMSGenomem1eNOMEMenolinkJeNOLINKenolckceNOLCKenoexec|eNOEXECenoenteNOENTenodeveNODEVenodataeNODATAenobufseNOBUFSenfileeNFILE enetunreach eNETUNREACH enetreset6 eNETRESETenetdownSeNETDOWNendokEndo"#endby1endBy1endbyendBy encodefloat encodeFloat enclosingmark EnclosingMark! enametoolong eNAMETOOLONG emultihop" eMULTIHOPemsgsize?eMSGSIZEemptysamplevaraemptySampleVaremptyempty emlinkeMLINKemfileeMFILEeloopeLOOP elemindices elemIndices elemindex elemIndexelemelemeither9EithereithereisdirieISDIR~eisconneISCONN}eioeIO|einvaleINVAL{eintreINTRz einprogress eINPROGRESSyeilseqeILSEQxeidrmeIDRMw ehostunreach1 eHOSTUNREACHv ehostdownR eHOSTDOWNueftypemeFTYPEtefbigeFBIGsefaulteFAULTreexisteEXISTqedquoteDQUOTpedomeDOMoedirtyeDIRTYn edestaddrreq eDESTADDRREQmedeadlk4eDEADLKl econnresetQ eCONNRESETk econnrefuseds eCONNREFUSEDj econnaborted eCONNABORTEDiecommeCOMMhechildeCHILDgebusyeBUSYfebadrpceBADRPCeebadmsgeBADMSGdebadf,eBADFcealreadyEeALREADYbeagain_eAGAINa eafnosupport} eAFNOSUPPORT`eadveADV_ eaddrnotavail eADDRNOTAVAIL^ eaddrinuse eADDRINUSE]eacceseACCES\e6 E6e2bige2BIG[e120E12 dyntyperepI dynTypeRep dynexceptionsl dynExceptions dynexception DynExceptiondynapplydynApplydynappdynAppdynamicDynamicdupchandupChanZdualDual dropwhile6 dropWhiledropSdropdoesnotexisterrortype|doesNotExistErrorTypeYdivmod'divMod' divmoddivMod dividebyzero DivideByZero  Xdiv'div' divdiv digittoint+ digitToInt deviceidIDeviceIDW derefweakf deRefWeakVderefstableptrdeRefStablePtrdenormalDenormalU denominator denominatordeletefirstsbydeleteFirstsBydeletebydeleteBydelete3delete decodefloatT decodeFloat decimalnumberx DecimalNumberdeadlockDeadlockST datatyperep dataTypeRep datatypeof dataTypeOf datatypename  dataTypeNamedatatypeconstrs2dataTypeConstrsdatatypeUDataTypedatareppDataRep datacast2 dataCast2 datacast1 dataCast1dataDatadashpunctuationDashPunctuationcyclecycle cwstringlen& CWStringLenRcwstringECWStringQcwchar_CWcharPcushortxCUShortOcurrycurrycurrencysymbolCurrencySymbolculongCULongNcullongCULLongMcuintptrCUIntPtrLcuintmax#CUIntMaxKcuint<CUIntJcucharSCUCharIctimejCTimeH cstringlen CStringLenGcstringCStringFcssizeCSsizeEcsizeCSizeD csigatomic CSigAtomicCcshort CShortBcschar!CSCharAcputimeprecisionCcpuTimePrecisioncputimefCPUTimecptrdiffCPtrdiff@cpidCPid?countcount>coshcoshcoscos copybytes copyBytes= copyarray  copyArray<control(Control constrtypeE constrType constrrepd ConstrRep constrRep constrindex constrIndex constrfixity constrFixity constrfields constrFieldsconstrConstrconstConstconstconnectorpunctuationGConnectorPunctuation conjugatep conjugateconindexConIndex concurrent Concurrent concatmap concatMapconcatconcatcomplexComplex  complementbit6 complementBit complementY complementcompilerversion~compilerVersion compilername compilerName comparing comparingcomparecomparecoffCOff;coerce Coerce cmode* CMode:closepunctuationK ClosePunctuationclongl CLong9 clocktick  ClockTick8cllong CLLong7clearbit clearBitcldouble CLDouble6cjmpbuf CJmpBuf5cis!ciscintptr!CIntPtr4cintmax8!CIntMax3cintO!CInt2cinoc!CIno1chrv!chrchoice!choice/0charisrepresentable!charIsRepresentable.char!Char ,char-chan!Chan +chainr1"chainr1*chainr1"chainr)chainl1J"chainl1(chainlc"chainl'cfposz"CFpos&cfloat"CFloat%cfile"CFile$ceiling"ceilingcdouble"CDouble#cdev"CDev"cclock#CClock!cchar#CChar  catmaybes8# catMaybescategoryU#Category  catchjustv# catchJustcatches#catchescatchdyn#catchDyncatch#catch~caststableptrtoptr#castStablePtrToPtrcastptrtostableptr-$castPtrToStablePtrcastptrtofunptrZ$castPtrToFunPtrcastptr|$castPtrcastfunptrtoptr$castFunPtrToPtr castfunptr$ castFunPtrcastforeignptr$castForeignPtrcastchartocchar%castCharToCCharcastcchartochar:%castCCharToCharcastY%castcj%C bytecount% ByteCount buffermode% BufferModebreak%break}bracketonerror%bracketOnErrorbracket_&bracket_bracket*&bracketboundedL&Bounded|boolc&Boolblockedondeadmvar&BlockedOnDeadMVarblockedindefinitely&BlockedIndefinitelyblocked&blockedblockbuffering'BlockBufferingblock>'blockbitsize^'bitSizebitsu'Bitsbit'bitbetween'betweenbase'Basebaseatomicmodifyioref'atomicModifyIORefatanh(atanh{atan2(atan2zatan1(atanyasyncexceptionsP(asyncExceptionsasyncexceptiony(AsyncExceptionasum(asumastypeof(asTypeOfx assertions( assertionsassertionfailed(AssertionFailedassert/)assert asinhN)asinhwasinc)asinv arrowzero|) ArrowZero arrowplus) ArrowPlus arrowmonad) ArrowMonad arrowloop) ArrowLoop arrowchoice) ArrowChoice arrowapply* ArrowApplyarrow8*Arrowarrayexception[*ArrayException array*Arrayarr*arrarithexceptions*arithExceptionsarithexception*ArithException argorder+ArgOrder argdescr++ArgDescr archC+archapproxrationala+approxRational applicative+ Applicativeappendo+appEndo appendmode+ AppendMode appendfile+ appendFileuapp,appap,apany$,AnyanytannotateioerrorW,annotateIOErrorandu,ands alternative, Alternativealreadyinuseerrortype,alreadyInUseErrorTypealreadyexistserrortype,alreadyExistsErrorType allocabytes'- allocaBytes allocaarray0J- allocaArray0 allocaarraym- allocaArrayalloca-allocaalloc-Allocall-All}~allralignptr-alignPtr| alignment- alignment{algrep.AlgRepz algconstr4. AlgConstry advanceptrS. advancePtraddmvarfinalizery.addMVarFinalizeraddforeignptrfinalizerenv.addForeignPtrFinalizerEnvxaddforeignptrfinalizer.addForeignPtrFinalizervw addfinalizer/ addFinalizeracosh8/acoshqacosM/acosp absoluteseeki/ AbsoluteSeekuabs/abso^^/^^n^>>/^>>t^<>^/>>^q>>>/>>>op>>=0>>=ln>>)0>>km>=>B0>=>l>=S0>=jk>f0>ij==y0==hi=<<0=<<gh<|>0<|>g<=<0<=<f<=0<=fe<<^0<<^d<<<0<<<bc<+>1<+>a<++1<++<*>,1<*>`<**>?1<**>_<*Q1<*^<$>b1<$>]<$s1<$\<1<e[:+1:+Z/=1/=dY/1/c.|.1.|.X.&.1.&.W.1.bUV-2-a+++2+++T++)2++`S+<2+_*>K2*>R***\2***Q**m2**^*|2*]&&&2&&&P&&2&&\O%2%N$!2$![$2$ZM!!2!!YL $ 7" t! Q    :   R     v !  P  z F      w       " Q   t dt1HImJe y]kGog{^H$J )M~5#ob-ʼ:źb6z{Dۮ|Wg׫hڨmw@ĝ[ڜEț^Ιg- `_FƏ=)[܇ {c^~+}pz yzxwwwv3v&ut?tkssrnvnm8mlkjihwh"hfdbb=t=<U<:98)87r7X6554.43>211050/3.*-+,_+K*x)(M %+9\f:n 5  h04{m 4;{Ef]*HK.i"#I(!HNLI}F0wx9dNx*dAb^B D@ש7?'L@~7Ԉhl~}|zrr0qpnVnljh`~XVVSsPP(ON5NJMLXLKhJIIH,HF"FEDCOCBBAAA@?;?>:>==<;8;t:9 9++W**i)(%(''&&%=%$#" m QO3B7   _ E s|tjsBrJRx]?x:j 2WIWj|FUHhyHt %'q71A'ˣf5H/0@M9ϑiːh^ {K cW~K{yxZwCv vueuisnn~m=mj^jhgfda`]f\;WVTS)SOQPPPxO OMKuJIKGFDCWBA<;8>8=7~54/410S0//.--Q,,a+*)p)P'e%$2$##W##"0!(1}ICI^d4]EZ  b    h 4dK{ quj2w1:Wc Z(D9xy9B2GII| Gm*^v2 (pg$Tu5k0˫۩ݨ/qޠ'T?Ț`4y>gԑz6ΐt$Iʅq*H :"N~~}>}z|{{zyxwvusssqo+jifke(db`&`_J_^_^]]\i\[Z3ZX9WVqVeUTYTSRSEROQQhPO8ONMLgL\J_C&CA A@o@?><F<;;:9G98Y76y66{54*)E)<(7'&I&$$#d"!!' WRrAta a,n  !  =   }Jb:gJO:Z)d k&D|(9{hb;qdmpĿGԸ%bղp8oݖ;Uq<>J?~y/ywt7qoXnmmlkOkjj7ji}i ihRhgf\f^edcJcBba``^d^s]\1\YXYXV&VPUzT$TSP*NCMLKKJEGFEEDCBcA%@>a<;n;^:N9>430/.-+*& %$D$##`#"C"!! I  m'|s5\F`h   z,we[[,U}8r(nVyJT9X|"|P$L {Ov 2οAWL7Ǻ`ʹ۸_ ^!ŵ o1eݱ_߰e)߯OŮMѭWլOɫOת]&V^e#ߥY٤]ߣa#_#g%_!ΞLƝDd&֛RҚL 7s=ՖAǕK˔A=DяZh#\uE=5}9|zy"xv*vut:ts^srcrq|qponrnmLml8lkjRjxihTgWfeddZb`___^][#[ZYnXWVUgUUT0TS_SR^R\QONM:LKJIHrGrFDDCDBYAx?L>Z=1<:E:6731000u/.Q.--+o*D)',&%$" bEE4BxThkye   1 H   ( _S|wtO X:R:K539(y$.*&|S4/$[<23rY]۽)ȹnNӰw3E-զ:cU̕\k$W+kh~.~}{/{zyymxpnmzlakGjYhfdb`^]7\>[ZYYXzWVURQ PO&O@ unsafeIOToST unsafeIOToST :: IO a -> ST s aOuOIOaSTsa@unsafeInterleaveSTunsafeInterleaveST :: ST s a -> ST s a POSTsaSTsa@stToIOstToIO :: ST RealWorld a -> IO axPXPST 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. @strictToLazySTstrictToLazyST :: ST s a -> ST s aRQSTsaSTsaConvert 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. @STdata ST s aSThe 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
@runSTrunST :: ST s a -> a VUSTsaaReturn 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. @lazyToStrictSTlazyToStrictST :: ST s a -> ST s a>W#WSTsaSTsa8Convert a lazy ST computation into a strict one. @fixSTfixST ::  (a -> ST s a) -> ST s aWWaSTsaSTsaAllow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixST f = _|_. G writeSTRef writeSTRef ::  STRef s a -> a -> ST s () YXSTRefsaaSTs()6writeSampleVarwriteSampleVar ::  SampleVar a -> a -> IO ()YtY SampleVaraaIO()XWrite a value into the SampleVar, overwriting any previous value that was there. 3writeList2ChanwriteList2Chan :: Chan a -> [a] -> IO ()tZSZChana[]aIO()0Write an entire list of items to a Chan. 3 writeChan writeChan :: Chan a -> a -> IO ()[ZChanaaIO() Write a value to a Chan. 'withPoolwithPool :: (Pool -> IO b) -> IO b[[PoolIObIObExecute an action with a fresh memory pool, which gets automatically deallocated (including its contents) after the action has finished. 2withMVarwithMVar :: MVar a ->  (a -> IO b) -> IO b\\MVaraaIObIObwithMVar is a safe wrapper for operating on the contents of an MVar. This operation is exception-safe: it will replace the original contents of the MVar if an exception is raised (see Control.Exception). "withMany withMany :: (a -> (b -> res) -> res) -> [a] ->  ([b] -> res) -> resZ^%^abresres[]a[]bresresgReplicates a withXXX combinator over a list of objects, yielding a list of marshalled objects $withCWStringLenwithCWStringLen :: String -> (CWStringLen -> IO a) -> IO ag_;_String 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 a\a3aStringCWStringIOaIOa[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 aYc.cString 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%edStringCStringIOaIOaVMarshal 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 agfString 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 ahhStringCStringIOaIOaVMarshal 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 bkjStorableaa[]aIntPtraIObIObJLike withArrayLen, but a terminator indicates where the array ends # withArrayLen withArrayLen :: Storable a => [a] -> (Int -> Ptr a -> IO b) -> IO blkStorablea[]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 b4mlStorableaa[]aPtraIObIObGLike withArray, but a terminator indicates where the array ends # withArray withArray :: Storable a => [a] -> (Ptr a -> IO b) -> IO b'nmStorablea[]aPtraIObIObtTemporarily store a list of storable values in memory (like Foreign.Marshal.Utils.with, but for multiple elements). "withwith :: Storable a => a -> (Ptr a -> IO b) -> IO b5ooStorableaaPtraIObIObwith 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. UWeakdata Weak vp~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. 5 waitQSemN waitQSemN :: QSemN -> Int -> IO ()xxQSemNIntIO()4Wait for the specified quantity to become available 4waitQSemwaitQSem :: QSem -> IO ()oy\yQSemIO()$Wait for a unit to become available !voidvoid :: IO a -> IO ()yyIOaIO()0Discard the return value of an IO action + UserInterrupt UserInterrupt :: AsyncExceptionyzhzAsyncExceptionThis exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console).  userErrorType userErrorType ::  IOErrorType{u{ IOErrorType&I/O error that is programmer-defined.  userError userError :: String -> IOError |{StringIOErrorConstruct 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)
N usageInfo usageInfo :: String ->  [OptDescr a] -> String}t}String[]OptDescraStringReturn a string describing the usage of a command, derived from the header (first argument) and the options described by the second argument. > unsafeSTToIO unsafeSTToIO :: ST s a -> IO a~}~STsaIOaunsafePerformIOunsafePerformIO :: IO a -> a~~IOaaThis 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! > unsafeIOToST unsafeIOToST :: IO a -> ST s adLIOaSTsa>unsafeInterleaveSTunsafeInterleaveST :: ST s a -> ST s aŇSTsaSTsaunsafeInterleaveIOunsafeInterleaveIO :: IO a -> IO aR=IOaIOaunsafeInterleaveIO allows IO computation to be deferred lazily. When passed a value of type IO a, the IO will only be performed when the value of the a is demanded. This is used to implement lazy file reading, see System.IO.hGetContents. 3 unGetChan unGetChan :: Chan a -> a -> IO ()݉‰ChanaaIO()JPut a data item back onto a channel, where it will be the next item read. + Underflow Underflow :: ArithException}lArithException+UndefinedElementUndefinedElement :: String -> ArrayExceptionStringArrayExceptionVAn attempt was made to evaluate an element of an array that had not been initialized. +unblockunblock :: IO a -> IO aIOaIOaTo 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. 2 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. 2 tryPutMVar tryPutMVar :: MVar a -> a -> IO BoolMVaraaIOBoolA 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. +tryJusttryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)% ExceptioneeMaybebIOaIOEitherbaA 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 IOError a)V.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. +trytry :: Exception e => IO a -> IO (Either e a) ExceptioneIOaIOEithereaSimilar 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 Control.Exception.try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module). + toException toException :: Exception e => e ->  SomeExceptionQ, Exceptionee SomeException"toBooltoBool ::  Num a => a -> BoolNumaaBool?Convert a Boolean in numeric representation to a Haskell value +throwTothrowTo :: Exception e => ThreadId -> e -> IO ()Y ExceptioneThreadIdeIO()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 e => e -> IO a,  ExceptioneeIOaA 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. ! throwIfNull throwIfNull :: String ->  IO (Ptr a) ->  IO (Ptr a)_StringIOPtraIOPtraGuards against null pointers ! throwIfNeg_ throwIfNeg_ :: (Ord a, Num a) =>  (a -> String) -> IO a -> IO ()Y"OrdaNumaaStringIOaIO()2Like throwIfNeg, but discarding the result ! throwIfNeg throwIfNeg :: (Ord a, Num a) =>  (a -> String) -> IO a -> IO a9OrdaNumaaStringIOaIOa&Guards against negative result values !throwIf_ throwIf_ ::  (a -> Bool) ->  (a -> String) -> IO a -> IO ()٣aBoolaStringIOaIO()/Like throwIf, but discarding the result !throwIf throwIf ::  (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. %throwErrnoPathIfNull throwErrnoPathIfNull :: String -> FilePath ->  IO (Ptr a) ->  IO (Ptr a)}HStringFilePathIOPtraIOPtraTas throwErrnoIfNull, but exceptions include the given path when appropriate. %throwErrnoPathIfMinus1_ throwErrnoPathIfMinus1_ ::  Num a => String -> FilePath -> IO a -> IO ()hNumaStringFilePathIOaIO()Was throwErrnoIfMinus1_, but exceptions include the given path when appropriate. %throwErrnoPathIfMinus1 throwErrnoPathIfMinus1 ::  Num a => String -> FilePath -> IO a -> IO aNumaStringFilePathIOaIOaVas throwErrnoIfMinus1, but exceptions include the given path when appropriate. %throwErrnoPathIf_ throwErrnoPathIf_ ::  (a -> Bool) -> String -> FilePath -> IO a -> IO ()ةaBoolStringFilePathIOaIO()Qas throwErrnoIf_, but exceptions include the given path when appropriate. %throwErrnoPathIf throwErrnoPathIf ::  (a -> Bool) -> String -> FilePath -> IO a -> IO aaBoolStringFilePathIOaIOaPas throwErrnoIf, but exceptions include the given path when appropriate. %throwErrnoPaththrowErrnoPath :: String -> FilePath -> IO aʫStringFilePathIOaNas throwErrno, but exceptions include the given path when appropriate. %throwErrnoIfRetryMayBlock_ throwErrnoIfRetryMayBlock_ ::  (a -> Bool) -> String -> IO a -> IO b -> IO ()aBoolStringIOaIObIO()>as throwErrnoIfRetryMayBlock, but discards the result. %throwErrnoIfRetryMayBlock throwErrnoIfRetryMayBlock ::  (a -> Bool) -> String -> IO a -> IO b -> IO aӭaBoolStringIOaIObIOaas throwErrnoIfRetry, but checks for operations that would block and executes an alternative action before retrying in that case. %throwErrnoIfRetry_ throwErrnoIfRetry_ ::  (a -> Bool) -> String -> IO a -> IO ()=aBoolStringIOaIO()6as throwErrnoIfRetry, but discards the result. %throwErrnoIfRetry throwErrnoIfRetry ::  (a -> Bool) -> String -> IO a -> IO aaBoolStringIOaIOaas 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. %throwErrnoIfNullRetryMayBlock throwErrnoIfNullRetryMayBlock :: String ->  IO (Ptr a) -> IO b ->  IO (Ptr a)pStringIOPtraIObIOPtraMas throwErrnoIfNullRetry, but checks for operations that would block. %throwErrnoIfNullRetrythrowErrnoIfNullRetry :: String ->  IO (Ptr a) ->  IO (Ptr a)rStringIOPtraIOPtraThrow an IOError corresponding to the current value of getErrno if the IO action returns nullPtr, but retry in case of an interrupted operation. %throwErrnoIfNullthrowErrnoIfNull :: String ->  IO (Ptr a) ->  IO (Ptr a)StringIOPtraIOPtra~Throw an IOError corresponding to the current value of getErrno if the IO action returns nullPtr. % throwErrnoIfMinus1RetryMayBlock_  throwErrnoIfMinus1RetryMayBlock_ ::  Num a => String -> IO a -> IO b -> IO ()@NumaStringIOaIObIO()Das throwErrnoIfMinus1RetryMayBlock, but discards the result. %throwErrnoIfMinus1RetryMayBlock throwErrnoIfMinus1RetryMayBlock ::  Num a => String -> IO a -> IO b -> IO aV&NumaStringIOaIObIOaOas throwErrnoIfMinus1Retry, but checks for operations that would block. %throwErrnoIfMinus1Retry_throwErrnoIfMinus1Retry_ ::  Num a => String -> IO a -> IO ()R*NumaStringIOaIO()7as throwErrnoIfMinus1, but discards the result. %throwErrnoIfMinus1RetrythrowErrnoIfMinus1Retry ::  Num a => String -> IO a -> IO a2 NumaStringIOaIOaThrow 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. %throwErrnoIfMinus1_throwErrnoIfMinus1_ ::  Num a => String -> IO a -> IO ()eNumaStringIOaIO()7as throwErrnoIfMinus1, but discards the result. %throwErrnoIfMinus1throwErrnoIfMinus1 ::  Num a => String -> IO a -> IO ac<NumaStringIOaIOaThrow an IOError corresponding to the current value of getErrno if the IO action returns a result of -1. % throwErrnoIf_  throwErrnoIf_ ::  (a -> Bool) -> String -> IO a -> IO ()gaBoolStringIOaIO()^as throwErrnoIf, but discards the result of the IO action after error handling. % throwErrnoIf  throwErrnoIf ::  (a -> Bool) -> String -> IO a -> IO ahaBoolStringIOaIOaThrow an IOError corresponding to the current value of getErrno if the result value of the IO action meets the given predicate. % throwErrno throwErrno :: String -> IO atStringIOaOThrow an IOError corresponding to the current value of getErrno. +throwthrow :: Exception e => e -> a<# ExceptioneeavThrow an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad. + ThreadKilled ThreadKilled :: AsyncExceptionAsyncExceptionThis exception is raised by another thread calling Control.Concurrent.killThread, or by the system if it needs to terminate the thread for some reason. 2takeMVartakeMVar :: MVar a -> IO aMVaraIOaReturn 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.
 SymbolSymbol :: String -> Lexeme%StringLexeme4Haskell symbol, e.g. >>, :% 2swapMVarswapMVar :: 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. >stToIOstToIO :: 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.  stringstring :: String ->  ReadP StringStringReadPString)Parses and returns the specified string.  StringString :: String -> LexemeE2StringLexeme)String literal, with escapes interpreted GSTRefdata STRef s a{a value of type STRef s a is a mutable variable in state thread s, containing a value of type a  stepstep ::  ReadPrec a ->  ReadPrec ahReadPrecaReadPreca)Increases the precedence context by one. + StackOverflow StackOverflow :: AsyncExceptionAsyncExceptionThe 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. T 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.
>STdata 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) = _|_
+ SomeException SomeException :: e ->  SomeExceptione SomeException+ SomeExceptiondata  SomeException/ skipSpaces skipSpaces :: ReadP ()~pReadP()Skips all whitespace.  skipMany1 skipMany1 :: ReadP a -> ReadP ()ReadPaReadP(),Like many1, but discards the result.  skipManyskipMany :: ReadP a -> ReadP ()~ReadPaReadP()+Like many, but discards the result. 5 signalQSemN signalQSemN :: QSemN -> Int -> IO ()>%QSemNIntIO()ESignal that a given quantity is now available from the QSemN. 4 signalQSem signalQSem :: QSem -> IO ()QSemIO()3Signal that a unit of the QSem is available  sepBy1sepBy1 :: ReadP a ->  ReadP sep ->  ReadP [a]yReadPaReadPsepReadP[]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]ReadPaReadPsepReadP[]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 CharCharBoolReadPCharRConsumes and returns the next character, if it satisfies the specified predicate. 6 SampleVartype  SampleVar a = MVar (Int, MVar a)oLSample 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.)
+ runtimeError runtimeError :: Addr# -> a Addr#a>runSTrunST :: ST s a -> akYSTsaaReturn 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. N ReturnInOrder ReturnInOrder ::  (String -> a) ->  ArgOrder aStringaArgOrderawrap non-options into options 8returnreturn ::  Monad m => a -> m a0Monadmama% resetErrno resetErrno :: IO ()ynIO()?Reset the current thread's errno value to eOK.  resetreset ::  ReadPrec a ->  ReadPrec a(ReadPrecaReadPreca'Resets the precedence context to zero. N RequireOrder RequireOrder ::  ArgOrder aArgOrdera,no option processing after first non-option NReqArgReqArg ::  (String -> a) -> String ->  ArgDescr a_8StringaStringArgDescraoption requires argument + RecUpdError RecUpdError :: String ->  RecUpdErrorString RecUpdError+ RecUpdErrordata  RecUpdError"+ recSelError recSelError :: Addr# -> a|oAddr#a+ RecSelError RecSelError :: String ->  RecSelErrorString RecSelError+ RecSelErrordata  RecSelError&+ recConError recConError :: Addr# -> asAddr#a+ RecConError RecConError :: String ->  RecConErrorString RecConError+ RecConErrordata  RecConError* 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)^2StorablebPtraIOPtrbResize 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. G readSTRef readSTRef ::  STRef s a -> ST s aSTRefsaSTsa6 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$IntReadSaReadPreca readS_to_P readS_to_P :: ReadS a -> ReadP awReadSaReadPaConverts 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/ ReadPrecaIntReadSa readPrec_to_P readPrec_to_P ::  ReadPrec a -> Int -> ReadP aReadPrecaIntReadPa ReadPrecdata ReadPrec a readP_to_S readP_to_S :: ReadP a -> ReadS aaFReadPaReadSaConverts 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 aIntReadPaReadPreca ReadPdata ReadP a readOctPreadOctP ::  Num a => ReadP aG0NumaReadPa2readMVarreadMVar :: 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 aNumaaCharBoolCharIntReadPa readHexPreadHexP ::  Num a => ReadP aN7NumaReadPa readDecPreadDecP ::  Num a => ReadP aNumaReadPa3readChanreadChan :: Chan a -> IO a ChanaIOa*Read the next value from the Chan.  RatRat :: Rational -> Lexeme{RationalLexemeFloating point literal 5QSemNdata QSemNA QSemN is a quantity semaphore, in which the available "quantity" may be signalled or waited for in arbitrary amounts. 4QSemdata QSemvA QSem is a simple quantity semaphore, in which the available "quantity" is always dealt with in units of one. 2putMVarputMVar :: MVar a -> a -> IO ()hMMVaraaIO()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 -> LexemeC0StringLexeme=Punctuation or reserved symbol, e.g. (, :: * ProcessIDtype  ProcessID = CPid*ProcessGroupIDtype ProcessGroupID = CPid precprec :: Prec ->  ReadPrec a ->  ReadPrec aePrecReadPrecaReadPreca(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 = Int'pooledReallocBytes pooledReallocBytes :: Pool -> Ptr a -> Int ->  IO (Ptr a)*PoolPtraIntIOPtraFAdjust the storage area for an element in the pool to the given size. 'pooledReallocArray0 pooledReallocArray0 :: Storable a => Pool -> Ptr a -> Int ->  IO (Ptr a):StorableaPoolPtraIntIOPtraBAdjust the size of an array with an end marker in the given pool. 'pooledReallocArray pooledReallocArray :: Storable a => Pool -> Ptr a -> Int ->  IO (Ptr a)D StorableaPoolPtraIntIOPtra/Adjust the size of an array in the given pool. ' pooledRealloc pooledRealloc :: Storable a => Pool -> Ptr a ->  IO (Ptr a)StorableaPoolPtraIOPtra[Adjust the storage area for an element in the pool to the given size of the required type. 'pooledNewArray0 pooledNewArray0 :: Storable a => Pool -> a -> [a] ->  IO (Ptr a)3StorableaPoola[]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. 'pooledNewArraypooledNewArray :: Storable a => Pool -> [a] ->  IO (Ptr a)m<StorableaPool[]aIOPtrafAllocate consecutive storage for a list of values in the given pool and marshal these values into it. ' pooledNew pooledNew :: Storable a => Pool -> a ->  IO (Ptr a)j?StorableaPoolaIOPtraXAllocate storage for a value in the given pool and marshal the value into this storage. 'pooledMallocBytespooledMallocBytes :: Pool -> Int ->  IO (Ptr a)P2PoolIntIOPtra;Allocate the given number of bytes of storage in the pool. 'pooledMallocArray0pooledMallocArray0 :: Storable a => Pool -> Int ->  IO (Ptr a)8 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. 'pooledMallocArraypooledMallocArray :: Storable a => Pool -> Int ->  IO (Ptr a)yLStorableaPoolIntIOPtraRAllocate storage for the given number of elements of a storable type in the pool. ' pooledMalloc pooledMalloc :: Storable a => Pool ->  IO (Ptr a)X0StorableaPoolIOPtraAllocate 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. 'Pooldata Pool@A memory pool. # pokeArray0  pokeArray0 :: Storable a => a -> Ptr a -> [a] -> IO ()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 ()StorableaPtra[]aIO()0Write the list elements consecutive into memory  pfailpfail ::  ReadPrec am ] ReadPrecaAlways fails.  pfailpfail :: ReadP a  ReadPaAlways fails. NPermutePermute ::  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 String   CWStringLenIOStringDMarshal a C wide string with explicit length into a Haskell string. $ peekCWString peekCWString :: CWString ->  IO Stringg L 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 String  CStringIOString9Marshal a NUL terminated C string into a Haskell string. $peekCAStringLenpeekCAStringLen ::  CStringLen ->  IO Stringm 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]StorableaEqaaPtraIO[]aHConvert an array terminated by the given end marker into a Haskell list # peekArray peekArray :: Storable a => Int -> Ptr a -> IO [a]StorableaIntPtraIO[]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. +PatternMatchFailPatternMatchFail :: String -> PatternMatchFaildGStringPatternMatchFail+PatternMatchFaildata PatternMatchFail+patErrorpatError :: Addr# -> aAddr#a+OverflowOverflow :: ArithExceptionP?ArithException optionaloptional :: ReadP a -> ReadP ()ReadPaReadP()Qoptional p optionally parses p and always returns ().  optionoption :: a -> ReadP a -> ReadP aeaReadPaReadPacoption x p will either parse p or return x without consuming any input. NOption Option :: [Char] -> [String] ->  ArgDescr a -> String ->  OptDescr ao[]Char[]StringArgDescraStringOptDescraNOptDescrdata OptDescr aEach 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
NOptArgOptArg :: (Maybe String -> a) -> String ->  ArgDescr aWMaybeStringaStringArgDescraoptional argument + onException onException :: IO a -> IO b -> IO aIOaIObIOa+nonTerminationnonTermination ::  SomeExceptiontd SomeException+NonTerminationNonTermination :: NonTerminationNonTermination+NonTerminationdata NonTermination+nonExhaustiveGuardsErrornonExhaustiveGuardsError :: Addr# -> a{Addr#a+ NoMethodError NoMethodError :: String ->  NoMethodErrorString NoMethodError+ NoMethodErrordata  NoMethodError>+noMethodBindingErrornoMethodBindingError :: Addr# -> aAddr#aNNoArgNoArg :: a ->  ArgDescr aaArgDescrano argument expected GnewSTRefnewSTRef :: a -> ST s (STRef s a)laSTsSTRefsa6 newSampleVar newSampleVar :: a -> IO (SampleVar a)aIO SampleVara0Build a SampleVar with an initial value. 5newQSemNnewQSemN :: Int -> IO QSemN|IntIOQSemN;Build a new QSemN with a supplied initial quantity. 4newQSemnewQSem :: Int -> IO QSem)IntIOQSemBuild a new QSem 'newPoolnewPool :: IO Pool{IOPoolAllocate a fresh memory pool. 2newMVarnewMVar :: a ->  IO (MVar a)aIOMVara9Create an MVar which contains the supplied value. 6newEmptySampleVarnewEmptySampleVar :: IO (SampleVar a)IO SampleVara%Build a new, empty, SampleVar 2 newEmptyMVar newEmptyMVar ::  IO (MVar a).IOMVara0Create an MVar which is initially empty. $newCWStringLennewCWStringLen :: String -> IO CWStringLenStringIO 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 CWStringe!J!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 CStringLen#"StringIO 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 CString$i$StringIOCString$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.
3newChannewChan ::  IO (Chan a)%%IOChana1Build and returns a new instance of Chan. $newCAStringLennewCAStringLen :: String ->  IO CStringLen&&StringIO 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 CString((StringIOCString$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)))Storableaa[]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)**Storablea[]aIOPtraWrite a list of storable elements into a newly allocated, consecutive sequence of storable values (like Foreign.Marshal.Utils.new, but for multiple elements). "newnew :: Storable a => a ->  IO (Ptr a),+StorableaaIOPtra}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. +nestedAtomicallynestedAtomically ::  SomeException-- SomeException+NestedAtomicallyNestedAtomically :: NestedAtomicallyM.:.NestedAtomically+NestedAtomicallydata NestedAtomically.2MVardata MVar a.An 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//CharBoolReadPStringBParses the first one or more characters satisfying the predicate.  munchmunch :: (Char -> Bool) ->  ReadP String00CharBoolReadPStringCParses the first zero or more characters satisfying the predicate. " moveBytes  moveBytes :: Ptr a -> Ptr a -> Int -> IO ()y1S1PtraPtraIntIO()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 ()2u2StorableaPtraPtraIntIO()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 mu3Monads 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. 8Monadclass Monad m6The 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. G modifySTRef modifySTRef ::  STRef s a -> (a -> a) -> ST s ()::STRefsaaaSTs()2 modifyMVar_ modifyMVar_ :: MVar a ->  (a -> IO a) -> IO ()b;<;MVaraaIOaIO()A safe wrapper for modifying the contents of an MVar. Like withMVar, modifyMVar will replace the original contents of the MVar if an exception is raised during the operation. 2 modifyMVar modifyMVar :: MVar a -> (a -> IO (a, b)) -> IO b<<MVaraaIO(,)abIObA slight variation on modifyMVar_ that allows a value to be returned (b) in addition to the modified value of the MVar.  modifyIOError modifyIOError :: (IOError -> IOError) -> IO a -> IO a==IOErrorIOErrorIOaIOaVCatch any IOError that occurs in the computation and throw a modified version. U 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
U 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. UmkWeak mkWeak :: k -> v ->  Maybe (IO ()) ->  IO (Weak v)AAkvMaybeIO()IOWeakvEstablishes a weak pointer to k, with value v and a finalizer. This is the most general interface for building a weak pointer.  mkIOError  mkIOError ::  IOErrorType -> String ->  Maybe Handle -> Maybe FilePath -> IOErroraCC 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.  minPrecminPrec :: Prec}DvDPrec<mfixmfix :: MonadFix m =>  (a -> m a) -> m aDDMonadFixmamama" maybeWith  maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO cEEaPtrbIOcIOcMaybeaPtrbIOcIOcConverts a withXXX combinator into one marshalling a value wrapped into a Maybe, using nullPtr to represent Nothing. " maybePeek maybePeek :: (Ptr a -> IO b) -> Ptr a ->  IO (Maybe b)GFPtraIObPtraIOMaybeb]Convert a peek combinator into a one returning Nothing if applied to a nullPtr "maybeNewmaybeNew :: (a -> IO (Ptr a)) -> Maybe a ->  IO (Ptr a)HGaIOPtraMaybeaIOPtraAllocate storage and marshall a storable value wrapped into a Maybe + mapException mapException ::  (Exception e1, Exception e2) =>  (e1 -> e2) -> a -> a^I)I Exceptione1 Exceptione2e1e2aaoThis function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".  manyTillmanyTill :: ReadP a ->  ReadP end ->  ReadP [a]bJ3JReadPaReadPendReadP[]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]cKBKReadPaReadP[]a4Parses one or more occurrences of the given parser.  manymany :: ReadP a ->  ReadP [a]LKReadPaReadP[]a5Parses zero or more occurrences of the given parser.  mallocBytes mallocBytes :: Int ->  IO (Ptr a)LLIntIOPtraAllocate 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)LN%NStorableaIntIOPtraZLike mallocArray, but add an extra position to hold a special termination element. # mallocArray mallocArray :: Storable a => Int ->  IO (Ptr a)/OOStorableaIntIOPtraAllocate 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)POStorableaIOPtra;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. TmakeStableNamemakeStableName :: a -> IO (StableName a)QQaIO StableNameaMakes a StableName for an arbitrary object. The object passed as the first argument is not evaluated by makeStableName. +LossOfPrecisionLossOfPrecision :: ArithExceptionRRArithException looklook :: ReadPrec String SRReadPrecStringNLook-ahead: returns the part of the input that is left, without consuming it.  looklook ::  ReadP StringSSReadPStringNLook-ahead: returns the part of the input that is left, without consuming it. *Limittype Limit = CLong,T liftlift :: ReadP a ->  ReadPrec aTvTReadPaReadPrecaALift a precedence-insensitive ReadP to a ReadPrec.  Lexemedata LexemeUHaskell lexemes.  lexCharlexChar ::  ReadP CharcUSUReadPChar lexlex ::  ReadP LexemeUUReadPLexeme# lengthArray0 lengthArray0 :: (Storable a, Eq a) => a -> Ptr a -> IO IntVV#VStorableaEqaaPtraIOIntDReturn the number of elements in an array, excluding the terminator % isValidErrno isValidErrno :: Errno -> BoolVVErrnoBoolYield 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 -> BoolDX.X IOErrorTypeBool&I/O error that is programmer-defined.  isUserError isUserError :: IOError -> BoolXXIOErrorBoolEA programmer-defined error value constructed using userError. isPermissionErrorTypeisPermissionErrorType ::  IOErrorType -> BoolY}Y IOErrorTypeBoolI/O error where the operation failed because the user does not have sufficient operating system privilege to perform that operation. isPermissionErrorisPermissionError :: IOError -> BoolZvZIOErrorBoolAn error indicating that an IO operation failed because the user does not have sufficient operating system privilege to perform that operation. isIllegalOperationErrorTypeisIllegalOperationErrorType ::  IOErrorType -> Bool[[ IOErrorTypeBool/I/O error where the operation is not possible. isIllegalOperationisIllegalOperation :: IOError -> BoolL\:\IOErrorBoolZAn 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 -> Bool^^ 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_n_ IOErrorTypeBoolOI/O error where the operation failed because the end of file has been reached.  isEOFError isEOFError :: IOError -> Bool5`#`IOErrorBoolaAn error indicating that an IO operation failed because the end of file has been reached. 6isEmptySampleVarisEmptySampleVar ::  SampleVar a -> IO Boola` 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. 2 isEmptyMVar isEmptyMVar :: MVar a -> IO BoolbbMVaraIOBool9Check 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. 3 isEmptyChan isEmptyChan :: Chan a -> IO BoolkdQdChanaIOBool:Returns True if the supplied Chan is empty. isDoesNotExistErrorTypeisDoesNotExistErrorType ::  IOErrorType -> Bool)ee IOErrorTypeBoolRI/O error where the operation failed because one of its arguments does not exist. isDoesNotExistErrorisDoesNotExistError :: IOError -> BooleeIOErrorBooldAn error indicating that an IO operation failed because one of its arguments does not exist. isAlreadyInUseErrorTypeisAlreadyInUseErrorType ::  IOErrorType -> Boolff IOErrorTypeBoolyI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used. isAlreadyInUseErrorisAlreadyInUseError :: IOError -> BoolggIOErrorBoolAn 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"i i IOErrorTypeBoolRI/O error where the operation failed because one of its arguments already exists. isAlreadyExistsErrorisAlreadyExistsError :: IOError -> BooliiIOErrorBooldAn error indicating that an IO operation failed because one of its arguments already exists. +irrefutPatErrorirrefutPatError :: Addr# -> ajjAddr#a+ IOExceptiondata  IOExceptionjExceptions 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. ioeSetLocationioeSetLocation :: IOError -> String -> IOError4llIOErrorStringIOError ioeSetHandle ioeSetHandle :: IOError -> Handle -> IOErrorllIOErrorHandleIOErrorioeSetFileNameioeSetFileName :: IOError -> FilePath -> IOErrorHm)mIOErrorFilePathIOErrorioeSetErrorTypeioeSetErrorType :: IOError ->  IOErrorType -> IOErrormmIOError IOErrorTypeIOErrorioeSetErrorStringioeSetErrorString :: IOError -> String -> IOErrornnQnIOErrorStringIOError IOErrorTypedata  IOErrorTypenKAn abstract type that contains a value for each variant of IOError. ioErrorioError :: IOError -> IO aRo=oIOErrorIOa0Raise an IOError in the IO monad. +ioErrorioError :: IOError -> IO aooIOErrorIOa0Raise an IOError in the IO monad. IOErrortype IOError = IOExceptionSp%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 -> StringqqIOErrorString ioeGetHandle ioeGetHandle :: IOError ->  Maybe Handle_rBrIOErrorMaybeHandleioeGetFileNameioeGetFileName :: IOError -> Maybe FilePathrrIOErrorMaybeFilePathioeGetErrorTypeioeGetErrorType :: IOError ->  IOErrorTypeZsAsIOError IOErrorTypeioeGetErrorStringioeGetErrorString :: IOError -> StringssIOErrorString IntInt :: Integer -> Lexeme&ttIntegerLexemeInteger literal +IndexOutOfBoundsIndexOutOfBounds :: String -> ArrayExceptionttStringArrayExceptionCAn attempt was made to index an array outside its declared bounds. illegalOperationErrorTypeillegalOperationErrorType ::  IOErrorTypeiu[u IOErrorType/I/O error where the operation is not possible.  IdentIdent :: String -> LexemeuuStringLexeme4Haskell identifier, e.g. foo, Baz  hsLexhsLex ::  ReadP StringsvavReadPString@Haskell lexer: returns the lexed string, rather than the lexeme + HeapOverflow HeapOverflow :: AsyncExceptionwvAsyncExceptionThe 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.
ThashStableNamehashStableName ::  StableName a -> Intxzx 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). + handleJust  handleJust :: Exception e => (e -> Maybe b) ->  (b -> IO a) -> IO a -> IO asz/z ExceptioneeMaybebbIOaIOaIOaUA version of catchJust with the arguments swapped around (see handle). +handlehandle :: Exception e =>  (e -> IO a) -> IO a -> IO af{3{ ExceptioneeIOaIOaIOaA 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)) $
   ...
NgetOpt' 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. NgetOpt getOpt ::  ArgOrder a ->  [OptDescr a] -> [String] -> ([a], [String], [String])~~ArgOrdera[]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. %getErrnogetErrno :: IO ErrnoIOErrno?Get the current value of errno in the current thread. 3getChanContentsgetChanContents :: Chan a -> IO [a]ChanaIO[]alReturn a lazy list representing the contents of the supplied Chan, much like System.IO.hGetContents.  getget ::  ReadPrec Char`MReadPrecCharJConsumes and returns the next character. Fails if there is no input left.  getget ::  ReadP Char߂ReadPCharJConsumes and returns the next character. Fails if there is no input left.  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. 8Functorclass 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 ::  IOErrorTypedV IOErrorTypeAI/O error where the operation failed because the device is full. + fromException fromException :: Exception e =>  SomeException -> Maybe eA Exceptione SomeExceptionMaybee"fromBoolfromBool ::  Num a => Bool -> aNumaBoola<Convert a Haskell Bool to its numeric representation 'freePoolfreePool :: Pool -> IO ()?,PoolIO()UDeallocate a memory pool and everything which has been allocated in the pool itself.  freefree :: Ptr a -> IO ()׈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. 8fmapfmap ::  Functor f => (a -> b) -> f a -> f bqHFunctorfabfafb>fixSTfixST ::  (a -> ST s a) -> ST s aߊaSTsaSTsaAllow the result of a state transformer computation to be used (lazily) inside the computation. Note that if f is strict, fixST f = _|_. <fixfix :: (a -> a) -> aϋaaafix f is the least fixed point of the function f, i.e. the least defined x such that f x = x. +finallyfinally :: IO a -> IO b -> IO a͌IOaIObIOaRA specialised variant of bracket with just a computation to run afterward.  finalizerFree finalizerFree :: FinalizerPtr al 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. Ufinalizefinalize :: Weak v -> IO ()ȎWeakvIO()MCauses a the finalizer associated with a weak pointer to be run immediately. * FileOffsettype  FileOffset = COffV*FileModetype FileMode = CMode*FileIDtype FileID = CIno͏*FdFd :: CInt -> FdCIntFd*Fdnewtype Fd@8failfail ::  Monad m => String -> m aMonadmStringma%eXDEVeXDEV :: ErrnoErrno+ Exceptionclass (Typeable e, Show e) =>  Exception e9% eWOULDBLOCK eWOULDBLOCK :: ErrnoyErrno+evaluateevaluate :: a -> IO a֑ǑaIOa)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
%eUSERSeUSERS :: Errno=5Errno%eTXTBSYeTXTBSY :: Errno}uErrno% eTOOMANYREFS eTOOMANYREFS :: ErrnoǔErrno% eTIMEDOUT eTIMEDOUT :: Errno Errno%eTIMEeTIME :: ErrnoG?Errno%eSTALEeSTALE :: Errno}Errno%eSRMNTeSRMNT :: ErrnoÕErrno%eSRCHeSRCH :: ErrnoErrno%eSPIPEeSPIPE :: Errno=5Errno%eSOCKTNOSUPPORTeSOCKTNOSUPPORT :: ErrnoErrno% eSHUTDOWN eSHUTDOWN :: ErrnoіɖErrno+ ErrorCall ErrorCall :: String ->  ErrorCall9#String ErrorCall+ ErrorCalldata  ErrorCallo%errnoToIOError errnoToIOError :: String -> Errno ->  Maybe Handle ->  Maybe String -> IOErrorG StringErrnoMaybeHandleMaybeStringIOErrorConstruct 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. %ErrnoErrno :: CInt -> Errno3#CIntErrno%Errnonewtype ErrnodHaskell representation for errno values. The implementation is deliberately exposed, to allow users to add their own definitions of Errno values. %eRREMOTEeRREMOTE :: ErrnoH@Errno% eRPCMISMATCH eRPCMISMATCH :: ErrnoErrno%eROFSeROFS :: ErrnoΚƚErrno%eREMOTEeREMOTE :: ErrnoErrno%eREMCHGeREMCHG :: ErrnoNFErrno%eRANGEeRANGE :: ErrnoErrno% ePROTOTYPE ePROTOTYPE :: ErrnoқʛErrno%ePROTONOSUPPORTePROTONOSUPPORT :: Errno"Errno%ePROTOePROTO :: Errno`XErrno% ePROGUNAVAIL ePROGUNAVAIL :: ErrnoErrno% ePROGMISMATCH ePROGMISMATCH :: ErrnoErrno% ePROCUNAVAIL ePROCUNAVAIL :: Errno@8Errno%ePROCLIMePROCLIM :: ErrnozErrno* EpochTimetype  EpochTime = CTime%ePIPEePIPE :: ErrnoErrno% ePFNOSUPPORT ePFNOSUPPORT :: ErrnoH@Errno%ePERMePERM :: Errno|Errno% eOPNOTSUPP eOPNOTSUPP :: ErrnoʞžErrno%eOKeOK :: ErrnoErrno eofErrorType eofErrorType ::  IOErrorTypeXJ IOErrorTypeOI/O error where the operation failed because the end of file has been reached.  EOFEOF :: Lexeme؟Lexeme%eNXIOeNXIO :: ErrnoErrno%eNOTTYeNOTTY :: Errno[SErrno%eNOTSOCKeNOTSOCK :: ErrnoErrno% eNOTEMPTY eNOTEMPTY :: Errno٠Errno%eNOTDIReNOTDIR :: Errno!Errno%eNOTCONNeNOTCONN :: Errnoc[Errno%eNOTBLKeNOTBLK :: ErrnoErrno%eNOSYSeNOSYS :: Errno١Errno%eNOSTReNOSTR :: ErrnoErrno%eNOSReNOSR :: Errno[SErrno%eNOSPCeNOSPC :: ErrnoErrno% eNOPROTOOPT eNOPROTOOPT :: Errno٢Errno%eNONETeNONET :: ErrnoErrno%eNOMSGeNOMSG :: Errno]UErrno%eNOMEMeNOMEM :: ErrnoErrno%eNOLINKeNOLINK :: ErrnoۣӣErrno%eNOLCKeNOLCK :: ErrnoErrno%eNOEXECeNOEXEC :: ErrnoYQErrno%eNOENTeNOENT :: ErrnoErrno%eNODEVeNODEV :: ErrnoդͤErrno%eNODATAeNODATA :: Errno Errno%eNOBUFSeNOBUFS :: ErrnoUMErrno%eNFILEeNFILE :: ErrnoErrno% eNETUNREACH eNETUNREACH :: ErrnoۥӥErrno% eNETRESET eNETRESET :: ErrnoErrno%eNETDOWNeNETDOWN :: ErrnoaYErrno 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. % eNAMETOOLONG eNAMETOOLONG :: ErrnoErrno% eMULTIHOP eMULTIHOP :: ErrnoبErrno%eMSGSIZEeMSGSIZE :: Errno"Errno6emptySampleVaremptySampleVar ::  SampleVar a -> IO () SampleVaraIO()AIf the SampleVar is full, leave it empty. Otherwise, do nothing. %eMLINKeMLINK :: ErrnoErrno%eMFILEeMFILE :: ErrnoYQErrno%eLOOPeLOOP :: ErrnoErrno%eISDIReISDIR :: ErrnoӪ˪Errno%eISCONNeISCONN :: Errno Errno%eIOeIO :: ErrnoKCErrno%eINVALeINVAL :: ErrnoErrno%eINTReINTR :: ErrnoūErrno% eINPROGRESS eINPROGRESS :: Errno Errno%eILSEQeILSEQ :: ErrnoKCErrno%eIDRMeIDRM :: ErrnoErrno% eHOSTUNREACH eHOSTUNREACH :: ErrnoѬɬErrno% eHOSTDOWN eHOSTDOWN :: Errno Errno%eFTYPEeFTYPE :: ErrnoSKErrno%eFBIGeFBIG :: ErrnoErrno%eFAULTeFAULT :: ErrnoͭŭErrno%eEXISTeEXIST :: Errno Errno%eDQUOTeDQUOT :: ErrnoIAErrno%eDOMeDOM :: Errno{Errno%eDIRTYeDIRTY :: ErrnoErrno% eDESTADDRREQ eDESTADDRREQ :: Errno Errno%eDEADLKeDEADLK :: ErrnoKCErrno% eCONNRESET eCONNRESET :: ErrnoErrno% eCONNREFUSED eCONNREFUSED :: ErrnoۯӯErrno% eCONNABORTED eCONNABORTED :: Errno%Errno%eCOMMeCOMM :: ErrnoaYErrno%eCHILDeCHILD :: ErrnoErrno%eBUSYeBUSY :: Errno۰ӰErrno%eBADRPCeBADRPC :: ErrnoErrno%eBADMSGeBADMSG :: Errno[SErrno%eBADFeBADF :: ErrnoErrno%eALREADYeALREADY :: ErrnoٱѱErrno%eAGAINeAGAIN :: ErrnoErrno% eAFNOSUPPORT eAFNOSUPPORT :: ErrnoaYErrno%eADVeADV :: ErrnoErrno% eADDRNOTAVAIL eADDRNOTAVAIL :: Errno߲Errno% eADDRINUSE eADDRINUSE :: Errno-%Errno%eACCESeACCES :: ErrnokcErrno%e2BIGe2BIG :: ErrnoErrno3dupChandupChan :: 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 ::  IOErrorTypeoa IOErrorTypeRI/O error where the operation failed because one of its arguments does not exist. + DivideByZero DivideByZero :: ArithException ArithException*DeviceIDtype DeviceID = CDevZU 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. +DenormalDenormal :: ArithException[JArithException+DeadlockDeadlock :: DeadlockDeadlock+Deadlockdata Deadlock׸$ 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 CWchar SA 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. CUShortdata CUShort>Haskell type representing the C unsigned short type. CULongdata CULongc=Haskell type representing the C unsigned long type. CULLongdata CULLongһBHaskell type representing the C unsigned long long type. CUIntPtrdata CUIntPtrHCUIntMaxdata CUIntMax|CUIntdata CUInt<Haskell type representing the C unsigned int type. CUChardata CUChar=Haskell type representing the C unsigned char type. CTimedata CTimeHaskell type representing the C time_t type. To convert to a Data.Time.UTCTime, use the following formula:
posixSecondsToUTCTime (realToFrac :: POSIXTime)
$ 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 CCharQIA C string is a reference to an array of C characters terminated by NUL. *CSsizedata CSsizeʿCSizedata CSize6Haskell type representing the C size_t type.  CSigAtomicdata  CSigAtomicf<Haskell type representing the C sig_atomic_t type. CShortdata CShort5Haskell type representing the C short type. CSChardata CSChar7;Haskell type representing the C signed char type. CPtrdiffdata CPtrdiff9Haskell type representing the C ptrdiff_t type. *CPiddata CPid  countcount :: Int -> ReadP a ->  ReadP [a]eIntReadPaReadP[]akcount n p parses n occurrences of p in sequence. A list of results is returned. " copyBytes  copyBytes :: Ptr a -> Ptr a -> Int -> IO ()cPtraPtraIntIO()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 *COffdata COffw*CModedata CModeCLongdata CLong4Haskell type representing the C long type. * ClockTicktype  ClockTick = CClockHCLLongdata CLLongx9Haskell type representing the C long long type. CLDoubledata CLDouble;Haskell type representing the C long double type. CJmpBufdata CJmpBufR7Haskell type representing the C jmp_buf type. CIntPtrdata CIntPtrCIntMaxdata CIntMaxCIntdata CInt3Haskell type representing the C int type. *CInodata CInox choicechoice ::  [ReadPrec a] ->  ReadPrec a[]ReadPrecaReadPreca,Combines all parsers in the specified list.  choicechoice ::  [ReadP a] -> ReadP ak[]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 CharL4CharReadPChar,Parses and returns the specified character.  CharChar :: Char -> LexemeCharLexemeCharacter literal 3Chandata Chan a HChan is an abstract type representing an unbounded FIFO channel.  chainr1chainr1 :: ReadP a -> ReadP (a -> a -> a) -> ReadP aReadPaReadPaaaReadPaFLike chainr, but parses one or more occurrences of p.  chainr chainr :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP aReadPaReadPaaaaReadPachainr 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 aZReadPaReadPaaaReadPaFLike chainl, but parses one or more occurrences of p.  chainl chainl :: ReadP a -> ReadP (a -> a -> a) -> a -> ReadP axFReadPaReadPaaaaReadPachainl 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. CFposdata CFpos6Haskell type representing the C fpos_t type. CFloatdata CFloat5Haskell type representing the C float type. CFiledata CFile~4Haskell type representing the C FILE type. CDoubledata CDouble6Haskell type representing the C double type. *CDevdata CDevFCClockdata CClockv7Haskell type representing the C clock_t type. CChardata CChar4Haskell type representing the C char type. + catchJust  catchJust :: Exception e => (e -> Maybe b) -> IO a ->  (b -> IO a) -> IO a ExceptioneeMaybebIOabIOaIOaThe 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.
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. +catchcatch :: Exception e => IO a ->  (e -> IO a) -> IO a ExceptioneIOaeIOaIOaThis 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 Control.Exception.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 $castCharToCCharcastCharToCChar :: Char -> CChar(CharCCharfConvert a Haskell character to a C character. This function is only safe on the first 256 characters. $castCCharToCharcastCCharToChar :: CChar -> CharCCharChar\Convert a C byte, representing a Latin-1 character, to the corresponding Haskell character. * ByteCounttype  ByteCount = CSize+bracketOnError bracketOnError :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO cFIOaaIObaIOcIOcqLike 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 cG IOaIObIOcIOc_A variant of bracket where the return value from the first computation is not required. +bracket bracket :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO cLIOaaIObaIOcIOcWhen 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
+BlockedOnDeadMVarBlockedOnDeadMVar :: BlockedOnDeadMVarjVBlockedOnDeadMVar+BlockedOnDeadMVardata BlockedOnDeadMVar+BlockedIndefinitelyBlockedIndefinitely :: BlockedIndefinitely$BlockedIndefinitely+BlockedIndefinitelydata BlockedIndefinitelyn+blockedblocked :: IO BoolIOBoolKreturns True if asynchronous exceptions are blocked in the current thread. +blockblock :: IO a -> IO aXCIOaIOaApplying 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.  between between ::  ReadP open ->  ReadP close -> ReadP a -> ReadP aReadPopenReadPcloseReadPaReadPabetween open close p parses open, followed by p and finally close. Only the value of p is returned. +AsyncExceptiondata AsyncExceptionAsynchronous exceptions +AssertionFailedAssertionFailed :: String -> AssertionFailedQ5StringAssertionFailed+AssertionFaileddata AssertionFailed+assertassert :: Bool -> a -> aBoolaa7If 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. +ArrayExceptiondata ArrayExceptionh)Exceptions generated by array operations +ArithExceptiondata ArithException"The type of arithmetic exceptions NArgOrderdata ArgOrder a).What to do with options following non-options NArgDescrdata 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 -> IOErrorIOErrorStringMaybeHandleMaybeFilePathIOErrorAdds 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" IOErrorTypeyI/O error where the operation failed because one of its arguments is a single-use resource, which is already being used. alreadyExistsErrorTypealreadyExistsErrorType ::  IOErrorType IOErrorTypeRI/O error where the operation failed because one of its arguments already exists.  allocaBytes allocaBytes :: Int -> (Ptr a -> IO b) -> IO bIntPtraIObIOballocaBytes 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 bZ%StorableaIntPtraIObIObZLike allocaArray, but add an extra position to hold a special termination element. # allocaArray allocaArray :: Storable a => Int -> (Ptr a -> IO b) -> IO b`+StorableaIntPtraIObIOb|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 bj:StorableaPtraIObIObTalloca 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. # advancePtr advancePtr :: Storable a => Ptr a -> Int -> Ptr aU*StorableaPtraIntPtra@Advance a pointer into an array by the given number of elements 2addMVarFinalizeraddMVarFinalizer :: MVar a -> IO () -> IO ()$MVaraIO()IO()Add a finalizer to an MVar (GHC only). See Foreign.ForeignPtr and System.Mem.Weak for more about finalizers. U addFinalizer addFinalizer :: key -> IO () -> IO ()$keyIO()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). 8>>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bMonadmmaambmb8>> (>>) ::  Monad m => m a -> m b -> m bsLMonadmmambmb <++ (<++) ::  ReadPrec a ->  ReadPrec a ->  ReadPrec a ReadPrecaReadPrecaReadPrecaxLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.  <++ (<++) :: ReadP a -> ReadP a -> ReadP aReadPaReadPaReadPaxLocal, exclusive, left-biased choice: If left parser locally produces any result at all, then right parser is not used.  +++ (+++) ::  ReadPrec a ->  ReadPrec a ->  ReadPrec aReadPrecaReadPrecaReadPrecaSymmetric choice.  +++ (+++) :: ReadP a -> ReadP a -> ReadP aReadPaReadPaReadPaSymmetric choice. =||| (|||) :: ArrowChoice a => a b d -> a c d -> a (Either b c) dv3 ArrowChoiceaabdacdaEitherbcd|| (||) :: Bool -> Bool -> BoolBoolBoolBool Boolean "or"  zipWithM_  zipWithM_ ::  Monad m => (a -> b -> m c) -> [a] -> [b] -> m ()jMonadmabmc[]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]wMonadmabmc[]a[]bm[]cMThe zipWithM function generalizes zipWith to arbitrary monads. zipWith7zipWith7 :: &(a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h];   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. zipWith6zipWith6 :: !(a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]  abcdefg[]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. zipWith5zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] d 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. zipWith4zipWith4 :: (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. zipWith3 zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]rabcd[]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]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. CZipListZipList :: [a] ->  ZipList aB([]aZipListaCZipListnewtype ZipList ayLists, but with an Applicative functor based on zipping, so that
f <$> ZipList xs1 <*> ... <*> ZipList xsn = ZipList (zipWithn f xs1 ... xsn)
zip7zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]n[]a[]b[]c[]d[]e[]f[]g[](,,,,,,)abcdefghThe zip7 function takes seven lists and returns a list of seven-tuples, analogous to zip. zip6zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]q[]a[]b[]c[]d[]e[]f[](,,,,,)abcdefdThe zip6 function takes six lists and returns a list of six-tuples, analogous to zip. zip5zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)] []a[]b[]c[]d[]e[](,,,,)abcdefThe zip5 function takes five lists and returns a list of five-tuples, analogous to zip. zip4 zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]([]a[]b[]c[]d[](,,,)abcdeThe zip4 function takes four lists and returns a list of quadruples, analogous to zip. 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. = zeroArrow zeroArrow :: ArrowZero a => a b c ArrowZeroaabc7yieldyield :: IO ()0%IO()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 -> axaBitsaaaaF writeSTRef writeSTRef ::  STRef s a -> a -> ST s ()STRefsaaSTs()'Write a new value into an STRef - WriteMode WriteMode :: IOModei`IOMode writeIORef writeIORef :: IORef a -> a -> IO ()IORefaaIO()'Write a new value into an IORef - writeFile writeFile :: FilePath -> String -> IO ()lFilePathStringIO()wThe computation writeFile file str function writes the string str, to the file file. C WrappedMonadnewtype  WrappedMonad m aE C WrappedArrownewtype  WrappedArrow a b c C WrapMonad WrapMonad :: m a -> WrappedMonad m a! ma WrappedMonadmaC WrapArrow WrapArrow :: a b c -> WrappedArrow a b c![!abc WrappedArrowabcwordswords :: String -> [String]!!String[]String[words breaks a string up into a list of words, which were delimited by white space.  wordPtrToPtr wordPtrToPtr :: WordPtr -> Ptr a""WordPtrPtra+casts a WordPtr to a Ptr WordPtrdata WordPtr#UAn unsigned integral type that can be losslessly converted to and from Ptr. Word8data Word8#8-bit unsigned integer type Word64data Word64#64-bit unsigned integer type Word32data Word32#$32-bit unsigned integer type Word16data Word16p$16-bit unsigned integer type Worddata Word$NA Word is an unsigned integral type, with the same size as Int. P withProgName withProgName :: String -> IO a -> IO a%j%StringIOaIOa{withProgName name act - while executing action act, have getProgName return name. withForeignPtrwithForeignPtr ::  ForeignPtr a -> (Ptr a -> IO b) -> IO b&z& 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 r**FilePathIOModeHandleIOrIOrwithFile 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 rz,I,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. PwithArgswithArgs :: [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. L versionTags versionTags :: Version -> [String]U0;0Version[]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. L versionBranch versionBranch :: Version -> [Int]g1P1Version[]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. LVersionVersion :: [Int] -> [String] -> Version:44[]Int[]StringVersionLVersiondata Versionl4A 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. . UserInterrupt UserInterrupt :: AsyncException99AsyncExceptionThis exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console). , UserInterrupt UserInterrupt :: AsyncException::AsyncExceptionThis exception is raised by default in the main thread of the program when the user requests to terminate the program via the usual mechanism(s) (e.g. Control-C in the console). . userErrors userErrors ::  Exception ->  Maybe String;; ExceptionMaybeStringUppercaseLetterUppercaseLetter :: GeneralCategoryG<5<GeneralCategoryLu: 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. unzip7unzip7 :: [(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. unzip6unzip6 :: [(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. unzip5unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])BA[](,,,,)abcde(,,,,)[]a[]b[]c[]d[]ejThe unzip5 function takes a list of five-tuples and returns five lists, analogous to unzip. unzip4unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])3CB[](,,,)abcd(,,,)[]a[]b[]c[]diThe unzip4 function takes a list of quadruples and returns four lists, analogous to unzip. unzip3unzip3 ::  [(a, b, c)] -> ([a], [b], [c])0DC[](,,)abc(,,)[]a[]b[]cgThe unzip3 function takes a list of triples and returns three lists, analogous to unzip. unzipunzip :: [(a, b)] ->  ([a], [b])ED[](,)ab(,)[]a[]biunzip transforms a list of pairs into a list of first components and a list of second components. C unwrapMonad unwrapMonad :: WrappedMonad m a -> m aEE WrappedMonadmamaC unwrapArrow unwrapArrow :: WrappedArrow a b c -> a b c|FUF WrappedArrowabcabcunwordsunwords :: [String] -> StringFF[]StringString_unwords is an inverse operation to words. It joins words with separating spaces. unsafeForeignPtrToPtrunsafeForeignPtrToPtr ::  ForeignPtr a -> Ptr aGG 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 -> bKKabunlinesunlines :: [String] -> StringvK]K[]StringStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each. unlessunless ::  Monad m => Bool -> m () -> m ()tLMLMonadmBoolm()m()The reverse of when. JUniquedata UniqueLAn abstract unique object. Objects of type Unique may be compared for equality and ordering and hashed into Int. unionBy unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]MMaaBool[]a[]a[]aKThe unionBy function is the non-overloaded version of union. unionunion :: Eq a => [a] -> [a] -> [a]N~NEqa[]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. unfoldrunfoldr :: (b -> Maybe (a, b)) -> b -> [a]P}PbMaybe(,)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 :: ArithException TTArithException, Underflow Underflow :: ArithExceptionvTeTArithException.UndefinedElementUndefinedElement :: String -> ArrayExceptionTTStringArrayExceptionVAn attempt was made to evaluate an element of an array that had not been initialized. ,UndefinedElementUndefinedElement :: String -> ArrayExceptionUUStringArrayExceptionVAn attempt was made to evaluate an element of an array that had not been initialized. uncurryuncurry ::  (a -> b -> c) -> (a, b) -> cVVabc(,)abcCuncurry converts a curried function to a function on pairs. .unblockunblock :: IO a -> IO a>W)WIOaIOaTo 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. ,unblockunblock :: IO a -> IO awXbXIOaIOaTo 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 -> TyConYYTypeRepTyCon6Observe the type constructor of a type representation  typeRepKey typeRepKey :: TypeRep -> IO Int[ZDZTypeRepIOIntReturns 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]\\TypeRep[]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^^ Typeable7ttabcdefgTypeReptypeOf6DefaulttypeOf6Default :: (Typeable7 t, Typeable a) => t a b c d e f g -> TypeRep_z_ Typeable7tTypeableatabcdefgTypeRepMFor defining a Typeable6 instance from any Typeable7 instance. typeOf6typeOf6 :: Typeable6 t =>  t a b c d e f -> TypeRep`n` Typeable6ttabcdefTypeReptypeOf5DefaulttypeOf5Default :: (Typeable6 t, Typeable a) =>  t a b c d e f -> TypeRepaaa Typeable6tTypeableatabcdefTypeRepMFor defining a Typeable5 instance from any Typeable6 instance. typeOf5typeOf5 :: Typeable5 t =>  t a b c d e -> TypeRep>bb Typeable5ttabcdeTypeReptypeOf4DefaulttypeOf4Default :: (Typeable5 t, Typeable a) =>  t a b c d e -> TypeRepbb Typeable5tTypeableatabcdeTypeRepMFor defining a Typeable4 instance from any Typeable5 instance. typeOf4typeOf4 :: Typeable4 t =>  t a b c d -> TypeRepcc Typeable4ttabcdTypeReptypeOf3DefaulttypeOf3Default :: (Typeable4 t, Typeable a) =>  t a b c d -> TypeRepdKd Typeable4tTypeableatabcdTypeRepMFor defining a Typeable3 instance from any Typeable4 instance. typeOf3typeOf3 :: Typeable3 t => t a b c -> TypeRepZe0e Typeable3ttabcTypeReptypeOf2DefaulttypeOf2Default :: (Typeable3 t, Typeable a) => t a b c -> TypeRep fe Typeable3tTypeableatabcTypeRepMFor defining a Typeable2 instance from any Typeable3 instance. typeOf2typeOf2 :: Typeable2 t => t a b -> TypeRepff Typeable2ttabTypeReptypeOf1DefaulttypeOf1Default :: (Typeable2 t, Typeable a) => t a b -> TypeRepgOg Typeable2tTypeableatabTypeRepMFor defining a Typeable1 instance from any Typeable2 instance. typeOf1typeOf1 :: Typeable1 t => t a -> TypeRepNh*h Typeable1ttaTypeReptypeOftypeOf :: Typeable a => a -> TypeRephhTypeableaaTypeRep Typeable7class  Typeable7 th$Variant for 7-ary type constructors  Typeable6class  Typeable6 tUi$Variant for 6-ary type constructors  Typeable5class  Typeable5 ti$Variant for 5-ary type constructors  Typeable4class  Typeable4 tj$Variant for 4-ary type constructors  Typeable3class  Typeable3 tlj$Variant for 3-ary type constructors  Typeable2class  Typeable2 tj%Variant for binary type constructors  Typeable1class  Typeable1 t'k$Variant for unary type constructors Typeableclass Typeable akWThe class Typeable allows a concrete representation of a type to be calculated. 0 tyconUQname tyconUQname :: String -> String?l,lStringStringAGets the unqualified type constructor: drop *.*.*... before name  tyConString tyConString :: TyCon -> StringllTyConString1Observe string encoding of a type representation 0 tyconModule tyconModule :: String -> String{mhmStringStringAGets the module of a type constructor: take *.*.*... before name TyCondata TyConmjAn abstract representation of a type constructor. TyCon objects can be built using mkTyCon. .tryJusttryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)on 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. ,tryJusttryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)zp7p ExceptioneeMaybebIOaIOEitherbaA 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)qqIOaIOEither 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). ,trytry :: Exception e => IO a -> IO (Either e a)ut ExceptioneIOaIOEithereaSimilar 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 Control.Exception.try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module). D traverse_ traverse_ :: (Foldable t, Applicative f) =>  (a -> f b) -> t a -> f ()xxxFoldablet Applicativefafbtaf()qMap each element of a structure to an action, evaluate these actions from left to right, and ignore the results. Itraversetraverse :: "(Traversable t, Applicative f) =>  (a -> f b) -> t a -> f (t b)yy Traversablet ApplicativefafbtaftbI Traversableclass (Functor t, Foldable t) =>  Traversable tOzFunctors 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).
 transpose transpose :: [[a]] -> [[a]]~~[][]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]]
M traceShow traceShow ::  Show a => a -> b -> bShowaabbLike trace, but uses show on the argument to convert it to a String.
traceShow = trace . show
Mtracetrace :: String -> a -> aStringaaWhen 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 -> CharCharCharlConvert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged. touchForeignPtrtouchForeignPtr ::  ForeignPtr a -> IO ()xZ 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 -> CharÈCharCharConvert 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 -> Char։CharCharlConvert 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. DtoListtoList :: Foldable t => t a -> [a]jFoldabletta[]a!List of elements of a structure. , toException toException :: Exception e => e ->  SomeException7 Exceptionee SomeExceptiontoDyntoDyn :: 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)
0toConstrtoConstr ::  Data a => a -> ConstrgDataaaConstrTitlecaseLetterTitlecaseLetter :: GeneralCategoryҎGeneralCategoryLt: Letter, Titlecase Ktimeouttimeout :: Int -> IO a ->  IO (Maybe a){XIntIOaIOMaybea^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 :: Exception e => ThreadId -> e -> IO ()kA ExceptioneThreadIdeIO()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 :: Exception e => ThreadId -> e -> IO ()4  ExceptioneThreadIdeIO()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. 7throwTothrowTo :: Exception e => ThreadId -> e -> IO ()Ӥ ExceptioneThreadIdeIO()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 e => e -> IO a ExceptioneeIOaA 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. ,throwIOthrowIO :: Exception e => e -> IO aޮ ExceptioneeIOaA 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 ()Z!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 -> bZ2Typeable exception exceptionbNRaise any value as an exception, provided it is in the Typeable class. .throwthrow :: Exception e => e -> a  ExceptioneeavThrow an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad. ,throwthrow :: Exception e => e -> aϴ ExceptioneeavThrow an exception. Exceptions may be thrown from purely functional code, but may only be caught within the IO monad. 7threadWaitWritethreadWaitWrite :: Fd -> IO ()ŵFdIO()\Block the current thread until data can be written to the given file descriptor (GHC only). 7threadWaitReadthreadWaitRead :: Fd -> IO ()uFdIO()bBlock the current thread until data is available to read on the given file descriptor (GHC only). . ThreadKilled ThreadKilled :: AsyncExceptionD3AsyncExceptionThis exception is raised by another thread calling Control.Concurrent.killThread, or by the system if it needs to terminate the thread for some reason. , ThreadKilled ThreadKilled :: AsyncException8'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. 7ThreadIddata 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 (). 7 threadDelay threadDelay :: Int -> IO ()IntIO()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 -> BoolBitsaaIntBool takeWhile takeWhile ::  (a -> Bool) -> [a] -> [a]qaBool[]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. tailstails :: [a] -> [[a]]; []a[][]aThe tails function returns all final segments of the argument, longest first. For example,
tails "abc" == ["abc", "bc", "c",""]
tailtail :: [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 :: GeneralCategoryTBGeneralCategoryCs: Other, Surrogate sumsum ::  Num a => [a] -> aNuma[]aaFThe sum function computes the sum of a finite list of numbers. Dsumsum :: (Foldable t, Num a) => t a -> a^FoldabletNumataaHThe sum function computes the sum of the numbers of a structure. BSumSum :: a -> Sum a aSumaBSumnewtype Sum aIMonoid under addition.  subsequences subsequences :: [a] -> [[a]][]a[][]aThe subsequences function returns the list of all subsequences of the argument.
subsequences "abc" == ["","a","b","ab","c","ac","bc","abc"]
 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
0 StringRep StringRep :: DataRepDataRep0 StringConstr StringConstr :: String ->  ConstrRep7!String ConstrRepStringString :: 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. FSTRefdata 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 aBThe 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 :: HandleHandleKA 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 :: Handle-$HandleJA handle managing output to the Haskell program's standard error channel. . StackOverflow StackOverflow :: AsyncExceptionAsyncExceptionThe 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. , StackOverflow StackOverflow :: AsyncExceptionAsyncExceptionThe 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.  StablePtrdata  StablePtr aA 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])zTypeRep(,)TyCon[]TypeRep&Splits a type constructor application splitAtsplitAt :: Int -> [a] ->  ([a], [a])N$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])LaBool[]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 sortBysortBy :: (a -> a -> Ordering) -> [a] -> [a]aaOrdering[]a[]aIThe sortBy function is the non-overloaded version of sort. sortsort ::  Ord a => [a] -> [a]^?Orda[]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. , SomeException SomeException :: e ->  SomeExceptionxce SomeException, SomeExceptiondata  SomeExceptionCsomesome :: Alternative f => f a -> f [a]3 Alternativeffaf[]a One or more. sndsnd :: (a, b) -> b~(,)abb(Extract the second component of a pair. sizeOfsizeOf :: Storable a => a -> Int"StorableaaIntL showVersion showVersion :: Version -> StringvVersionStringProvides 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 -> ShowSTypeRepShowS showString showString :: String -> ShowS1StringShowSjutility function converting a String to a show function that simply prepends the string unchanged.  showsPrec showsPrec ::  Show a => Int -> a -> ShowSShowaIntaShowSshowsshows ::  Show a => a -> ShowS}eShowaaShowS7equivalent 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 -> ShowS.BoolShowSShowSxutility function that surrounds the inner show function with parentheses when the Bool parameter is True.  showLitChar showLitChar :: Char -> ShowSCharShowSConvert a character to a string using only printable characters, using Haskell source-language escape conventions. For example:
showLitChar '\n' s  =  "\\n" ++ s
 showListWith showListWith ::  (a -> ShowS) -> [a] -> ShowS>aShowS[]aShowSWShow a list (using square brackets and commas), given a function for showing elements. showListshowList ::  Show a => [a] -> ShowSShowa[]aShowS: showFixed showFixed :: HasResolution a => Bool -> Fixed a -> Stringy HasResolutionaBoolFixedaString0First arg is whether to chop off trailing zeros 0 showConstr showConstr :: Constr -> String>+ConstrString"Gets the string for a constructor showCharshowChar :: Char -> ShowSCharShowSkutility function converting a Char to a show function that simply prepends the character unchanged. showshow ::  Show a => a -> StringoShowaaStringShowclass 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 -> aV=BitsaaIntashiftLshiftL ::  Bits a => a -> Int -> aBitsaaIntashiftshift ::  Bits a => a -> Int -> a6BitsaaInta.setUncaughtExceptionHandlersetUncaughtExceptionHandler :: (Exception -> IO ()) -> IO () ExceptionIO()IO()setBitsetBit ::  Bits a => a -> Int -> aK2BitsaaIntaD 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. I sequenceA sequenceA :: "(Traversable t, Applicative f) => t (f a) -> f (t a) Traversablet ApplicativeftfaftaD sequence_ sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()aFoldabletMonadmtmam()ZEvaluate each monadic action in the structure from left to right, and ignore the results.  sequence_ sequence_ ::  Monad m => [m a] -> m ()lFMonadm[]mam()QEvaluate each action in the sequence from left to right, and ignore the results. Isequencesequence :: (Traversable t, Monad m) => t (m a) -> m (t a)c( TraversabletMonadmtmamtasequencesequence ::  Monad m => [m a] -> m [a]Monadm[]mam[]aREvaluate each action in the sequence from left to right, and collect the results. -SeekModedata SeekModejSA mode that determines the effect of hSeek hdl mode i, as follows: - SeekFromEnd SeekFromEnd :: SeekMode SeekModeSthe 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)Arrowaabca(,)db(,)dcscanr1scanr1 ::  (a -> a -> a) -> [a] -> [a]oOaaa[]a[]aPscanr1 is a variant of scanr that has no starting value argument. scanr scanr ::  (a -> b -> b) -> b -> [a] -> [b]I&abbb[]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]:aaa[]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]Q.abaa[]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 bKleislimabamb7runInUnboundThreadrunInUnboundThread :: IO a -> IO a<'IOaIOa=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. 7runInBoundThreadrunInBoundThread :: IO a -> IO aIOaIOaRun 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. 7rtsSupportsBoundThreadsrtsSupportsBoundThreads :: 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 -> a9  BitsaaIntarotateLrotateL ::  Bits a => a -> Int -> a  BitsaaIntarotaterotate ::  Bits a => a -> Int -> a  BitsaaIntarightsrights ::  [Either a b] -> [b] i []Eitherab[]bzExtracts from a list of Either all the Right elements All the Right elements are extracted in order. =rightright :: ArrowChoice a => a b c -> a (Either d b) (Either d c) q  ArrowChoiceaabcaEitherdbEitherdcRightRight :: b ->  Either a b bEitherabreversereverse :: [a] -> [a]lW[]a[]amreverse xs returns the elements of xs in reverse order. xs must be finite. =returnAreturnA ::  Arrow a => a b b4ArrowaabbMThe identity arrow, which plays the role of return in arrow notation. returnreturn ::  Monad m => a -> m aMonadmama: resolution resolution :: HasResolution a => a -> IntegerjG HasResolutionaaInteger replicateM_ replicateM_ ::  Monad m => Int -> m a -> m ()MonadmIntmam()1Like replicateM, but discards the result.  replicateM replicateM ::  Monad m => Int -> m a -> m [a]MonadmIntmam[]a^replicateM n act performs the action n times, gathering the results.  replicate replicate :: Int -> a -> [a]mInta[]areplicate n x is a list of length n with x the value of every element. It is an instance of the more general Data.List.genericReplicate, in which n may be of any integral type. repeatrepeat :: a -> [a]a[]aZrepeat x is an infinite list, with x the value of every element. 0 repConstr repConstr :: DataType ->  ConstrRep -> ConstrmDataType ConstrRepConstr,Look up a constructor by its representation - RelativeSeek RelativeSeek :: SeekMode SeekModeTthe position of hdl is set to offset i from the current position. . RecUpdError RecUpdError :: String ->  ExceptionString 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. , RecUpdError RecUpdError :: String ->  RecUpdErrorpXString RecUpdError, RecUpdErrordata  RecUpdError. RecSelError RecSelError :: String ->  ExceptionString 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. , RecSelError RecSelError :: String ->  RecSelErrorString RecSelError, RecSelErrordata  RecSelError. RecConError RecConError :: String ->  ExceptionS=String 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. , RecConError RecConError :: String ->  RecConErrorrString RecConError, RecConErrordata  RecConError9realPartrealPart :: RealFloat a =>  Complex a -> aB RealFloataComplexaa,Extracts the real part of a complex number. - ReadWriteMode ReadWriteMode :: IOModeIOModeF readSTRef readSTRef ::  STRef s a -> ST s a,STRefsaSTsa"Read the value of an STRef  readsPrec readsPrec ::  Read a => Int -> ReadS aReadaIntReadSareadsreads ::  Read a => ReadS aReadaReadSa7equivalent 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). readPrecreadPrec ::  Read a =>  ReadPrec a#  ReadaReadPreca readParen readParen :: Bool -> ReadS a -> ReadS a  BoolReadSaReadSareadParen True p parses what p parses, but surrounded with parentheses. readParen False p parses what p parses, but optionally surrounded with parentheses. -ReadModeReadMode :: IOMode!!IOMode-readLnreadLn ::  Read a => IO a""ReadaIOaFThe readLn function combines getLine and readIO.  readLitChar readLitChar ::  ReadS Char""ReadSCharRead 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]$#ReadaReadPrec[]apA possible replacement definition for the readListPrec method, defined using readPrec (GHC only).  readListPrec readListPrec ::  Read a =>  ReadPrec [a]$$ReadaReadPrec[]areadListDefaultreadListDefault ::  Read a =>  ReadS [a]g%I%ReadaReadS[]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]&&ReadaReadS[]a readIORef readIORef :: IORef a -> IO a'&IORefaIOa"Read the value of an IORef -readIOreadIO ::  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. -readFilereadFile :: FilePath ->  IO String((FilePathIOStringThe 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. 0 readConstr readConstr :: DataType -> String ->  Maybe Constr))DataTypeStringMaybeConstr"Lookup a constructor via a string readread ::  Read a => String -> aW*>*ReadaStringalThe 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
ERationaltype Rational = Ratio Integer4Arbitrary-precision rational numbers, represented as a ratio of two Integer values. A rational number may be constructed using the % operator. ERatiodata Integral a => Ratio a5ORational numbers, with numerator and denominator of some Integral type. RatRat :: Rational -> Lexeme^6I6RationalLexemeFloating point literal A rangeSize rangeSize :: Ix a => (a, a) -> Int66Ixa(,)aaIntArangerange :: Ix a => (a, a) -> [a]U737Ixa(,)aa[]aM putTraceMsg putTraceMsg :: String -> IO ()77StringIO()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 () 98StringIO()9The same as putStr, but adds a newline character. -putStrputStr :: String -> IO ()99StringIO()UWrite a string to the standard output device (same as hPutStr stdout). -putCharputChar :: Char -> IO ()P:=:CharIO()YWrite a character to the standard output device (same as hPutChar stdout). Cpurepure :: Applicative f => a -> f a;: ApplicativefafaPuncPunc :: String -> Lexemeo;\;StringLexeme=Punctuation or reserved symbol, e.g. (, ::  ptrToWordPtr ptrToWordPtr :: Ptr a -> WordPtr<<PtraWordPtr+casts a Ptr to a WordPtr  ptrToIntPtr ptrToIntPtr :: Ptr a -> IntPtr<<PtraIntPtr+casts a Ptr to an IntPtr Ptrdata Ptr a=A 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. productproduct ::  Num a => [a] -> aL?3?Numa[]aaNThe product function computes the product of a finite list of numbers. Dproductproduct :: (Foldable t, Num a) => t a -> a@?FoldabletNumataaPThe product function computes the product of the numbers of a structure. BProductProduct :: a ->  Product a@@aProductaBProductnewtype Product a@Monoid under multiplication.  PrivateUse PrivateUse :: GeneralCategoryvAdAGeneralCategoryCo: Other, Private Use V PrintfTypeclass  PrintfType tAZThe 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. V PrintfArgclass  PrintfArg a[CVprintfprintf :: PrintfType r => String -> rCC 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 ()JJShowaaIO()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 :: Int32LLInt320A prime larger than the maximum hash table size 0PrefixPrefix :: FixityMMFixity9polarpolar :: RealFloat a =>  Complex a -> (a, a)MhM RealFloataComplexa(,)aaThe function polar takes a complex number and returns a (magnitude, phase) pair in canonical form: the magnitude is nonnegative, and the phase in the range (-pi, pi]; if the magnitude is zero, then so is the phase.  pokeElemOff  pokeElemOff :: Storable a => Ptr a -> Int -> a -> IO ()4OOStorableaPtraIntaIO() pokeByteOff  pokeByteOff :: Storable a => Ptr b -> Int -> a -> IO ()OOStorableaPtrbIntaIO()pokepoke :: Storable a => Ptr a -> a -> IO ()dP;PStorableaPtraaIO()plusPtrplusPtr :: Ptr a -> Int -> Ptr bPPPtraIntPtrb9Advances the given address by the given offset in bytes. :Picotype Pico = Fixed E12KQ9phasephase :: RealFloat a =>  Complex a -> aQQ RealFloataComplexaa~The phase of a complex number, in the range (-pi, pi]. If the magnitude is zero, then so is the phase.  permutations permutations :: [a] -> [[a]]RR[]a[][]aThe permutations function returns the list of all permutations of the argument.
permutations "abc" == ["abc","bac","cba","bca","cab","acb"]
S performGC performGC :: IO ()SSIO())Triggers an immediate garbage collection  peekElemOff peekElemOff :: Storable a => Ptr a -> Int -> IO aUT+TStorableaPtraIntIOa peekByteOff peekByteOff :: Storable a => Ptr b -> Int -> IO aTTStorableaPtrbIntIOapeekpeek :: Storable a => Ptr a -> IO aaU  ExceptionUUString ExceptionA pattern matching failure. The String argument should contain a descriptive message including the function name, source file and line number. ,PatternMatchFailPatternMatchFail :: String -> PatternMatchFailVVStringPatternMatchFail,PatternMatchFaildata PatternMatchFail5WpartitionEitherspartitionEithers ::  [Either a b] ->  ([a], [b])WW[]Eitherab(,)[]a[]bPartitions a list of Either into two lists All the Left elements are extracted, in order, to the first component of the output. Similarly the Right elements are extracted to the second component of the output.  partition partition ::  (a -> Bool) -> [a] ->  ([a], [a])LYYaBool[]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)
L parseVersion parseVersion ::  ReadP VersionZyZReadPVersionDA parser for versions in the format produced by showVersion. parensparens ::  ReadPrec a ->  ReadPrec aB[![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 :: GeneralCategoryL\:\GeneralCategoryZp: Separator, Paragraph .OverflowOverflow :: ArithException\\ArithException,OverflowOverflow :: ArithException ]\ArithException otherwise otherwise :: BoolO]H]Boolotherwise is defined as the value True. It helps to make guards more readable. eg.
f x | x < 0     = ...
    | otherwise = ...
 OtherSymbol OtherSymbol :: GeneralCategoryI^7^GeneralCategorySo: Symbol, Other OtherPunctuationOtherPunctuation :: GeneralCategory^^GeneralCategoryPo: Punctuation, Other  OtherNumber OtherNumber :: GeneralCategory4_"_GeneralCategoryNo: Number, Other  OtherLetter OtherLetter :: GeneralCategory__GeneralCategoryLo: Letter, Other Rosos :: String__String6The operating system on which the program is running. ordord :: Char -> Intn```CharIntCThe Prelude.fromEnum method restricted to the type Data.Char.Char.  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] -> BoolLc7c[]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. Doror :: Foldable t => t Bool -> BooldqdFoldablettBoolBoolor 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. Coptionaloptional :: Alternative f => f a ->  f (Maybe a)ee AlternativeffafMaybea One or none. - openTempFile openTempFile :: FilePath -> String -> IO (FilePath, Handle)fzfFilePathStringIO(,)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 :: GeneralCategoryjiGeneralCategoryPs: Punctuation, Open -openFileopenFile :: FilePath -> IOMode ->  IO HandlejjFilePathIOModeIOHandle/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)papFilePathStringIO(,)FilePathHandlejLike openTempFile, but opens the file in binary mode. See openBinaryFile for more comments. -openBinaryFileopenBinaryFile :: FilePath -> IOMode ->  IO HandleqoqFilePathIOModeIOHandleLike 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.) , onException onException :: IO a -> IO b -> IO assIOaIObIOa;on on ::  (b -> b -> c) -> (a -> b) -> a -> a -> c|t]tbbcabaacz(*) `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)
E numerator numerator :: Integral a => Ratio a -> apvOvIntegralaRatioaaExtract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive. nullPtrnullPtr :: Ptr anullPtr contains a distinguished value of Ptr that is not associated with a valid memory location.  nullFunPtr nullFunPtr :: FunPtr a xwFunPtraThe constant nullFunPtr contains a distinguished value of FunPtr that is not associated with a valid memory location. nullnull :: [a] -> Boolxx[]aBoolTest whether a list is empty. nubBynubBy :: (a -> a -> Bool) -> [a] -> [a]}yZyaaBool[]a[]aThe nubBy function behaves just like nub, except it uses a user-supplied equality predicate instead of the overloaded == function. nubnub :: Eq a => [a] -> [a]xzZzEqa[]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{{MaybeanotElemnotElem :: Eq a => a -> [a] -> BoolG|)|Eqaa[]aBool/notElem is the negation of elem. DnotElemnotElem :: (Foldable t, Eq a) => a -> t a -> Bool }|FoldabletEqaataBool/notElem is the negation of elem.  NotAssigned NotAssigned :: GeneralCategory}}GeneralCategoryCn: Other, Not Assigned notnot :: Bool -> Bool}}BoolBoolBoolean "not" 0NoRepNoRep :: DataRepJ~@~DataRep.NonTerminationNonTermination ::  Exception~~ Exception~The current thread is stuck in an infinite loop. This exception may or may not be thrown when the program is non-terminating. ,NonTerminationNonTermination :: NonTermination~mNonTermination,NonTerminationdata NonTerminationNonSpacingMarkNonSpacingMark :: 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. , NoMethodError NoMethodError :: String ->  NoMethodErrorString NoMethodError, NoMethodErrordata  NoMethodErrorD- NoBuffering NoBuffering ::  BufferMode BufferMode#buffering is disabled if possible. 7nmergeIOnmergeIO :: [[a]] -> IO [a]&[][]aIO[]aJ newUnique newUnique ::  IO UniqueufIOUniqueCreates 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. FnewSTRefnewSTRef :: a -> ST s (STRef s a)݄aSTsSTRefsa5Build a new STRef in the current state thread  newStablePtr newStablePtr :: a -> IO (StablePtr a)laIO StablePtra>Create a stable pointer referring to the given Haskell value. newIORefnewIORef :: a ->  IO (IORef a),aIOIORefaBuild a new IORef newForeignPtrEnv newForeignPtrEnv :: FinalizerEnvPtr env a -> Ptr env -> Ptr a -> IO (ForeignPtr a)+FinalizerEnvPtrenvaPtrenvPtraIO 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. newForeignPtr_newForeignPtr_ :: Ptr a -> IO (ForeignPtr a)wPtraIO ForeignPtraTurns a plain memory reference into a foreign pointer that may be associated with finalizers by using addForeignPtrFinalizer.  newForeignPtr newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)҉ 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)lPtraIO()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)+keykeyBoolkeyInt32IO 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 ::  Exception6* ExceptionThe runtime detected an attempt to nest one STM transaction inside another one, presumably due to the use of unsafePeformIO with atomically. ,NestedAtomicallyNestedAtomically :: NestedAtomically2NestedAtomically,NestedAtomicallydata NestedAtomicallyvmzeromzero :: MonadPlus m => m aБ MonadPlusmma7 myThreadId myThreadId ::  IO ThreadId%IOThreadId>Returns the ThreadId of the calling thread (GHC only). Dmsummsum :: (Foldable t, MonadPlus m) => t (m a) -> m aÒFoldablet MonadPlusmtmama@The sum of a collection of actions, generalizing concat. msummsum :: MonadPlus m => [m a] -> m a MonadPlusm[]mama8This generalizes the list-based concat function. mplusmplus :: MonadPlus m => m a -> m a -> m auJ MonadPlusmmamamaBMonoidclass Monoid aThe monoid class. A minimal complete definition must supply mempty and mappend, and these should satisfy the monoid laws.  MonadPlusclass  Monad m =>  MonadPlus mt-Monads that also support choice and failure. Monadclass 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. F modifySTRef modifySTRef ::  STRef s a -> (a -> a) -> ST s ()ǙSTRefsaaaSTs()'Mutate the contents of an STRef  modifyIORef modifyIORef :: IORef a -> (a -> a) -> IO ()|IORefaaaIO()'Mutate the contents of an IORef ModifierSymbolModifierSymbol :: GeneralCategory&GeneralCategorySk: Symbol, Modifier ModifierLetterModifierLetter :: GeneralCategoryGeneralCategoryLm: Letter, Modifier :mod'mod' ::  Real a => a -> a -> aRealaaaa5generalisation of mod to any instance of Real  mkWeakIORef mkWeakIORef :: IORef a -> IO () -> IO (Weak (IORef a))œIORefaIO()IOWeakIORefa.Make a Weak pointer to an IORef  mkTyConApp mkTyConApp :: TyCon ->  [TypeRep] -> TypeRepTyCon[]TypeRepTypeRep2Applies a type constructor to a sequence of types mkTyConmkTyCon :: String -> TyCon9'StringTyConBuilds a TyCon object representing a type constructor. An implementation of Data.Typeable should ensure that the following holds:
mkTyCon "a" == mkTyCon "a"
0 mkStringType mkStringType :: String -> DataType^IStringDataType"Constructs the String type 0mkStringConstrmkStringConstr :: DataType -> String -> Constr DataTypeStringConstr9mkPolarmkPolar :: RealFloat a => a -> a ->  Complex ao RealFloataaaComplexaDForm a complex number from polar components of magnitude and phase. 0 mkNorepType mkNorepType :: String -> DataTypeD/StringDataType;Constructs a non-representation for a non-presentable type 0 mkIntType mkIntType :: String -> DataTypeСStringDataTypeConstructs the Int type 0 mkIntConstr mkIntConstr :: DataType -> Integer -> ConstrlDataTypeIntegerConstrmkFunTymkFunTy :: TypeRep -> TypeRep -> TypeRepTypeRepTypeRepTypeRepeA special case of mkTyConApp, which applies the function type constructor to a pair of types. 0 mkFloatType mkFloatType :: String -> DataTypeף£StringDataType!Constructs the Float type 0 mkFloatConstr mkFloatConstr :: DataType -> Double -> ConstrcDataTypeDoubleConstr0 mkDataType mkDataType :: String -> [Constr] -> DataType String[]ConstrDataType!Constructs an algebraic datatype 0mkConstr mkConstr :: DataType -> String -> [String] -> Fixity -> ConstrDataTypeString[]StringFixityConstrConstructs a constructor mkAppTymkAppTy :: TypeRep -> TypeRep -> TypeRep|^TypeRepTypeRepTypeRep&Adds a TypeRep argument to a TypeRep. minusPtrminusPtr :: Ptr a -> Ptr b -> IntPtraPtrbIntComputes the offset required to get from the second to the first argument. We have
p2 == p1 `plusPtr` (p2 `minusPtr` p1)
 minimumBy minimumBy :: (a -> a -> Ordering) -> [a] -> a'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. D minimumBy minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a}NFoldabletaaOrderingtaaZThe least element of a non-empty structure with respect to the given comparison function. minimumminimum ::  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. Dminimumminimum :: (Foldable t, Ord a) => t a -> atFoldabletOrdataa,The least element of a non-empty structure.  minmin ::  Ord a => a -> a -> a,Ordaaaa:Microtype Micro = Fixed E6g7mergeIOmergeIO :: [a] -> [a] -> IO [a][]a[]aIO[]aBmemptymempty ::  Monoid a => a1 MonoidaaBmconcatmconcat ::  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 aD-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.  maximumBy maximumBy :: (a -> a -> Ordering) -> [a] -> aزaaOrdering[]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. D maximumBy maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> aR#FoldabletaaOrderingtaa\The largest element of a non-empty structure with respect to the given comparison function. maximummaximum ::  Ord a => [a] -> aOrda[]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. Dmaximummaximum :: (Foldable t, Ord a) => t a -> arKFoldabletOrdataa.The largest element of a non-empty structure. 0maxConstrIndexmaxConstrIndex :: DataType -> ConIndexDataTypeConIndex<Gets the maximum constructor index of an algebraic datatype  maxmax ::  Ord a => a -> a -> aOrdaaaa MathSymbol MathSymbol :: GeneralCategoryGeneralCategorySm: Symbol, Math Bmappendmappend ::  Monoid a => a -> a -> azMonoidaaaamapMaybemapMaybe :: (a -> Maybe b) -> [a] -> [b]aMaybeb[]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. DmapM_mapM_ :: (Foldable t, Monad m) =>  (a -> m b) -> t a -> m ()ԺFoldabletMonadmambtam()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. ImapMmapM :: (Traversable t, Monad m) =>  (a -> m b) -> t a -> m (t b)$ TraversabletMonadmambtamtbmapMmapM ::  Monad m =>  (a -> m b) -> [a] -> m [b]Monadmamb[]am[]bQmapM f is equivalent to sequence . map f. . mapException mapException :: (Exception -> Exception) -> a -> ay Exception ExceptionaaoThis function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions". , mapException mapException ::  (Exception e1, Exception e2) =>  (e1 -> e2) -> a -> a Exceptione1 Exceptione2e1e2aaoThis 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])Monadmam(,)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. I mapAccumR  mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)O Traversabletab(,)acatb(,)atcThe mapAccumR function behaves like a combination of fmap and foldr; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.  mapAccumR  mapAccumR :: (acc -> x -> (acc, y)) -> acc -> [x] ->  (acc, [y])f'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. I mapAccumL  mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)C Traversabletab(,)acatb(,)atcThe mapAccumL function behaves like a combination of fmap and foldl; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.  mapAccumL  mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] ->  (acc, [y])accx(,)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. mapmap :: (a -> b) -> [a] -> [b]wab[]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, ...]
Cmanymany :: Alternative f => f a -> f [a] Alternativeffaf[]aZero or more. mallocForeignPtrBytesmallocForeignPtrBytes :: Int -> IO (ForeignPtr a)cIntIO ForeignPtraThis function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes. mallocForeignPtrArray0mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)StorableaIntIO 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. mallocForeignPtrArraymallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)yKStorableaIntIO 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. mallocForeignPtrmallocForeignPtr :: Storable a => IO (ForeignPtr a)StorableaIO 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. 9 magnitude magnitude :: RealFloat a =>  Complex a -> av RealFloataComplexaa/The nonnegative magnitude of a complex number. LowercaseLetterLowercaseLetter :: GeneralCategory-GeneralCategoryLl: Letter, Lowercase .LossOfPrecisionLossOfPrecision :: ArithExceptionArithException,LossOfPrecisionLossOfPrecision :: ArithExceptionArithException=looploop :: ArrowLoop a => a (b, d) (c, d) -> a b cc ArrowLoopaa(,)bd(,)cdabclookuplookup :: Eq a => a -> [(a, b)] -> Maybe b/Eqaa[](,)abMaybebIlookup key assocs looks up a key in an association list. lookuplookup :: HashTable key val -> key -> IO (Maybe val) 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 lineslines :: String -> [String]String[]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 r3Monadma1a2a3a4a5rma1ma2ma3ma4ma5mrfPromote 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 r?Monadma1a2a3a4rma1ma2ma3ma4mrfPromote 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 rMonadma1rma1mrPromote a function to a monad. CliftA3 liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Applicativefabcdfafbfcfd$Lift a ternary function to actions. CliftA2 liftA2 :: Applicative f =>  (a -> b -> c) -> f a -> f b -> f c Applicativefabcfafbfc#Lift a binary function to actions. CliftAliftA :: Applicative f => (a -> b) -> f a -> f br ApplicativefabfafboLift a function to actions. This function may be used as a value for fmap in a Functor instance. lexPlexP :: ReadPrec Lexeme_JReadPrecLexemeParse 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 StringReadSStringThe 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 :: GeneralCategory"GeneralCategoryNl: Number, Letter lengthlength :: [a] -> Intx[]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. leftslefts ::  [Either a b] -> [a][]Eitherab[]axExtracts from a list of Either all the Left elements All the Left elements are extracted in order. =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) ArrowChoiceaabcaEitherbdEithercdLeftLeft :: a ->  Either a b_IaEitherablastlast :: [a] -> a[]aaHExtract the last element of a list, which must be finite and non-empty. BLastLast :: Maybe a -> Last aS9MaybeaLastaBLastnewtype Last a8Maybe monoid returning the rightmost non-Nothing value. =KleisliKleisli ::  (a -> m b) ->  Kleisli m a b6ambKleislimab=Kleislinewtype Kleisli m a bqKleisli arrows of a monad. 7 killThread killThread :: ThreadId -> IO ()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 ThreadKilled
Killthread is a no-op if the target thread has already completed. JustJust :: a -> Maybe aaMaybeajoinjoin ::  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. AIxclass  Ord a => Ix aaWThe 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. iterateiterate :: (a -> a) -> a -> [a]&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 -> Bool#CharBoolPSelects Unicode symbol characters, including mathematical and currency symbols.  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 -> BooluCharBool{Selects white-space characters in the Latin-1 range. (In Unicode terms, this includes spaces and some control characters.) isSignedisSigned ::  Bits a => a -> BoolfOBitsaaBool 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 -> BoolCharBoolaSelects printable Unicode characters (letters, numbers, marks, punctuation, symbols and spaces).  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 -> Bool! MaybeaBoolVThe isNothing function returns True iff its argument is Nothing. 0 isNorepType isNorepType :: DataType -> BoolDataTypeBool"Test for a non-representable type isMarkisMark :: Char -> BoolSDCharBoolbSelects Unicode mark characters, e.g. accents and the like, which combine with preceding letters. isLowerisLower :: Char -> Bool CharBool<Selects lower-case alphabetic Unicode characters (letters). isLetterisLetter :: Char -> BoolCharBoolSelects 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 -> BoolCharBoolxSelects the first 256 characters of the Unicode character set, corresponding to the ISO 8859-1 (Latin-1) character set. isJustisJust :: Maybe a -> BoolxMaybeaBool`The isJust function returns True iff its argument is of the form Just _.  isInfixOf isInfixOf :: Eq a => [a] -> [a] -> BoolrNEqa[]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 -> BoolCharBool{Selects ASCII hexadecimal digits, i.e. '0'..'9', 'a'..'f', 'A'..'F'. -isEOFisEOF :: IO Bool  IOBoolgThe computation isEOF is identical to hIsEOF, except that it works only on stdin. isDigitisDigit :: Char -> Boold U CharBool7Selects ASCII digits, i.e. '0'..'9'. 7isCurrentThreadBoundisCurrentThreadBound :: 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. VIsCharclass IsChar c  isAsciiUpper isAsciiUpper :: Char -> Bool  CharBooleSelects ASCII upper-case letters, i.e. characters satisfying both isAscii and isUpper.  isAsciiLower isAsciiLower :: Char -> Bool  CharBooleSelects ASCII lower-case letters, i.e. characters satisfying both isAscii and isLower. isAsciiisAscii :: Char -> BoolqbCharBooliSelects the first 128 characters of the Unicode character set, corresponding to the ASCII character set.  isAlphaNum isAlphaNum :: Char -> Bool6'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 -> BoolCharBoolSelects 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. 0 isAlgType isAlgType :: DataType -> BoolDataTypeBoolTest for an algebraic type IORefdata IORef a*A mutable variable in the IO monad -IOModedata IOMode`. IOExceptiondata  IOExceptionExceptions 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. , IOExceptiondata  IOExceptionExceptions 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. .ioErrorsioErrors ::  Exception ->  Maybe IOError ExceptionMaybeIOError.ioErrorioError :: IOError -> IO aIOErrorIOa0Raise an IOError in the IO monad. ,ioErrorioError :: IOError -> IO aIOErrorIOa0Raise an IOError in the IO monad. -IOdata IO aA 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 -> CharIntCharConvert 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. 0IntRepIntRep :: DataRepDataRep intPtrToPtr intPtrToPtr :: IntPtr -> Ptr aN9IntPtrPtra+casts an IntPtr to a Ptr IntPtrdata IntPtrRA signed integral type that can be losslessly converted to and from Ptr.  intersperse intersperse :: a -> [a] -> [a]mUa[]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"
 intersectBy  intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]aaBool[]a[]a[]aSThe intersectBy function is the non-overloaded version of intersect.  intersect intersect :: Eq a => [a] -> [a] -> [a]Eqa[]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.  intercalate intercalate :: [a] -> [[a]] -> [a]` < []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 ()!!StringStringIO()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. 0 IntConstr IntConstr :: Integer ->  ConstrRep #"Integer ConstrRep Int8data Int89#8-bit signed integer type  Int64data Int64#64-bit signed integer type  Int32data Int32#32-bit signed integer type  Int16data Int16$16-bit signed integer type IntInt :: Integer -> Lexeme$r$IntegerLexemeInteger literal insertBy insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]4% %aaOrderinga[]a[]a-The non-overloaded version of insert. insertinsert ::  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. AinRangeinRange :: Ix a => (a, a) -> a -> Bool))Ixa(,)aaaBoolinitsinits :: [a] -> [[a]]J*/*[]a[][]aThe inits function returns all initial segments of the argument, shortest first. For example,
inits "abc" == ["","a","ab","abc"]
 InitialQuote InitialQuote :: GeneralCategory>+,+GeneralCategoryPi: Punctuation, Initial quote initinit :: [a] -> [a]++[]a[]a^Return all the elements of a list except the last one. The list must be finite and non-empty. 0InfixInfix :: FixityM,D,Fixity.IndexOutOfBoundsIndexOutOfBounds :: String -> ArrayException,,StringArrayExceptionCAn attempt was made to index an array outside its declared bounds. ,IndexOutOfBoundsIndexOutOfBounds :: String -> ArrayException-u-StringArrayExceptionCAn attempt was made to index an array outside its declared bounds. 0 indexConstr indexConstr :: DataType -> ConIndex -> Constr[.<.DataTypeConIndexConstr=Gets the constructor for an index (algebraic datatypes only) Aindexindex :: Ix a => (a, a) -> a -> Int/.Ixa(,)aaaInt9imagPartimagPart :: RealFloat a =>  Complex a -> a/l/ RealFloataComplexaa1Extracts the imaginary part of a complex number. IdentIdent :: String -> Lexeme00StringLexeme4Haskell identifier, e.g. foo, Baz ;idid :: a -> a00aaIdentity function. 1idid :: Category cat => cat a a10Categorycatcataa- hWaitForInput hWaitForInput :: Handle -> Int -> IO Bool1h1HandleIntIOBoolComputation 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 Integer4v4HandleIOInteger-hShowhShow :: Handle ->  IO String44HandleIOStringhShow is in the IO monad, and gives more comprehensive output than the (pure) instance of Show for Handle. -hSetPosnhSetPosn ::  HandlePosn -> IO ()55 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 ()77HandleIntegerIO()|hSetFileSize hdl size truncates the physical file with handle hdl to size bytes. -hSetEchohSetEcho :: Handle -> Bool -> IO ()88HandleBoolIO()<Set the echoing status of a handle connected to a terminal. - hSetBuffering hSetBuffering :: Handle ->  BufferMode -> IO ()z9Y9Handle 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 ()r<W<HandleBoolIO()qSelect binary mode (True) or text mode (False) on a open handle. (See also openBinaryFile.) -hSeek hSeek :: Handle -> SeekMode -> Integer -> IO ()x=P=HandleSeekModeIntegerIO()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 BoolcALAHandleIOBoolComputation 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 ()BBHandleStringIO():The same as hPutStr, but adds a newline character. -hPutStrhPutStr :: Handle -> String -> IO ()CfCHandleStringIO().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 ()(E EHandleCharIO()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 IntGG"GHandlePtraIntIOInt-hPutBuf hPutBuf :: Handle -> Ptr a -> Int -> IO ()GGHandlePtraIntIO()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).
V HPrintfTypeclass  HPrintfType tIThe HPrintfType class provides the variable argument magic for hPrintf. Its implementation is intentionally not visible from this module. VhPrintfhPrintf :: HPrintfType r => Handle -> String -> rKJ 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 ()LKShowaHandleaIO()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 CharNMHandleIOCharComputation 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 BooltO]OHandleIOBool-hIsTerminalDevicehIsTerminalDevice :: Handle -> IO BoolOOHandleIOBool'Is the handle connected to a terminal? - hIsSeekable hIsSeekable :: Handle -> IO Bool}PfPHandleIOBool- hIsReadable hIsReadable :: Handle -> IO BoolPPHandleIOBool-hIsOpenhIsOpen :: Handle -> IO BoolKQ4QHandleIOBool-hIsEOFhIsEOF :: Handle -> IO BoolQQHandleIOBoolyFor 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 BoolSuSHandleIOBool-hGetPosnhGetPosn :: Handle ->  IO HandlePosnSSHandleIO HandlePosnComputation hGetPosn hdl returns the current I/O position of hdl as a value of the abstract type HandlePosn. -hGetLinehGetLine :: Handle ->  IO StringTTHandleIOStringComputation 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 BoolVVHandleIOBool<Get the echoing status of a handle connected to a terminal. - hGetContents hGetContents :: Handle ->  IO StringWWHandleIOStringComputation 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 Char\\HandleIOCharComputation 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 Intn^I^HandlePtraIntIOInthGetBufNonBlocking 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 BufferModevaYaHandleIO BufferModecComputation hGetBuffering hdl returns the current buffering mode for hdl. -hGetBuf hGetBuf :: Handle -> Ptr a -> Int -> IO IntibDbHandlePtraIntIOInthGetBuf 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 ()ddHandleIO()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 IntegerffHandleIOIntegerFor a handle hdl which attached to a physical file, hFileSize hdl returns the size of that file in 8-bit bytes. . HeapOverflow HeapOverflow :: AsyncExceptionggAsyncExceptionThe 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.
, HeapOverflow HeapOverflow :: AsyncExceptionKi:iAsyncExceptionThe 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.
headhead :: [a] -> ajj[]aa>Extract the first element of a list, which must be non-empty. -hClosehClose :: Handle -> IO ()Ak,kHandleIO()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 azmJ hashUnique hashUnique :: Unique -> IntmmUniqueIntHashes 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 valn hashString hashString :: String -> Int32(ooStringInt32=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 -> Int32ssIntInt32A 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 ,HandlerHandler ::  (e -> IO a) ->  Handler auueIOaHandlera,Handlerdata Handler av- HandlePosndata  HandlePosn?v. handleJust  handleJust :: (Exception -> Maybe b) ->  (b -> IO a) -> IO a -> IO awv ExceptionMaybebbIOaIOaIOaUA version of catchJust with the arguments swapped around (see handle). , handleJust  handleJust :: Exception e => (e -> Maybe b) ->  (b -> IO a) -> IO a -> IO a'xw ExceptioneeMaybebbIOaIOaIOaUA version of catchJust with the arguments swapped around (see handle). .handlehandle :: (Exception -> IO a) -> IO a -> IO a yx 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)) $
   ...
,handlehandle :: Exception e =>  (e -> IO a) -> IO a -> IO axzEz ExceptioneeIOaIOaIOaA 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 Handlew{uHaskell 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. 0gunfold gunfold ::  Data a => (c (b -> r) -> c r) ->  (r -> c r) -> Constr -> c asDataacbrcrrcrConstrcaguardguard :: MonadPlus m => Bool -> m ()) MonadPlusmBoolm()guard b is return () if b is True, and mzero if b is False. groupBygroupBy :: (a -> a -> Bool) -> [a] -> [[a]]8aaBool[]a[][]aKThe groupBy function is the non-overloaded version of group. groupgroup :: 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. 0gmapTgmapT ::  Data a => (b -> b) -> a -> aՇDataabbaa0gmapQr gmapQr ::  Data a => (r' -> r -> r) -> r ->  (d -> r') -> a -> rvDataar'rrrdr'ar0gmapQl gmapQl ::  Data a => (r -> r' -> r) -> r ->  (d -> r') -> a -> rS'Dataarr'rrdr'ar0gmapQi gmapQi ::  Data a => Int -> (d -> u) -> a -> uDataaIntduau0gmapQgmapQ ::  Data a => (d -> u) -> a -> [u]_=Dataadua[]u0gmapMpgmapMp :: (Data a, MonadPlus m) =>  (d -> m d) -> a -> m aϊDataa MonadPlusmdmdama0gmapMogmapMo :: (Data a, MonadPlus m) =>  (d -> m d) -> a -> m auDataa MonadPlusmdmdama0gmapMgmapM :: (Data a, Monad m) =>  (d -> m d) -> a -> m aGDataaMonadmdmdama0gfoldl gfoldl ::  Data a => (c (d -> b) -> d -> c b) ->  (g -> c g) -> a -> c a ̌DataacdbdcbgcgacaC getZipList getZipList ::  ZipList a -> [a]w]ZipLista[]a.getUncaughtExceptionHandlergetUncaughtExceptionHandler :: IO (Exception -> IO ())IO ExceptionIO()BgetSumgetSum :: Sum a -> aZJSumaaP getProgName getProgName ::  IO StringIOStringComputation 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. B getProduct getProduct ::  Product a -> aǐProductaa-getLinegetLine ::  IO StringIOStringSRead a line from the standard input device (same as hGetLine stdin). BgetLastgetLast :: Last a -> Maybe aˑLastaMaybeaBgetFirstgetFirst :: First a -> Maybe a5FirstaMaybeaPgetEnvironmentgetEnvironment :: IO [(String, String)]IO[](,)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. PgetEnvgetEnv :: String ->  IO String StringIOStringComputation 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.
BgetDualgetDual :: Dual a -> aI8DualaaO getCPUTime getCPUTime ::  IO IntegerIOIntegerComputation getCPUTime returns the number of picoseconds CPU time used by the current program. The precision of this result is implementation-dependent. - getContents getContents ::  IO StringIOStringThe getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin). CgetConstgetConst ::  Const a b -> awConstaba-getChargetChar :: IO CharӗƗIOCharXRead a character from the standard input device (same as hGetChar stdin). PgetArgsgetArgs ::  IO [String]~iIO[]StringtComputation getArgs returns a list of the program's command line arguments (not including the program name). BgetAnygetAny :: Any -> BoolD6AnyBoolBgetAllgetAll :: All -> BoolAllBool 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. genericSplitAtgenericSplitAt :: Integral i => i -> [b] ->  ([b], [b])e.Integralii[]b(,)[]b[]bThe genericSplitAt function is an overloaded version of splitAt, which accepts any Integral value as the position at which to split. genericReplicategenericReplicate :: Integral i => i -> a -> [a]oIntegraliia[]aThe genericReplicate function is an overloaded version of replicate, which accepts any Integral value as the number of repetitions to make.  genericLength genericLength ::  Num i => [b] -> iNumi[]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.  genericIndex genericIndex :: Integral a => [b] -> a -> bIntegrala[]bab~The genericIndex function is an overloaded version of !!, which accepts any Integral value as the index.  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 -> GeneralCategory3CharGeneralCategory/The Unicode general category of the character. GeneralCategorydata GeneralCategoryuUnicode 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))l Typeable1t Typeable1t'ctaMaybect'aCast for * -> * gcastgcast :: (Typeable a, Typeable b) => c a ->  Maybe (c b)f,TypeableaTypeablebcaMaybecb9A flexible variation parameterised in a type constructor  funResultTy funResultTy :: TypeRep -> TypeRep ->  Maybe TypeRep4 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. FunPtrdata FunPtr aUA 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 frCThe 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 -> aIsStringaStringa 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)mEqkeykeyInt32[](,)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 -> a|Maybeaa~The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing. , fromException fromException :: Exception e =>  SomeException -> Maybe ez Exceptione SomeExceptionMaybee fromDynamic fromDynamic :: Typeable a => Dynamic -> Maybe a2 TypeableaDynamicMaybeasConverts a Dynamic object back into an ordinary Haskell value of the correct type. See also fromDyn. fromDynfromDyn :: Typeable a => Dynamic -> a -> a(TypeableaDynamicaawConverts a Dynamic object back into an ordinary Haskell value of the correct type. See also fromDynamic. 0 fromConstrM fromConstrM :: (Monad m, Data a) => m d -> Constr -> m aEMonadmDataamdConstrma(Monadic variation on fromConstrB 0 fromConstrB fromConstrB ::  Data a => d -> Constr -> aҶDataadConstra5Build a term and use a generic function for subterms 0 fromConstr fromConstr ::  Data a => Constr -> ayDataaConstraBuild a term skeleton  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. freeHaskellFunPtrfreeHaskellFunPtr :: 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 DforM_forM_ :: (Foldable t, Monad m) => t a ->  (a -> m b) -> m ()xFoldabletMonadmtaambm()9forM_ is mapM_ with its arguments flipped. forM_forM_ ::  Monad m => [a] ->  (a -> m b) -> m ()~PMonadm[]aambm()8forM_ is mapM_ with its arguments flipped IforMforM :: (Traversable t, Monad m) => t a ->  (a -> m b) -> m (t b)n+ 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 7forkOSforkOS :: IO () ->  IO ThreadIdڿIO()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 creates a bound thread, which is necessary if you need to call foreign (non-Haskell) libraries that make use of thread-local state, such as OpenGL (see Control.Concurrent#boundthreads). Using forkOS instead of forkIO makes no difference at all to the scheduling behaviour of the Haskell runtime system. It is a common misconception that you need to use forkOS instead of forkIO to avoid blocking all the Haskell threads when making a foreign call; this isn't the case. To allow foreign calls to be made without blocking all the Haskell threads (with GHC), it is only necessary to use the -threaded option when linking your program, and to make sure the foreign import is not marked unsafe. 7forkIOforkIO :: 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). The newly created thread has an exception handler that discards the exceptions BlockedOnDeadMVar, BlockedIndefinitely, and ThreadKilled, and passes all other exceptions to the uncaught exception handler (see setUncaughtExceptionHandler). foreverforever ::  Monad m => m a -> m b Monadmmamb;forever act repeats the action infinitely.  ForeignPtrdata  ForeignPtr a~`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. Dfor_for_ :: (Foldable t, Applicative f) => t a ->  (a -> f b) -> f ()SFoldablet Applicativeftaafbf()<for_ is traverse_ with its arguments flipped. Iforfor :: "(Traversable t, Applicative f) => t a ->  (a -> f b) -> f (t b)J Traversablet Applicativeftaafbftb:for is traverse with its arguments flipped. DfoldrM foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m bQFoldabletMonadmabmbbtambbMonadic fold over the elements of a structure, associating to the right, i.e. from right to left. foldr1foldr1 ::  (a -> a -> a) -> [a] -> ahNaaa[]aa}foldr1 is a variant of foldr that has no starting value argument, and thus must be applied to non-empty lists. Dfoldr1foldr1 :: Foldable t =>  (a -> a -> a) -> t a -> auMFoldabletaaataaDfoldr' foldr' :: Foldable t =>  (a -> b -> b) -> b -> t a -> bFoldabletabbbtabOFold over the elements of a structure, associating to the right, but strictly. foldr 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)...)
Dfoldr foldr :: Foldable t =>  (a -> b -> b) -> b -> t a -> baFoldabletabbbtabIfoldMapDefaultfoldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> mC TraversabletMonoidmamtam^This function may be used as a value for Data.Foldable.foldMap in a Foldable instance. DfoldMapfoldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> mDFoldabletMonoidmamtamfoldM_ 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 aMonadmabmaa[]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. DfoldlM foldlM :: (Foldable t, Monad m) => (a -> b -> m a) -> a -> t b -> m aXFoldabletMonadmabmaatbmaaMonadic fold over the elements of a structure, associating to the left, i.e. from left to right. foldl1'foldl1' ::  (a -> a -> a) -> [a] -> a/aaa[]aa"A strict version of foldl1 foldl1foldl1 ::  (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. Dfoldl1foldl1 :: Foldable t =>  (a -> a -> a) -> t a -> aFoldabletaaataafoldl' foldl' ::  (a -> b -> a) -> a -> [b] -> aV9abaa[]ba"A strict version of foldl. Dfoldl' foldl' :: Foldable t =>  (a -> b -> a) -> a -> t b -> aFoldabletabaatbaNFold over the elements of a structure, associating to the left, but strictly. foldl 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. Dfoldl foldl :: Foldable t =>  (a -> b -> a) -> a -> t b -> aFoldabletabaatbaDFoldableclass 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. Dfoldfold :: (Foldable t, Monoid m) => t m -> mS)FoldabletMonoidmtmmI 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 bFunctorfabfafb0FloatRepFloatRep :: DataRep DataRep0 FloatConstr FloatConstr :: Double ->  ConstrRepjDouble ConstrRep;flip flip ::  (a -> b -> c) -> b -> a -> cabcbac[flip f takes its (first) two arguments in the reverse order of f. 0Fixitydata FixityFixity of constructors -fixIOfixIO ::  (a -> IO a) -> IO aaIOaIOa:Fixeddata Fixed a.;fixfix :: (a -> a) -> a|naaafix 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)_Arrowaabca(,)bd(,)cdBFirstFirst :: Maybe a -> First aMaybeaFirstaBFirstnewtype First a/7Maybe monoid returning the leftmost non-Nothing value.  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.  findIndex findIndex ::  (a -> Bool) -> [a] ->  Maybe Int aBool[]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. findfind ::  (a -> Bool) -> [a] -> Maybe aBaBool[]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. Dfindfind :: Foldable t =>  (a -> Bool) -> t a -> Maybe aQFoldabletaBooltaMaybeaThe 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~GeneralCategoryPf: Punctuation, Final quote .finallyfinally :: IO a -> IO b -> IO a"IOaIObIOaRA specialised variant of bracket with just a computation to run afterward. ,finallyfinally :: IO a -> IO b -> IO aIOaIObIOaRA specialised variant of bracket with just a computation to run afterward.  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. FinalizerEnvPtrtype FinalizerEnvPtr env a% = FunPtr (Ptr env -> Ptr a -> IO ())finalizeForeignPtrfinalizeForeignPtr ::  ForeignPtr a -> IO ()L. ForeignPtraIO()OCauses the finalizers associated with a foreign pointer to be run immediately. filterMfilterM ::  Monad m =>  (a -> m Bool) -> [a] -> m [a]<MonadmamBool[]am[]a8This generalizes the list-based filter function. filterfilter ::  (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. failfail ::  Monad m => String -> m aMonadmStringmaQexitWithexitWith :: ExitCode -> IO a}gExitCodeIOaComputation 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. Q exitSuccess exitSuccess :: IO a_UIOaThe computation exitSuccess is equivalent to exitWith ExitSuccess, It terminates the program sucessfully. Q ExitSuccess ExitSuccess :: ExitCode,!ExitCode"indicates successful termination; Q exitFailure exitFailure :: IO aIOaThe computation exitFailure is equivalent to exitWith (ExitFailure exitfail), where exitfail is implementation-dependent. Q ExitFailure ExitFailure :: Int -> ExitCodeIntExitCodeindicates 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 ->  ExceptionExitCode 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. QExitCodedata ExitCode>. Exceptiondata  Exceptiont,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.OldException#DynamicExceptions). , Exceptionclass (Typeable e, Show e) =>  Exception e.evaluateevaluate :: a -> IO aF7aIOa)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
,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 StringfG 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. , ErrorCall ErrorCall :: String ->  ErrorCallString ErrorCall, ErrorCalldata  ErrorCallEqclass Eq a9?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 /=. EOFEOF :: LexemeLexemeBEndoEndo :: (a -> a) -> Endo aaaEndoaBEndonewtype Endo a@/The monoid of endomorphisms under composition.  EnclosingMark EnclosingMark :: GeneralCategoryGeneralCategoryMe: Mark, Enclosing Cemptyempty :: Alternative f => f aA &  Alternativeffa elemIndices elemIndices :: Eq a => a -> [a] -> [Int]  Eqaa[]a[]IntThe elemIndices function extends elemIndex, by returning the indices of all elements equal to the query element, in ascending order.  elemIndex elemIndex :: Eq a => a -> [a] ->  Maybe Int  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. elemelem :: Eq a => a -> [a] -> Bool  Eqaa[]aBoolielem is the list membership predicate, usually written in infix form, e.g., x `elem` xs. Delemelem :: (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 -> c  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 bThe 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 E12 dynTypeRep dynTypeRep :: Dynamic -> TypeRep>)DynamicTypeRep. dynExceptions dynExceptions ::  Exception ->  Maybe Dynamic ExceptionMaybeDynamic. DynException DynException :: Dynamic ->  Exception/Dynamic ExceptionqDynamically typed exceptions (see section on Dynamic Exceptions: Control.OldException#DynamicExceptions). dynApplydynApply :: Dynamic -> Dynamic ->  Maybe Dynamic/DynamicDynamicMaybeDynamicdynAppdynApp :: Dynamic -> Dynamic -> DynamicDynamicDynamicDynamicDynamicdata DynamicA 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. BDualDual :: a -> Dual aaDualaBDualnewtype Dual aLThe dual of a monoid, obtained by swapping the arguments of mappend.  dropWhile dropWhile ::  (a -> Bool) -> [a] -> [a]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]
dropdrop :: 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 :: ArithExceptionArithException, DivideByZero DivideByZero :: ArithExceptionM<ArithException:div'div' :: (Real a, Integral b) => a -> a -> bRealaIntegralbaab5generalisation of div to any instance of Real  digitToInt digitToInt :: Char -> IntbTCharInt 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'). deRefStablePtrdeRefStablePtr ::  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 :: ArithExceptioniXArithException,DenormalDenormal :: ArithExceptionArithExceptionE 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. deleteFirstsBy deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]p!D!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. deleteBy deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]""aaBoola[]a[]agThe deleteBy function behaves like delete, but takes a user-supplied equality predicate. deletedelete :: Eq a => a -> [a] -> [a]#i#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 :: GeneralCategory%%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). ,DeadlockDeadlock :: Deadlock&&Deadlock,Deadlockdata Deadlock'0 dataTypeRep dataTypeRep :: DataType -> DataRep'm'DataTypeDataRep+Gets the public presentation of a datatype 0 dataTypeOf dataTypeOf ::  Data a => a -> DataType!((DataaaDataType0 dataTypeName dataTypeName :: DataType -> String(x(DataTypeString/Gets the type constructor including the module 0dataTypeConstrsdataTypeConstrs :: DataType -> [Constr]6))DataType[]Constr/Gets the constructors of an algebraic datatype 0DataTypedata DataType)eRepresentation of datatypes. A package of constructor representations with names of type and module. 0DataRepdata DataRep0*#Public representation of datatypes 0 dataCast2 dataCast2 :: (Data a, Typeable2 t) =>  c (t d e) ->  Maybe (c a)+*Dataa Typeable2tctdeMaybeca0 dataCast1 dataCast1 :: (Data a, Typeable1 t) => c (t d) ->  Maybe (c a)+p+Dataa Typeable1tctdMaybeca0Dataclass 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 -XDeriveDataTypeable 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. DashPunctuationDashPunctuation :: GeneralCategoryj9X9GeneralCategoryPd: Punctuation, Dash cyclecycle :: [a] -> [a]99[]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. CurrencySymbolCurrencySymbol :: GeneralCategory;;GeneralCategorySc: Symbol, Currency OcpuTimePrecisioncpuTimePrecision :: Integer<;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 :: GeneralCategory=<GeneralCategoryCc: Other, Control 0 constrType constrType :: Constr -> DataType~=i=ConstrDataType#Gets the datatype of a constructor 0 constrRep constrRep :: Constr ->  ConstrRep >=Constr ConstrRep-Gets the public presentation of constructors 0 ConstrRepdata  ConstrRepl>&Public representation of constructors 0 constrIndex constrIndex :: Constr -> ConIndex>>ConstrConIndex;Gets the index of a constructor (algebraic datatypes only) 0 constrFixity constrFixity :: Constr -> Fixity??ConstrFixity!Gets the fixity of a constructor 0 constrFields constrFields :: Constr -> [String]0@@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. 0Constrdata Constr@Representation of constructors ;constconst :: a -> b -> ajA^AabaConstant function. CConstConst :: a ->  Const a bAAaConstabCConstnewtype Const a b BConnectorPunctuationConnectorPunctuation :: GeneralCategoryzBhBGeneralCategoryPc: Punctuation, Connector 9 conjugate conjugate :: RealFloat a =>  Complex a ->  Complex a(CB RealFloataComplexaComplexa#The conjugate of a complex number. 0ConIndextype ConIndex = IntCiUnique index for datatype constructors, counting from 1 in the order they are given in the program text.  concatMap concatMap ::  (a -> [b]) -> [a] -> [b]rDODa[]b[]a[]b8Map a function over a list and concatenate the results. D concatMap concatMap :: Foldable t =>  (a -> [b]) -> t a -> [b]HEEFoldableta[]bta[]bYMap a function over all the elements of a container and concatenate the resulting lists. concatconcat :: [[a]] -> [a]FE[][]a[]aConcatenate a list of lists. Dconcatconcat :: Foldable t => t [a] -> [a]FqFFoldablett[]a[]a?The concatenation of all the elements of a container of lists. 9Complexdata RealFloat a => Complex aG 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 -> aHHBitsaaInta complement complement ::  Bits a => a -> a IHBitsaaaRcompilerVersioncompilerVersion :: Version`IVIVersion`The version of compilerName with which the program was compiled or is being interpreted. R compilerName compilerName :: String JJStringXThe Haskell implementation with which the program was compiled or is being interpreted.  comparing  comparing ::  Ord a => (b -> a) -> b -> b -> OrderingJJOrdababbOrdering
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) ...
 comparecompare ::  Ord a => a -> a -> OrderingTL7LOrdaaaOrderingClosePunctuationClosePunctuation :: GeneralCategoryLLGeneralCategoryPe: Punctuation, Close clearBitclearBit ::  Bits a => a -> Int -> aFM-MBitsaaInta9ciscis :: RealFloat a => a ->  Complex aMM RealFloataaComplexawcis t is a complex value with magnitude 1 and phase t (modulo 2*pi). chrchr :: Int -> Char}NoNIntCharAThe Prelude.toEnum method restricted to the type Data.Char.Char. CharChar :: Char -> LexemeOOCharLexemeCharacter literal  catMaybes catMaybes ::  [Maybe a] -> [a]OsO[]Maybea[]anThe catMaybes function takes a list of Maybes and returns a list of all the Just values. 1Categoryclass Category cat8P7A class for categories. id and (.) must form a monoid. . catchJust  catchJust :: (Exception -> Maybe b) -> IO a ->  (b -> IO a) -> IO a/QP 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. , catchJust  catchJust :: Exception e => (e -> Maybe b) -> IO a ->  (b -> IO a) -> IO afT"T ExceptioneeMaybebIOabIOaIOaThe 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.
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. ,catchescatches :: IO a ->  [Handler a] -> IO aV[VIOa[]HandleraIOa.catchDyncatchDyn :: Typeable exception => IO a -> (exception -> IO a) -> IO aDWWTypeable 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. .catchcatch :: IO a -> (Exception -> IO a) -> IO aYXIOa 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.OldException:
import Prelude hiding (catch)
or importing Control.OldException qualified, to avoid name-clashes:
import qualified Control.OldException as C
and then using C.catch ,catchcatch :: Exception e => IO a ->  (e -> IO a) -> IO aJaa ExceptioneIOaeIOaIOaThis 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 Control.Exception.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 castStablePtrToPtrcastStablePtrToPtr ::  StablePtr a -> Ptr ()}i_i 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. castPtrToStablePtrcastPtrToStablePtr :: Ptr () ->  StablePtr askUkPtr() 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. castPtrToFunPtrcastPtrToFunPtr :: Ptr a -> FunPtr bDm*mPtraFunPtrbCasts 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. castPtrcastPtr :: Ptr a -> Ptr bnnPtraPtrbFThe castPtr function casts a pointer from one type to another. castFunPtrToPtrcastFunPtrToPtr :: FunPtr a -> Ptr bnoToFunPtraPtrbCasts 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.  castFunPtr castFunPtr :: FunPtr a -> FunPtr bppFunPtraFunPtrb>Casts a FunPtr to a FunPtr of a different type. castForeignPtrcastForeignPtr ::  ForeignPtr a ->  ForeignPtr bqq ForeignPtra ForeignPtrbUThis function casts a ForeignPtr parameterised by one type into another type. castcast :: (Typeable a, Typeable b) => a -> Maybe brhrTypeableaTypeablebaMaybebThe type-safe cast operation - BufferModedata  BufferModer,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. breakbreak ::  (a -> Bool) -> [a] ->  ([a], [a])zxzaBool[]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). .bracketOnError bracketOnError :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO cD}}IOaaIObaIOcIOcqLike bracket, but only performs the final action if there was an exception raised by the in-between computation. ,bracketOnError bracketOnError :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO ci~8~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 cjCIOaIObIOcIOc_A variant of bracket where the return value from the first computation is not required. ,bracket_ bracket_ :: IO a -> IO b -> IO c -> IO cY2IOaIObIOcIOc_A variant of bracket where the return value from the first computation is not required. .bracket bracket :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO c^-IOaaIObaIOcIOcWhen 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
,bracket bracket :: IO a ->  (a -> IO b) ->  (a -> IO c) -> IO cIOaaIObaIOcIOcWhen 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
.BlockedOnDeadMVarBlockedOnDeadMVar ::  Exceptionć 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. ,BlockedOnDeadMVarBlockedOnDeadMVar :: BlockedOnDeadMVarЈBlockedOnDeadMVar,BlockedOnDeadMVardata BlockedOnDeadMVar.BlockedIndefinitelyBlockedIndefinitely ::  Exceptionvj 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. ,BlockedIndefinitelyBlockedIndefinitely :: BlockedIndefinitelyBlockedIndefinitely,BlockedIndefinitelydata BlockedIndefinitely,blockedblocked :: IO Bool8+IOBoolKreturns True if asynchronous exceptions are blocked in the current thread. -BlockBufferingBlockBuffering ::  Maybe Int ->  BufferModeMaybeInt 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 aIOaIOaApplying 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. ,blockblock :: IO a -> IO a;&IOaIOaApplying 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 -> IntzdBitsaaIntBitsclass  Num a => Bits aThe 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 -> aBitsaIntaatomicModifyIORefatomicModifyIORef :: IORef a ->  (a -> (a, b)) -> IO b8IORefaa(,)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 AsyncExceptiony ExceptionMaybeAsyncException.AsyncExceptiondata AsyncExceptionAsynchronous exceptions .AsyncExceptionAsyncException :: AsyncException ->  Exceptionz\AsyncException ExceptionvAsynchronous exceptions (see section on Asynchronous Exceptions: Control.OldException#AsynchronousExceptions). ,AsyncExceptiondata AsyncException0Asynchronous exceptions Dasumasum :: (Foldable t, Alternative f) => t (f a) -> f aFoldablet Alternativeftfafa@The sum of a collection of actions, generalizing concat. . assertions assertions ::  Exception ->  Maybe String} ExceptionMaybeString.AssertionFailedAssertionFailed :: String ->  ExceptionString 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. ,AssertionFailedAssertionFailed :: String -> AssertionFailed;StringAssertionFailed,AssertionFaileddata AssertionFailed}.assertassert :: Bool -> a -> a۝̝Boolaa7If 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. ,assertassert :: Bool -> a -> apaBoolaa7If 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 a= ArrowPlusclass ArrowZero a =>  ArrowPlus a3= ArrowMonad ArrowMonad :: a () b -> ArrowMonad a ba()b ArrowMonadab= ArrowMonadnewtype ArrowApply a =>  ArrowMonad a bThe 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 aThe 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 aChoice, 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 aJ?Some arrows allow application of arrow inputs to other inputs. =Arrowclass Category a => Arrow aȧThe basic arrow class. Minimal complete definition: arr and first. The other combinators have sensible default definitions, which may be overridden for efficiency. .ArrayExceptiondata ArrayException)Exceptions generated by array operations .ArrayExceptionArrayException :: ArrayException ->  ExceptiongIArrayException ExceptionlExceptions raised by array-related operations. (NOTE: GHC currently does not throw ArrayExceptions). ,ArrayExceptiondata ArrayException)Exceptions generated by array operations =arrarr ::  Arrow a => (b -> c) -> a b cArrowabcabc.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). ,ArithExceptiondata ArithException"The type of arithmetic exceptions Rarcharch :: StringC:String:The machine architecture on which the program is running. EapproxRationalapproxRational :: RealFrac a => a -> a -> RationalRealFracaaaRational.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. C 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. BappEndoappEndo :: Endo a -> a -> aEndoaaa- AppendMode AppendMode :: IOModeZQIOMode- appendFile appendFile :: FilePath -> String -> IO ()ݴFilePathStringIO()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) cƶ ArrowApplyaa(,)abcbcapap ::  Monad m =>  m (a -> b) -> m a -> m b}QMonadmmabmambIn 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
anyany ::  (a -> Bool) -> [a] -> BoolиaBool[]aBoolmApplied to a predicate and a list, any determines if any element of the list satisfies the predicate. Danyany :: Foldable t =>  (a -> Bool) -> t a -> Bool˹FoldabletaBooltaBoolIDetermines whether any element of the structure satisfies the predicate. BAnyAny :: Bool -> Any`RBoolAnyBAnynewtype Any"Boolean monoid under disjunction. andand :: [Bool] -> Bool[]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. Dandand :: Foldable t => t Bool -> BoolQ.FoldablettBoolBooland 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. C Alternativeclass Applicative f =>  Alternative ft"A monoid on applicative functors. allall ::  (a -> Bool) -> [a] -> BoolaBool[]aBoollApplied to a predicate and a list, all determines if all elements of the list satisfy the predicate. Dallall :: Foldable t =>  (a -> Bool) -> t a -> Bool׾FoldabletaBooltaBoolHDetermines whether all elements of the structure satisfy the predicate. BAllAll :: Bool -> AllBoolAllBAllnewtype Allÿ"Boolean monoid under conjunction. alignPtralignPtr :: Ptr a -> Int -> Ptr a[?PtraIntPtraGiven 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 -> IntStorableaaInt0AlgRepAlgRep :: [Constr] -> DataRep5[]ConstrDataRep0 AlgConstr AlgConstr :: ConIndex ->  ConstrRepConIndex ConstrRepaddForeignPtrFinalizerEnv addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env ->  ForeignPtr a -> IO ()IFinalizerEnvPtrenvaPtrenv 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 addForeignPtrFinalizeraddForeignPtrFinalizer :: FinalizerPtr a ->  ForeignPtr a -> IO ()B 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 ()o 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 :: SeekModeSeekMode3the 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 dBArrowacdabcabd>Postcomposition with a pure function (right-to-left variant). \\ (\\) :: 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 dArrowaabccdabd&Postcomposition with a pure function. 1>>> (>>>) :: Category cat => cat a b -> cat b c -> cat a cCategorycatcatabcatbccatacLeft-to-right composition =>>> (>>>) :: Category cat => cat a b -> cat b c -> cat a c]CategorycatcatabcatbccatacLeft-to-right composition >>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bBMonadmmaambmb>> (>>) ::  Monad m => m a -> m b -> m bMonadmmambmb>=> (>=>) ::  Monad m =>  (a -> m b) ->  (b -> m c) -> a -> m cp<Monadmambbmcamc-Left-to-right Kleisli composition of monads.  >= (>=) ::  Ord a => a -> a -> Bool OrdaaaBool > (>) ::  Ord a => a -> a -> Booly`OrdaaaBool== (==) :: Eq a => a -> a -> BoolEqaaaBool=<< (=<<) ::  Monad m =>  (a -> m b) -> m a -> m bvJMonadmambmamb?Same as >>=, but with the arguments interchanged. C<|> (<|>) :: Alternative f => f a -> f a -> f aE Alternativeffafafa<=< (<=<) ::  Monad m =>  (b -> m c) ->  (a -> m b) -> a -> m cMonadmbmcambamcWRight-to-left Kleisli composition of monads. '(>=>)', with the arguments flipped  <= (<=) ::  Ord a => a -> a -> BoolOrdaaaBool=<<^ (<<^) ::  Arrow a => a c d -> (b -> c) -> a b dJArrowaacdbcabd=Precomposition with a pure function (right-to-left variant). 1<<< (<<<) :: Category cat => cat b c -> cat a b -> cat a c0CategorycatcatbccatabcatacRight-to-left composition =<<< (<<<) :: Category cat => cat b c -> cat a b -> cat a cCategorycatcatbccatabcatacRight-to-left composition =<+> (<+>) :: ArrowPlus a => a b c -> a b c -> a b ct ArrowPlusaabcabcabcC<*> (<*>) :: Applicative f =>  f (a -> b) -> f a -> f bD ApplicativeffabfafbC<**> (<**>) :: Applicative f => f a ->  f (a -> b) -> f b Applicativeffafabfb;A variant of <*> with the arguments reversed. C<* (<*) :: Applicative f => f a -> f b -> f a~ Applicativeffafbfa?Sequence actions, discarding the value of the second argument. C<$> (<$>) ::  Functor f => (a -> b) -> f a -> f bwNFunctorfabfafbA synonym for fmap. C<$ (<$) ::  Functor f => a -> f b -> f aFunctorfafbfaReplace the value.  < (<) ::  Ord a => a -> a -> BoolxOrdaaaBool9:+ (:+) :: a -> a ->  Complex aaaComplexaKforms a complex number from its real and imaginary rectangular components. /= (/=) :: Eq a => a -> a -> BoolEqaaaBool.|. (.|.) ::  Bits a => a -> a -> aBitsaaaa.&. (.&.) ::  Bits a => a -> a -> auBitsaaaa;. (.) :: (b -> c) -> (a -> b) -> a -> cbcabacFunction composition. 1. (.) :: Category cat => cat b c -> cat a b -> cat a cCategorycatcatbccatabcatac=+++ (+++) :: ArrowChoice a => a b c -> a b' c' -> a (Either b b') (Either c c')F ArrowChoiceaabcab'c'aEitherbb'Eithercc'++ (++) :: [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. C*> (*>) :: Applicative f => f a -> f b -> f bnA Applicativeffafbfb>Sequence actions, discarding the value of the first argument. =*** (***) ::  Arrow a => a b c -> a b' c' -> a (b, b') (c, c')eArrowaabcab'c'a(,)bb'(,)cc'=&&& (&&&) ::  Arrow a => a b c -> a b c' ->  a b (c, c') Arrowaabcabc'ab(,)cc'&& (&&) :: Bool -> Bool -> Bools^BoolBoolBoolBoolean "and" E% (%) :: Integral a => a -> a -> Ratio aIntegralaaaRatioa)Forms the ratio of two integral numbers. ;$ ($) :: (a -> b) -> a -> byababApplication operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
f $ g $ h x  =  f (g (h x))
It is also useful in higher-order situations, such as map ($ 0) xs, or Data.List.zipWith ($) fs xs. !! (!!) :: [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. /|| (||) :: Bool -> Bool -> BoolBoolBoolBool Boolean "or" /zipWith3 zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]q<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. /zipWith 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. /zip3 zip3 :: [a] -> [b] -> [c] ->  [(a, b, c)]A []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 -> 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)
/unzip3unzip3 ::  [(a, b, c)] -> ([a], [b], [c])Q[](,,)abc(,,)[]a[]b[]cgThe unzip3 function takes a list of triples and returns three lists, analogous to unzip. /unzipunzip :: [(a, b)] ->  ([a], [b])4[](,)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 -> 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! /unlinesunlines :: [String] -> String []StringStringwunlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each. / undefined undefined :: aaA 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 -> bRealFracaIntegralbab/ toRational toRational ::  Real a => a -> Rational0RealaaRational/ toInteger toInteger :: Integral a => a -> IntegerIntegralaaInteger/toEnumtoEnum ::  Enum a => Int -> aEnumaInta/tanhtanh :: Floating a => a -> aiQFloatingaaa/tantan :: Floating a => a -> aFloatingaaa/ takeWhile takeWhile ::  (a -> Bool) -> [a] -> [a]H(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] -> atNuma[]aaFThe sum function computes the sum of a finite list of numbers. /succsucc ::  Enum a => a -> a,Enumaaa/subtractsubtract ::  Num a => a -> a -> aNumaaaa'the same as flip (-). Because - is treated specially in the Haskell grammar, (- e) is not a section, but an application of prefix negation. However, (subtract exp) is equivalent to the disallowed section. /Stringtype String = [Char]gA String is a list of characters. String constants in Haskell are values of type String. /sqrtsqrt :: Floating a => a -> aFloatingaaa/splitAtsplitAt :: Int -> [a] ->  ([a], [a])J 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])H  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) -> b o (,)abb(Extract the second component of a pair. /sinhsinh :: Floating a => a -> a  Floatingaaa/sinsin :: Floating a => a -> ajRFloatingaaa/signumsignum ::  Num a => a -> aNumaaa/ significand significand :: RealFloat a => a -> a6 RealFloataaa/ showString showString :: String -> ShowSStringShowSjutility function converting a String to a show function that simply prepends the string unchanged. / showsPrec showsPrec ::  Show a => Int -> a -> ShowSdShowaIntaShowS showSigned  showSigned ::  Real a =>  (a -> ShowS) -> Int -> a -> ShowS&RealaaShowSIntaShowS<Converts a possibly-negative Real value to a string. /showsshows ::  Show a => a -> ShowSShowaaShowS7equivalent to showsPrec with a precedence of 0. /ShowStype ShowS = String -> String?The 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 -> ShowSv_BoolShowSShowSxutility function that surrounds the inner show function with parentheses when the Bool parameter is True. showOctshowOct :: Integral a => a -> ShowS]AIntegralaaShowS<Show non-negative Integral numbers in base 8. /showListshowList ::  Show a => [a] -> ShowS Showa[]aShowS showIntAtBase  showIntAtBase :: Integral a => a ->  (Int -> Char) -> a -> ShowSIntegralaaIntCharaShowSShows 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 -> ShowSsWIntegralaaShowS=Show non-negative Integral numbers in base 16.  showGFloat showGFloat :: RealFloat a =>  Maybe Int -> a -> ShowSJ 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 -> ShowSfI 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 -> ShowS 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 -> ShowS 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 -> ShowS{kCharShowSkutility function converting a Char to a show function that simply prepends the character unchanged. /showshow ::  Show a => a -> StringI 0 ShowaaString/Showclass Show ax .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. /seqseq :: a -> b -> b**abbThe value of seq a b is bottom if a is bottom, and otherwise equal to b. seq is usually introduced to improve performance by avoiding unneeded laziness. /scanr1scanr1 ::  (a -> a -> a) -> [a] -> [a]++aaa[]a[]aPscanr1 is a variant of scanr that has no starting value argument. /scanr scanr ::  (a -> b -> b) -> b -> [a] -> [b],,abbb[]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]--aaa[]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]..abaa[]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 -> a100 RealFloataIntaa/roundround :: (RealFrac a, Integral b) => a -> b00RealFracaIntegralbab/RightRight :: b ->  Either a b 10bEitherab/reversereverse :: [a] -> [a]g1R1[]a[]amreverse xs returns the elements of xs in reverse order. xs must be finite. /returnreturn ::  Monad m => a -> m a:2 2Monadmama/ replicate replicate :: Int -> a -> [a]22Inta[]areplicate n x is a list of length n with x the value of every element. It is an instance of the more general Data.List.genericReplicate, in which n may be of any integral type. /repeatrepeat :: a -> [a]33a[]aZrepeat x is an infinite list, with x the value of every element. /remrem :: Integral a => a -> a -> a4~4Integralaaaa/reciprecip :: Fractional a => a -> a54 Fractionalaaa/ realToFrac realToFrac :: (Real a, Fractional b) => a -> b5a5Reala Fractionalbab%general coercion to fractional types /RealFracclass (Real a, Fractional a) => RealFrac a5XExtracting components of fractions. Minimal complete definition: properFraction / RealFloatclass (RealFrac a, Floating a) =>  RealFloat a6Efficient, 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 a7/ readsPrec readsPrec ::  Read a => Int -> ReadS a%88ReadaIntReadSa readSigned readSigned ::  Real a => ReadS a -> ReadS a88RealaReadSaReadSaOReads a signed Real value, given a reader for an unsigned value. /readsreads ::  Read a => ReadS aO979ReadaReadSa7equivalent to readsPrec with a precedence of 0. /ReadStype ReadS a = String -> [(a, String)]9 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 at;S;BoolReadSaReadSareadParen 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<<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[]a/readIOreadIO ::  Read a => String -> IO aF>'>ReadaStringIOaThe readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program. readInt readInt ::  Num a => a -> (Char -> Bool) ->  (Char -> Int) -> ReadS a?^?NumaaCharBoolCharIntReadSaEReads an unsigned Integral value in an arbitrary base. readHexreadHex ::  Num a => ReadS a4@@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 StringAAFilePathIOStringThe 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 aBBNumaReadSa-Read an unsigned number in decimal notation. /readread ::  Read a => String -> aHC/CReadaStringalThe read function reads input from a string, which must be completely consumed by the input process. /Readclass Read aC 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 IntegerMArbitrary-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)NNIntegralaaa(,)aa/quotquot :: Integral a => a -> a -> a_ODOIntegralaaaa/putStrLnputStrLn :: String -> IO ()OOStringIO()9The same as putStr, but adds a newline character. /putStrputStr :: String -> IO ()VPAPStringIO()UWrite a string to the standard output device (same as hPutStr stdout). /putCharputChar :: Char -> IO ()QPCharIO()YWrite a character to the standard output device (same as hPutChar stdout). /properFractionproperFraction :: (RealFrac a, Integral b) => a -> (b, a)RQRealFracaIntegralba(,)ba/productproduct ::  Num a => [a] -> aeRLRNuma[]aaNThe product function computes the product of a finite list of numbers. /printprint ::  Show a => a -> IO ()SRShowaaIO()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 -> aUUEnumaaa/pipi :: Floating a => abUOUFloatingaa/ otherwise otherwise :: BoolUUBoolotherwise is defined as the value True. It helps to make guards more readable. eg.
f x | x < 0     = ...
    | otherwise = ...
/Ordclass Eq a => Ord awVThe 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] -> BoolXX[]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 -> BoolZYIntegralaaBool/Numclass (Eq a, Show a) => Num aYZ\Basic numeric class. Minimal complete definition: all except negate or (-) /nullnull :: [a] -> Bool[Z[]aBoolTest whether a list is empty. /NothingNothing :: Maybe al[_[Maybea/notElemnotElem :: Eq a => a -> [a] -> Bool[[Eqaa[]aBool/notElem is the negation of elem. /notnot :: Bool -> Boolb\S\BoolBoolBoolean "not" /negatenegate ::  Num a => a -> a\\Numaaa/Monadclass 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``Integralaaaa/minimumminimum ::  Ord a => [a] -> aZaAaOrda[]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 => ab{bBoundedaa/minmin ::  Ord a => a -> a -> abbOrdaaaa/maybe maybe :: b -> (a -> b) -> Maybe a -> bscVcbabMaybeab 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 ad-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] -> a@g'gOrda[]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 => ashahBoundedaa/maxmax ::  Ord a => a -> a -> ahhOrdaaaa/mapM_mapM_ ::  Monad m =>  (a -> m b) -> [a] -> m ()ii;iMonadmamb[]am()SmapM_ f is equivalent to sequence_ . map f. /mapMmapM ::  Monad m =>  (a -> m b) -> [a] -> m [b]QjjMonadmamb[]am[]bQmapM f is equivalent to sequence . map f. /mapmap :: (a -> b) -> [a] -> [b]kjab[]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, ...]
/lookuplookup :: Eq a => a -> [(a, b)] -> Maybe btlFlEqaa[](,)abMaybebIlookup key assocs looks up a key in an association list. /logBaselogBase :: Floating a => a -> a -> a4mmFloatingaaaa/loglog :: Floating a => a -> am{mFloatingaaa/lineslines :: String -> [String]mmString[]String}lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.  lexDigits lexDigits ::  ReadS StringnnReadSString,Reads a non-empty string of decimal digits. /lexlex ::  ReadS Stringlex 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] -> IntVrEr[]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 bgsQsaEitherab/lcmlcm :: Integral a => a -> a -> assIntegralaaaaelcm x y is the smallest positive integer that both x and y divide. /lastlast :: [a] -> atxt[]aaHExtract the last element of a list, which must be finite and non-empty. /JustJust :: a -> Maybe a"uuaMaybea/iterateiterate :: (a -> a) -> a -> [a]uyuaaa[]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 -> Boolvv RealFloataaBool/isNaNisNaN :: RealFloat a => a -> Boolwv RealFloataaBool/ isInfinite isInfinite :: RealFloat a => a -> Boolwpw RealFloataaBool/isIEEEisIEEE :: RealFloat a => a -> Boolww RealFloataaBool/isDenormalizedisDenormalized :: RealFloat a => a -> BoolvxZx RealFloataaBool/ioErrorioError :: IOError -> IO axxIOErrorIOa0Raise an IOError in the IO monad. /IOErrortype IOError = IOExceptionGy%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 azA 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 ()}}StringStringIO()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 a~qIntegral numbers, supporting integer division. Minimal complete definition: quotRem and toInteger /initinit :: [a] -> [a][]a[]a^Return all the elements of a list except the last one. The list must be finite and non-empty. /idid :: a -> aLCaaIdentity function. /headhead :: [a] -> a[]aa>Extract the first element of a list, which must be non-empty. /getLinegetLine ::  IO String4%IOStringSRead a line from the standard input device (same as hGetLine stdin). / 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). /getChargetChar :: IO CharIOCharXRead a character from the standard input device (same as hGetChar stdin). /gcdgcd :: Integral a => a -> a -> ajIntegralaaaagcd 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 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. /fstfst :: (a, b) -> amZ(,)aba'Extract the first component of a pair. / fromRational fromRational :: Fractional a => Rational -> a FractionalaRationalafromRatfromRat :: RealFloat a => Rational -> an RealFloataRationalaJConverts a Rational value into any type in class RealFloat. / fromIntegral fromIntegral :: (Integral a, Num b) => a -> b\:IntegralaNumbab%general coercion from integral types / fromInteger fromInteger ::  Num a => Integer -> aوNumaIntegera/fromEnumfromEnum ::  Enum a => a -> IntWAEnumaaInt/ Fractionalclass  Num a =>  Fractional aFractional numbers, supporting real division. Minimal complete definition: fromRational and (recip or (/)) /foldr1foldr1 ::  (a -> a -> a) -> [a] -> aaaa[]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] -> b{abbb[]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] -> aaaa[]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] -> 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. /fmapfmap ::  Functor f => (a -> b) -> f a -> f bFunctorfabfafb/floorfloor :: (RealFrac a, Integral b) => a -> bBRealFracaIntegralbab 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) RealFloataa(,)IntInt/ floatRadix floatRadix :: RealFloat a => a -> Integer\= RealFloataaInteger/Floatingclass Fractional a => Floating aTrigonometric 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 -> Int RealFloataaInt/flip flip ::  (a -> b -> c) -> b -> a -> c}abcbac[flip f takes its (first) two arguments in the reverse order of f. /filterfilter ::  (a -> Bool) -> [a] -> [a]iIaBool[]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 = StringRFile 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. /failfail ::  Monad m => String -> m avMonadmStringma/exponentexponent :: RealFloat a => a -> Int RealFloataaInt/expexp :: Floating a => a -> acKFloatingaaa/eveneven :: Integral a => a -> BoolʙIntegralaaBool/errorerror :: [Char] -> a []Chara<error stops execution and displays an error message. /Eqclass Eq a?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 /=. / enumFromTo enumFromTo ::  Enum a => a -> a -> [a]A$Enumaaa[]a/enumFromThenTo enumFromThenTo ::  Enum a => a -> a -> a -> [a]֜Enumaaaa[]a/ enumFromThen enumFromThen ::  Enum a => a -> a -> [a]W:Enumaaa[]a/enumFromenumFrom ::  Enum a => a -> [a]Enumaa[]a/Enumclass Enum aClass 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< RealFloataIntegerInta/elemelem :: Eq a => a -> [a] -> BoolEqaa[]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 -> cacbcEitherabcCase 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 bThe 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]ɧ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]
/dropdrop :: 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. /divModdivMod :: Integral a => a -> a -> (a, a)d?Integralaaa(,)aa/divdiv :: Integral a => a -> a -> aӫIntegralaaaa/ decodeFloat decodeFloat :: RealFloat a => a -> (Integer, Int)c8 RealFloataa(,)IntegerInt/cyclecycle :: [a] -> [a][]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 -> ax`Floatingaaa/coscos :: Floating a => a -> a׮Floatingaaa/constconst :: a -> b -> a-!abaConstant function. / concatMap concatMap ::  (a -> [b]) -> [a] -> [b]¯a[]b[]a[]b8Map a function over a list and concatenate the results. /concatconcat :: [[a]] -> [a]Z?[][]a[]aConcatenate a list of lists. /comparecompare ::  Ord a => a -> a -> OrderingհOrdaaaOrdering/ceilingceiling :: (RealFrac a, Integral b) => a -> bvORealFracaIntegralbab/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. /breakbreak ::  (a -> Bool) -> [a] ->  ([a], [a])JaBool[]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 agThe 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. /atanhatanh :: Floating a => a -> aFloatingaaa/atan2atan2 :: RealFloat a => a -> a -> a6 RealFloataaaa/atanatan :: Floating a => a -> aFloatingaaa/asTypeOfasTypeOf :: a -> a -> aaaaasTypeOf 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 -> a)Floatingaaa/asinasin :: Floating a => a -> arFloatingaaa/ appendFile appendFile :: FilePath -> String -> IO () FilePathStringIO()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] -> BoolaBool[]aBoolmApplied to a predicate and a list, any determines if any element of the list satisfies the predicate. /andand :: [Bool] -> Bool[]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] -> Bool.aBool[]aBoollApplied to a predicate and a list, all determines if all elements of the list satisfy the predicate. /acoshacosh :: Floating a => a -> aFloatingaaa/acosacos :: Floating a => a -> a^FFloatingaaa/absabs ::  Num a => a -> aNumaaa/^^ (^^) :: (Fractional a, Integral b) => a -> b -> aG FractionalaIntegralbaba$raise a number to an integral power /^ (^) :: (Num a, Integral b) => a -> b -> aNumaIntegralbaba0raise a number to a non-negative integral power />>= (>>=) ::  Monad m => m a ->  (a -> m b) -> m bMonadmmaambmb/>> (>>) ::  Monad m => m a -> m b -> m b1 Monadmmambmb/>= (>=) ::  Ord a => a -> a -> BoolOrdaaaBool/> (>) ::  Ord a => a -> a -> Bool OrdaaaBool/== (==) :: Eq a => a -> a -> BoolzbEqaaaBool/=<< (=<<) ::  Monad m =>  (a -> m b) -> m a -> m b Monadmambmamb?Same as >>=, but with the arguments interchanged. /<= (<=) ::  Ord a => a -> a -> BoolOrdaaaBool/< (<) ::  Ord a => a -> a -> Bool% OrdaaaBool//= (/=) :: Eq a => a -> a -> BoolzEqaaaBool// (/) :: Fractional a => a -> a -> a Fractionalaaaa/. (.) :: (b -> c) -> (a -> b) -> a -> cjbcabacFunction composition. /- (-) ::  Num a => a -> a -> aNumaaaa/++ (++) :: [a] -> [a] -> [a]nP[]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 -> aNumaaaa/** (**) :: Floating a => a -> a -> a Floatingaaaa/* (*) ::  Num a => a -> a -> aqNumaaaa/&& (&&) :: Bool -> Bool -> BoolBoolBoolBoolBoolean "and" /$! ($!) :: (a -> b) -> a -> b_NababDStrict (call-by-value) application, defined in terms of seq. /$ ($) :: (a -> b) -> a -> bababApplication operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:
f $ g $ h x  =  f (g (h x))
It is also useful in higher-order situations, such as map ($ 0) xs, or Data.List.zipWith ($) fs xs. /!! (!!) :: [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. UWeakmodule System.Mem.Weak9KIn 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. LVersionmodule 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. "Utilsmodule Foreign.Marshal.Utils#Utilities for primitive marshaling Unsafemodule System.IO.Unsafe"Unsafe" IO operations. JUniquemodule 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.TypesD3Mapping 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. Tuplemodule Data.Tuple0The tuple data types, and associated functions. I Traversablemodule Data. TraversableVMClass 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. MTracemodule Debug.TraceThe trace function. KTimeoutmodule System.Timeout'<Attach a timeout event to arbitrary IO computations. $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. HStrictmodule Data.STRef.StrictMMutable references in the (strict) ST monad (re-export of Data.STRef) ?Strictmodule Control.Monad.ST.Strict;The strict ST monad (re-export of Control.Monad.ST) FSTRefmodule Data.STRef-Mutable references in the (strict) ST monad. Storablemodule Foreign.Storable}The 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.  StablePtrmodule Foreign. StablePtrxThis module is part of the Foreign Function Interface (FFI) and will usually be imported via the module Foreign. T StableNamemodule System.Mem. StableName\9Stable 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. >STmodule 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. Showmodule Text.ShowWConverting values to readable strings: the Show class and associated functions. 6 SampleVarmodule Control.Concurrent. SampleVarHSample 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. ERatiomodule Data.Ratio:'Standard functions on rational numbers 5QSemNmodule Control.Concurrent.QSemNMQuantity semaphores in which each thread may wait for an arbitrary "amount". 4QSemmodule Control.Concurrent.QSem*Simple quantity semaphores. Ptrmodule Foreign.PtrvThis 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. VPrintfmodule Text.PrintfNA 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/. 'Poolmodule 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.  Ordmodule Data.Ord: Orderings . OldExceptionmodule Control. OldException~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.
Numericmodule Numeric4^Odds and ends, mostly functions for reading and showing RealFloat-like kind of values. 2MVarmodule Control.Concurrent.MVarSynchronising variables BMonoidmodule Data.MonoidThe 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.MonadafThe Functor, Monad and MonadPlus classes, with some useful operations on monads. SMemmodule System.MemMemory-related system things. Maybemodule Data.MaybeE+The Maybe type, and associated operations. (Marshalmodule Foreign.MarshalMarshalling support Listmodule Data.ListOperations on lists.  Lexmodule Text.Read.Lex2.The cut-down Haskell lexer, used by Text.Read GLazymodule Data.STRef.Lazy)Mutable references in the lazy ST monad. @Lazymodule Control.Monad.ST.LazyThis 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. AIxmodule Data.Ix The 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). IORefmodule Data.IORef $Mutable references in the IO monad. -IOmodule System.IO The standard IO library.  Intmodule Data.Int8 Signed integer types 8 Instancesmodule Control.Monad. Instances Functor and Monad instances for (->) r and Functor instances for (,) a and Either a. RInfomodule System.InfoO [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}). NGetOptmodule System.Console.GetOpt This library provides facilities for parsing the command-line options in a standalone program. It is essentially a Haskell port of the GNU getopt library. W Functionsmodule Text.Show. Functions Optional instance of Text.Show.Show for functions:
instance Show (a -> b) where
	showsPrec _ _ = showString \"\<function\>\"
;Functionmodule Data.Function 9Simple combinators working solely on and with functions.  ForeignPtrmodule Foreign. ForeignPtr: The ForeignPtr type and operations. This module is part of the Foreign Function Interface (FFI) and will usually be imported via the Foreign module. )Foreignmodule Foreign  fA collection of data types, classes, and functions for interfacing with another programming language. DFoldablemodule Data.Foldable oClass 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.FixedJ 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.Fix/ Monadic fixpoints. For a detailed discussion, see Levent Erkok's thesis, Value Recursion in Monadic Computations, Oregon Graduate Institute, 2002. QExitmodule System.Exit Exiting the program. , Exceptionmodule Control. ExceptionL ~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.Error Standard IO Errors. !Errormodule Foreign.Marshal.ErrorP yRoutines for testing return values and raising a userError exception in case of values indicating an error state. %Errormodule Foreign.C.Error CC-specific Marshalling support: Handling of C "errno" error codes. Eqmodule Data.Eqm Equality P Environmentmodule System. Environment 8Miscellaneous information about the system environment. Eithermodule Data.Either  ,The Either type, and associated operations. Dynamicmodule Data.Dynamic The 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. 0Datamodule Data.Data h"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, along with instances for many datatypes. It corresponds to a merge between the previous Data.Generics.Basics and almost all of Data.Generics.Instances. The instances that are not present in this module were moved to the Data.Generics.Instances module in the syb package. For more information, please visit the new SYB wiki: http://www.cs.uu.nl/wiki/bin/view/GenericProgramming/SYB. OCPUTimemodule System.CPUTimeT The standard CPUTime library.  Concurrentmodule Foreign. Concurrent IFFI datatypes and operations that use or require concurrency (GHC only). 7 Concurrentmodule Control. Concurrent7 GA common interface to a collection of useful concurrency abstractions. 9Complexmodule Data.Complex Complex 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.Char% )The Char type and associated operations. 3Chanmodule Control.Concurrent.Chan Unbounded channels. 1Categorymodule Control.Category &Cmodule Foreign.C 1Bundles the C specific FFI library functionality Boolmodule Data.Boole ,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. basepackage base Basic 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. +Basemodule Control.Exception.Base 5Extensible exceptions, except for multiple handlers. =Arrowmodule Control.Arrow Basic 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 C Applicativemodule Control. Applicatives" This 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.Alloc3% :Marshalling support: basic routines for memory allocation W, z, m, b, Y, M, B, 7, (, , , + + + + + + + + r+ i+ V+ G+ :+ )+ + + + * * * * * * x* a* O* >* 3* * * * ) ) ) ) ) ) ) }) d) K) 2) ) ( ( ( ( ( ( ( ( p( W( @( 7( *( ( ( ' ' ' ' ' ' ' ' ' i' Y' E' 8' +' ' ' & & & TextShow FunctionsTextPrintfSystemMemWeakSystemMem StableNameSystemMemSystemInfoSystemExitSystem EnvironmentSystemCPUTimeSystemConsoleGetOptDebugTraceDataVersionSystemTimeoutDataUniqueData TraversableDataSTRefStrictDataSTRefLazyDataSTRefDataRatioDataFoldableControl ApplicativeDataMonoidDataIxControlMonadSTLazyControlMonadSTStrictControlMonadSTControlArrowControlMonadFixDataFunctionDataFixedDataComplexControlMonad InstancesControl ConcurrentControl Concurrent SampleVarControl ConcurrentQSemNControl ConcurrentQSemControl ConcurrentChanControl ConcurrentMVarControlCategoryDataDataPreludeControl OldExceptionSystemIOControl ExceptionControl ExceptionBaseSystemPosixTypesForeignForeignMarshalForeignMarshalPoolForeignCForeignCErrorForeignCStringForeignMarshalArrayForeignMarshalUtilsForeignMarshalErrorForeignMarshalAllocForeign ForeignPtrForeignPtrForeign ConcurrentForeignStorableDataDynamicDataIORefTextReadSystemIOErrorDataEitherDataTypeableForeign StablePtrNumericData HashTableDataListDataCharSystemIOUnsafeForeignCTypesDataWordDataIntTextReadLexTextParserCombinatorsReadPrecTextParserCombinatorsReadPDataOrdControlMonadTextShowDataBitsDataMaybeDataEqDataBoolDataStringDataTupleUnsafeCoerce, base4.0.0.07http://haskell.org/ghc/docs/latest/html/libraries/base/2http://haskell.org/ghc/docs/latest/html/libraries/