4      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\ ] ^ _ ` a b c d e fghijklmnopqrstuvwxyz{|}~                    !"#$%&'()*+,-./0123456789 :;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde f ghijklmnopqrstuvwxyz{|}~                    !"#$%&'()*+,-./0123 8Strict (call-by-value) application, defined in terms of . The 2 function establishes a handler that receives any  3# raised in the action protected by .  An 3 is caught by F the most recent handler established by one of the exception handling  functions. These handlers are  not selective: all 3%s are caught. Exception propagation E must be explicitly provided in a handler by re-raising any unwanted  exceptions. For example, in  F 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 4 exception is propagated to the next outer handler. CWhen an exception propagates outside the main program, the Haskell  system prints the associated 3 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.  x y6 is the greatest (positive) integer that divides both x  and y; for example  (-3) 6 = 3,  (-3) (-6) = 3,   0 4 = 4.  0 0 raises a runtime error.  n xs( returns a tuple where first element is xs prefix of  length n2 and second element is the remainder of the list:  1 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 ( n xs,  n xs).  $ is an instance of the more general ,  in which n may be of any integral type.  "#$%&'()*+,-./03456789;<=>?@ABhijklmnopqrs      !"#$%&'()*+,-./012345678=>?@ABCDEFGHIJYZ[\]`abcdghijklmnopqrstuvwxyz{|}~3?@ =AB94> $+#"7865;*dcba -'BA@?>=&DC%"! /IHGFE.0/.-,+*)('&%$#`87465()ZY\[] J t}|{zyu~xwvsrqpok0nmljihg ,    <srqponm1lkjhi32 99  456789:;<=>?@ABCDE FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk \]^_`abcde edcba`_^]\ TUVWX XWVUT h opqrstuvwxyz{|}~h t~}|{zyxwvusrqpoYZZY  5     5     lmnopqrstuvwxyz{|}~lmnopqrstuvwxyz{|}~OPQRSTUVWXYZ[\]^_`abcdefghijk       !"# $%&'()  *+,-./0123 3With a source of random number supply in hand, the   class allows the ;programmer to extract random values of a variety of types. Minimal complete definition: ! and ". !Takes a range (lo,hi) and a random number generator  gA, and returns a random value uniformly distributed in the closed  interval [lo,hi]3, together with a new generator. It is unspecified  what happens if lo>hi/. For continuous types there is no requirement  that the values lo and hi% are ever produced, but they may be, 3 depending on the implementation and the interval. " The same as !4, but using a default range determined by the type: ! For bounded types (instances of " , such as 4), ) the range is normally the whole type. F For fractional types, the range is normally the semi-closed interval  [0,1).  For 8*, the range is (arbitrarily) the range of 7. #Plural variant of ! , producing an infinite list of 5 random values instead of returning a new generator. $Plural variant of " , producing an infinite list of 5 random values instead of returning a new generator. % A variant of !. that uses the global random number generator  (see System.Random#globalrng). & A variant of ". that uses the global random number generator  (see System.Random#globalrng). 'The ' instance of ( has a + of at least 30 bits. The result of repeatedly using )% should be at least as statistically robust as the (Minimal Standard Random Number Generator described by [System.Random#Park, System.Random#Carta]. -Until more is known about implementations of *, all we require is that *3 deliver generators that are (a) not identical and 2(b) independently robust in the sense just given. The 0 and , instances of '% provide a primitive way to save the $state of a random number generator. It is required that  (m g) == g.  In addition, = may be used to map an arbitrary string (not necessarily one  produced by m) onto a value of type '. In general, the ,  instance of ' has the following properties: ) It guarantees to succeed on any string. ? It guarantees to consume only a finite portion of the string. G Different argument strings are likely to result in different results. 4( The class (. provides a common interface to random number  generators. Minimal complete definition: ) and *. )The ) operation returns an 7 that is uniformly distributed  in the range returned by + (including both end points),  and a new generator. *The *; operation allows one to obtain two distinct random number K generators. This is very useful in functional programs (for example, when F passing a random number generator down to recursive calls), but very F little work has been done on statistically robust implementations of  * ([System.Random#Burton, System.Random#Hellekalek] $ are the only examples we know of). +The +2 operation yields the range of values returned by  the generator. It is required that:  If (a,b) = + g, then a < b.  +" always returns a pair of defined 7s. "The second condition ensures that + cannot examine its H argument, and hence the value it returns can be determined only by the  instance of (1. That in turn allows an implementation to make  a single call to + to establish a generator's range, without 6 being concerned that the generator returned by (say) ) might have . a different range to the generator passed to ). /The default definition spans the full range of 7. 56, The function ,5 provides an alternative way of producing an initial generator, by mapping an 7- into a generator. Again, distinct arguments 1should be likely to produce distinct generators. 789:;<=>?@-)Sets the global random number generator. .)Gets the global random number generator. A/Applies *) to the current global random generator, < updates it with one of the results, and returns the other. 0BUses the supplied function to get a value from the current global Jrandom generator, and updates the global generator with the new generator 'returned by the function. For example, rollDice gets a random integer between 1 and 6:  rollDice :: IO Int * rollDice = getStdRandom (randomR (1,6))  !"#$%&'()*+,-./0()*+',0.-/ !"#$%& !"#$%&!"#$%&'()*+)*+,-./0BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ !()2KLMNOPQRSTUVWXYZ[\]^_2_^V QPKWXUTSR!ONML()ZY\[]:;[:;<:;<;:[_`abcdefghijklmno1The 1: function captures a common allocate, compute, deallocate H idiom in which the deallocation step must occur even in the case of an I error during computation. This is similar to try-catch-finally in Java. ?This version handles only IO errors, as defined by Haskell 98.  The version of bracket in Control.Exception handles all exceptions,  and should be used instead. 2 A variant of 1# where the middle computation doesn't want x. ?This version handles only IO errors, as defined by Haskell 98.  The version of bracket_ in Control.Exception handles all exceptions,  and should be used instead. 3The construct 3 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. M<Cfghijklmnopqrstuvwxyz{|}~123123MCwvtuy~gf}|{zx312<132msrqponlkjhi123 4>efef4> 7pqrs1DEFG1DEFGG1DEFGHIJKLMNOPQRS HIKLJMNOPQRSt!"#!$%!"&'()!*+!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#$C#$D#$E#$F#$G#$H#$I#$J#$K#$L#$M#$N#$O#$O#$P#$Q#$R#$S#$T#$U#$V#$W#$WXYZ[\]^__`abcdefghijklmnopqrstuvwx!yz!y{!y|!y}!y~!y!y!y!y!y!y!y!y!y!y!y!y!y!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! ! !!!!!!!!!!!!!!!!!!! !!!"!#!$!%!&!'!(!)!*!+!,!-!.!/!/!01!02!03!04!05!06!07!08!09!0:!0;!0<!0=!0>!0?!0@!0A!0B!0C!0D!0E!0F!0G!0H!0I!0J!0K!0L!MN!MO!MP!MQ!MR!MS!MT!MU!MV!WX!WY!WZ!W[!W\!W]!W^!W_!W`!Wa!Wb!Wc!Wd!We!Wf!Wg!Wh!Wi!Wj!Wk!lm!ln!lo!lp!lq!lr!st!su!sv!sw!sx!sy!sz!s{!s|!s}l~!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!haskell98-2.0.0.0PreludeMonadIxRatioIOArraySystemCPUTimeComplex MarshalErrorListCharNumericMaybe DirectoryLocaleTimeRandomBitsStorableCStringCErrorCForeignCTypes MarshalAlloc MarshalArray MarshalUtilsWordPtr StablePtr ForeignPtrIntbaseGHC.Base++GHC.Errerrorfoldrghc-primGHC.PrimseqGHC.Listconcatfilterzip System.IOprint Data.Tuplefstsnd otherwisemap$GHC.Num fromInteger-GHC.Real fromRationalGHC.EnumenumFrom enumFromThen enumFromToenumFromThenTo GHC.Classes==>=negatefail>>=>>fmapreturn fromIntegral realToFrac toInteger toRational Control.MonadguardliftMBoundedEnumEq GHC.FloatFloating FractionalIntegralFunctorNumOrdGHC.ReadReadReal RealFloatRealFracGHC.ShowShowGHC.Arr MonadPlus GHC.TypesBoolDoubleFloat integer-gmpGHC.Integer.TypeInteger GHC.OrderingOrderingRational Data.EitherEitherStringFalseTrueLeftRightGHC.IO.Handle.TypesHandlerangeindexinRange rangeSizearraybounds listArray!indiceselemsassocs accumArray//accumixmap System.Exit exitFailureexitWithSystem.EnvironmentgetEnv getProgNamegetArgsSystem.CPUTimecpuTimePrecision getCPUTime Data.RatioapproxRational Data.Complexphase magnitudepolarcismkPolar conjugateimagPartrealPart:+hPrinthReadyreadIOreadLn appendFile writeFilereadFileinteract getContentsgetLinegetCharputStrLnputStrputCharGHC.IO.Handle.FDopenFileisEOFstderrstdin GHC.IO.Handle hIsSeekable hGetBuffering hIsWritable hIsReadable hIsClosedhIsOpenhSeekhSetPosnhGetPosn hSetBuffering hLookAheadhIsEOF hFileSizehClose HandlePosnGHC.IO.Handle.Text hPutStrLnhPutStrhPutChar hGetContentshGetLinehGetChar hWaitForInputSystem.IO.ErrorannotateIOErrorioeGetFileName ioeGetHandleioeGetErrorString userErrorTypepermissionErrorTypeillegalOperationErrorType eofErrorType fullErrorTypealreadyInUseErrorTypedoesNotExistErrorTypealreadyExistsErrorType isUserErrorisPermissionErrorisIllegalOperation isEOFError isFullErrorisAlreadyInUseErrorisDoesNotExistErrorisAlreadyExistsError mkIOErrorstdouthFlushGHC.IO.ExceptionioError ExitSuccess ExitFailureExitCode IOErrorType NoBuffering LineBufferingBlockBuffering BufferMode Text.Readreadreadseither Data.Listunwordswordsunlineslinesproductsumfoldl1unfoldrsortBysorttailsinitsgroupBygroupdeleteFirstsByunzip7unzip6unzip5unzip4zipWith7zipWith6zipWith5zipWith4zip7zip6zip5zip4genericReplicate genericIndexgenericSplitAt genericDrop genericTake genericLength minimumBy maximumByminimummaximuminsertByinsert mapAccumR mapAccumL partition transpose intersperse intersectBy intersectunionByunion\\deleteBydeletenubBynub isSuffixOf isPrefixOf findIndices findIndexfind elemIndices elemIndex Data.Char digitToInt GHC.UnicodetoUppertoLower GHC.IO.Device AbsoluteSeek RelativeSeek SeekFromEndSeekModeshowOctshowHex showIntAtBase showGFloat showFFloat showEFloatshowInt readSigned readFloatreadHexreadDecreadOctreadInt GHC.IO.IOModeReadMode WriteMode AppendMode ReadWriteModeIOMode lexDigits readLitChar lexLitCharlex readParenreadList readsPrecText.ParserCombinators.ReadPReadSfromRat floatToDigits showFloatacoshatanhasinhcoshtanhsinhacosatanasincostansinlogBase**logsqrtexppiatan2isIEEEisNegativeZeroisDenormalized isInfiniteisNaN scaleFloat significandexponent encodeFloat decodeFloat floatRange floatDigits floatRadixGHC.IOFilePath userErrorIOErrorlcm^^^oddeven showSigned denominator numerator%divModquotRemmoddivremquotrecip/floorceilingroundtruncateproperFraction undefinedapliftM5liftM4liftM3liftM2unlesswhenfoldM zipWithM_zipWithM mapAndUnzipMjoinmsumfilterMmapM_mapM sequence_sequence=<<mplusmzerosubtractsignumabs*+ intToDigit showLitChar showParen showStringshowCharshowsShowSshowListshow showsPrecunzip3unzipzipWith3zipWithzip3!! concatMaplookupnotElemelemallanyorandreversebreakspandroptake dropWhile takeWhilecycle replicaterepeatiteratescanr1scanrfoldr1scanl1scanlfoldllengthnullinitlasttailhead Data.MaybemapMaybe catMaybes listToMaybe maybeToList fromMaybefromJust isNothingisJustmaybeNothingJustmaxBoundminBoundfromEnumtoEnumpredsuccuncurrycurryasTypeOfuntilflip.constidordchrnot||&&/=minmax<=><compareisAsciiisLatin1 isControlisPrintisSpaceisUpperisLowerisAlphaisDigit isOctDigit isHexDigit isAlphaNumGTEQLTdirectory-1.1.0.1System.DirectorygetModificationTime doesFileExistdoesDirectoryExistsetCurrentDirectorygetCurrentDirectorygetDirectoryContents renameFilerenameDirectory removeFileremoveDirectorycreateDirectoryold-locale-1.0.0.3 System.LocaledefaultTimeLocale time12FmttimeFmtdateFmt dateTimeFmtamPmmonthswDays TimeLocaleold-time-1.0.0.7 System.TimeformatCalendarTimecalendarTimeToString toClockTime toUTCTimetoCalendarTimediffClockTimesaddToClockTime getClockTimeJanuaryFebruaryMarchAprilMayJuneJulyAugust SeptemberOctoberNovemberDecemberMonthSundayMondayTuesday WednesdayThursdayFridaySaturdayDay ClockTimectIsDSTctTZctTZNamectYDayctWDay ctPicosecctSecctMinctHourctDayctMonthctYear CalendarTime tdPicosectdSectdMintdHourtdDaytdMonthtdYearTimeDiffprocess-1.1.0.0System.Processsystem$!catchgcdsplitAt Permissionsreadablewritable executable searchablegetPermissionssetPermissionsrandomRrandomrandomRsrandoms randomRIOrandomIOStdGen RandomGennextsplitgenRangemkStdGen setStdGen getStdGen newStdGen getStdRandombracketbracket_try Data.BitsrotateRrotateLshiftRshiftLisSignedbitSizetestBit complementBitclearBitsetBitbitrotateshift complementxor.|..&.Foreign.Storablepokepeek pokeByteOff peekByteOff pokeElemOff peekElemOff alignmentsizeOfForeign.C.StringwithCWStringLen withCWStringnewCWStringLen newCWStringpeekCWStringLen peekCWStringwithCAStringLen withCAStringnewCAStringLen newCAStringpeekCAStringLen peekCAStringcastCharToCSCharcastCSCharToCharcastCharToCUCharcastCUCharToCharcastCharToCCharcastCCharToCharcharIsRepresentablewithCStringLen withCString newCStringLen newCStringpeekCStringLen peekCString CStringLenCWString CWStringLenForeign.C.ErrorerrnoToIOErrorthrowErrnoPathIfMinus1_throwErrnoPathIfMinus1throwErrnoPathIfNullthrowErrnoPathIf_throwErrnoPathIfthrowErrnoPaththrowErrnoIfNullRetryMayBlockthrowErrnoIfNullRetrythrowErrnoIfNull throwErrnoIfMinus1RetryMayBlock_throwErrnoIfMinus1RetryMayBlockthrowErrnoIfMinus1Retry_throwErrnoIfMinus1RetrythrowErrnoIfMinus1_throwErrnoIfMinus1throwErrnoIfRetryMayBlock_throwErrnoIfRetry_throwErrnoIfRetryMayBlockthrowErrnoIfRetry throwErrnoIf_ throwErrnoIf throwErrno resetErrnogetErrno isValidErrnoeXDEV eWOULDBLOCKeUSERSeTXTBSY eTOOMANYREFS eTIMEDOUTeTIMEeSTALEeSRMNTeSRCHeSPIPEeSOCKTNOSUPPORT eSHUTDOWNeRREMOTE eRPCMISMATCHeROFSeREMOTEeREMCHGeRANGE ePROTOTYPEePROTONOSUPPORTePROTO ePROGUNAVAIL ePROGMISMATCH ePROCUNAVAILePROCLIMePIPE ePFNOSUPPORTePERM eOPNOTSUPPeNXIOeNOTTYeNOTSOCK eNOTEMPTYeNOTDIReNOTCONNeNOTBLKeNOSYSeNOSTReNOSReNOSPC eNOPROTOOPTeNONETeNOMSGeNOMEMeNOLINKeNOLCKeNOEXECeNOENTeNODEVeNODATAeNOBUFSeNFILE eNETUNREACH eNETRESETeNETDOWN eNAMETOOLONG eMULTIHOPeMSGSIZEeMLINKeMFILEeLOOPeISDIReISCONNeIOeINVALeINTR eINPROGRESSeILSEQeIDRM eHOSTUNREACH eHOSTDOWNeFTYPEeFBIGeFAULTeEXISTeDQUOTeDOMeDIRTY eDESTADDRREQeDEADLK eCONNRESET eCONNREFUSED eCONNABORTEDeCOMMeCHILDeBUSYeBADRPCeBADMSGeBADFeALREADYeAGAIN eAFNOSUPPORTeADV eADDRNOTAVAIL eADDRINUSEeACCESe2BIGeOKErrnoForeign.C.TypesCCharCSCharCUCharCShortCUShortCIntCUIntCLongCULongCLLongCULLongCFloatCDoubleCPtrdiffCSizeCWchar CSigAtomicCClockCTime CUSeconds CSUSecondsCFileCFposCJmpBufCIntPtrCUIntPtrCIntMaxCUIntMaxForeign.Marshal.Allocfree reallocBytesreallocallocaBytesAligned allocaBytesalloca mallocBytesmalloc finalizerFreeForeign.Marshal.Array advancePtr lengthArray0 moveArray copyArray withArrayLen0 withArray0 withArrayLen withArray newArray0newArray pokeArray0 pokeArray peekArray0 peekArray reallocArray0 reallocArray allocaArray0 allocaArray mallocArray0 mallocArrayForeign.Marshal.Errorvoid throwIfNull throwIfNeg_ throwIfNegthrowIf_throwIfForeign.Marshal.Utils moveBytes copyByteswithMany maybePeek maybeWithmaybeNewtoBoolfromBoolwithnewgetTime stdFromString mkStdGen32 createStdGenmkStdRNGrandomIvalIntegerrandomIvalDouble int32CountiLogBasestdRangestdNextstdSplit theStdGenGHC.WordWord8Word16Word32Word64GHC.PtrFunPtr Foreign.Ptr intPtrToPtr ptrToIntPtr wordPtrToPtr ptrToWordPtrfreeHaskellFunPtrWordPtrIntPtrcastPtrToFunPtrcastFunPtrToPtr castFunPtr nullFunPtrminusPtralignPtrplusPtrcastPtrnullPtr GHC.Stable newStablePtrcastPtrToStablePtrcastStablePtrToPtrdeRefStablePtr freeStablePtrGHC.ForeignPtrForeign.ForeignPtrunsafeForeignPtrToPtrForeign.ForeignPtr.ImpmallocForeignPtrArray0mallocForeignPtrArraynewForeignPtrEnvwithForeignPtr newForeignPtrfinalizeForeignPtrcastForeignPtrtouchForeignPtrnewForeignPtr_addForeignPtrFinalizerEnvaddForeignPtrFinalizermallocForeignPtrBytesmallocForeignPtr FinalizerPtrFinalizerEnvPtrGHC.IntInt8Int16Int32Int64