6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRST U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   Safe-Inferred Safe-Inferred-Show a number to a number of decimal places.  showDP 4 pi == "3.1416"  showDP 0 pi == "3"  showDP 2 3 == "3.00"  Specialised numeric conversion.  Specialised numeric conversion.  Specialised numeric conversion.  Specialised numeric conversion. None .A type alias for seconds, which are stored as . Sleep for a number of seconds. 5 fmap (round . fst) (duration $ sleep 1) == return 1 7Calculate the difference between two times in seconds. ? Usually the first time will be the end of an event, and the & second time will be the beginning. ( \a b -> a > b ==> subtractTime a b > 0 JShow a number of seconds, typically a duration, in a suitable manner with % responable precision for a human. ! showDuration 3.435 == "3.44s" " showDuration 623.8 == "10m24s" " showDuration 62003.8 == "17h13m" % showDuration 1e8 == "27777h47m" QCall once to start, then call repeatedly to get the elapsed time since the first J call. Values will usually increase, unless the system clock is updated # (if you need the guarantee, see ). Like C, but results will never decrease (though they may stay the same). K do f <- offsetTimeIncrease; xs <- replicateM 10 f; return $ xs == sort xs 'Record how long a computation takes in  .      Safe-Inferred&Update the first component of a pair. 'Update the second component of a pair. (Update the first component of a triple. )Update the second component of a triple. (Update the third component of a triple.      Safe-Inferred"@Apply some operation repeatedly, producing an element of output " and the remainder of the list. 4 \xs -> repeatedly (splitAt 3) xs == chunksOf 3 xs / \xs -> repeatedly word1 (trim xs) == words xs #Flipped version of .  for [1,2,3] (+1) == [2,3,4] $4Are two lists disjoint, with no elements in common.  disjoint [1,2,3] [4,5] == True ! disjoint [1,2,3] [4,1] == False %2Is there any element which occurs more than once.  anySame [1,1,2] == True  anySame [1,2,3] == False &Are all elements the same.  allSame [1,1,2] == False  allSame [1,1,1] == True  allSame [1] == True  allSame [] == True 4Documentation about lowercase , lower "This is A TEST" == "this is a test"  lower "" == "" @Break, but from the end. + breakEnd isLower "youRE" === ("you","RE") + breakEnd isLower "youre" === ("youre","") + breakEnd isLower "YOURE" === ("","YOURE") ASpan, but from the end. ) spanEnd isUpper "youRE" == ("you","RE") 1 spanEnd (not . isSpace) "x y z" == ("x y ","z") C \f xs-> spanEnd f xs == swap (both reverse (span f (reverse xs))) FFind the first instance of needle in haystack. ) The first element of the returned tuple  is the prefix of haystack before needle is matched. The second  is the remainder of haystack, starting with the match.  Examples:  + breakOn "::" "a::b::c" == ("a", "::b::c") * breakOn "/" "foobar" == ("foobar", "") Laws: a \needle haystack -> let (prefix,match) = breakOn needle haystack in prefix ++ match == haystack G Similar to F#, but searches from the end of the  string. 9The first element of the returned tuple is the prefix of haystack ' up to and including the last match of needle. The second is the  remainder of haystack, following the match. . breakOnEnd "::" "a::b::c" == ("a::b::", "c") H0Break a list into pieces separated by the first ? list argument, consuming the delimiter. An empty delimiter is 0 invalid, and will cause an error to be raised.  Examples:  8 splitOn "\r\n" "a\r\nb\r\nd\r\ne" == ["a","b","d","e"] : splitOn "aaa" "aaaXaaaXaaaXaaa" == ["","X","X","X",""] . splitOn "x" "x" == ["",""] + splitOn "x" "" == [""] and 6 \s x -> s /= "" ==> intercalate s (splitOn s x) == x B \c x -> splitOn [c] x == split (==c) x I7Splits a list into components delimited by separators, @ where the predicate returns True for a separator element. The C resulting components do not contain the separators. Two adjacent = separators result in an empty component in the output. eg. 0 split (=='a') "aabbaca" == ["","","bb","c",""] ! split (=='a') "" == [""] J A version of !+ but with different strictness properties. D Often outperforms if the list is short or the test is expensive. K5Return the prefix of the second string if its suffix " matches the entire first string.  Examples: * stripSuffix "bar" "foobar" == Just "foo" * stripSuffix "" "baz" == Just "baz" ' stripSuffix "foo" "quux" == Nothing LESplit a list into chunks of a given size. The last chunk may contain ; fewer than n elements. The chunk size must be positive. + chunksOf 3 "my test" == ["my ","tes","t"] ' chunksOf 3 "mytest" == ["myt","est"]  chunksOf 8 "" == []  chunksOf 0 "test" == error +"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL      !"#$!%&'("#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL,4531267E'()*+;<:98"#$&%-,@A!J0K./=>?BCDFGHIL+"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL Safe-InferredM#Evaluates the value before calling ) N#Evaluates the value before calling   MN *)+, -. /MN M NMN Safe-InferredOThe O( function extracts the element out of a 0 and & throws an error if its argument is 1.  Much like fromJust>, using this function in polished code is usually a bad idea. PThe P( function extracts the element out of a 1 and & throws an error if its argument is 0.  Much like fromJust>, using this function in polished code is usually a bad idea. SPull the value out of an 2 where both alternatives  have the same type. OPQRS 2013456OPQRSQROPSOPQRS  Safe-InferredTPerform some operation on 7, given the field inside the 7. & whenJust Nothing print == return () $ whenJust (Just 1) print == print 1 U>The identity function which requires the inner argument to be '()'. Useful for functions ! with overloaded return times. ! \(x :: Maybe ()) -> unit x == x V A version of  partition& that works with a monadic predicate. 7 partitionM (Just . even) [1,2,3] == Just ([2], [1,3]) / partitionM (const Nothing) [1,2,3] == Nothing W A version of & that works with a monadic predicate. X A version of 8& that works with a monadic predicate. Y1A looping operation, where the predicate returns 0 as a seed for the next loop  or 1 to abort the loop. Z+Keep running an operation until it becomes 9. TUVWXYZ[\]^_`abcdef<:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abTUVWXYZ[\]^_`abcdefTUVWXYZ[\]^_`cdabefTUVWXYZ[\]^_`abcdef  Safe-InferredgSRemember that the current directory is a global variable, so calling this function S multithreaded is almost certain to go wrong. Avoid changing the dir if you can. h>Find all the files within a directory, including recursively. = Looks through all folders, including those beginning with .. iOCreate a directory with permissions so that only the current user can view it. - On Windows this function is equivalent to c. ghi&defghijklmnopqrstuvwxyz{|}~cghighighi  Safe-Inferred j[Fully evaluate an input String. If the String contains embedded exceptions it will produce < Exception>. N stringException ("test" ++ undefined) == return "test<Exception>" N stringException ("test" ++ undefined ++ "hello") == return "test<Exception>" C stringException "test" == return "test" k=Show a value, but if the result contains exceptions, produce  < Exception> . Defined as j . show. U Particularly useful for printing exceptions to users, remembering that exceptions , can themselves contain undefined values. l,Ignore any exceptions thrown by the action.  ignore (print 1) == print 1 " ignore (fail "die") == return () m9Retry an operation at most N times (N must be positive). # retry 1 (print "x") == print "x" $ retry 3 (fail "die") == fail "die" n A version of  without the  context, restricted to ,  so catches all exceptions. oLike n but for  pLike n but for  qLike n but for  rLike n but for  sLike n but for  t_Catch an exception if the predicate passes, then call the handler with the original exception.  As an example:  = readFileExists x == catchBool isDoesNotExistError (readFile "myfile") (const $ return "") uLike t but for . vLike t but for . jklmnopqrstuv\jklmnopqrstuv mkjlnproqstuvjklmnopqrstuv Nonewxwxwxwx None Capture the  and  of a computation. . captureOutput (print 1) == return ("1\n",()) yz{|}~z      !"#$%&'()*+,-./0123456789:;<=>?@ABCDyz{|}~yz{|}~yz{|}~None%EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef Safe-Inferred>Starts out empty, then is filled exactly once. As an example:    bar <-   forkIO $ do ...; val <- ...;  bar val  print =<< waitBarrier bar AHere we create a barrier which will contain some computed value. G A thread is forked to fill the barrier, while the main thread waits I for it to complete. A barrier has similarities to a future or promise J from other languages, has been known as an IVar in other Haskell work, 6 and in some ways is like a manually managed thunk. 'Like an MVar, but must always be full. 7 Used to on a mutable variable in a thread-safe way.  As an example:    hits <-  0  forkIO $ do ...;  hits (+1); ...  i <-  hits  print (HITS,i) IHere we have a variable which we modify atomically, so modifications are I not interleaved. This use of MVar never blocks on a put. No modifyVar P operation should ever block, and they should always complete in a reasonable O timeframe. A Var should not be used to protect some external resource, only X the variable contained within. Information from a readVar should not be subsequently  inserted back into the Var.  Like an MVar, but has no value. R Used to guarantees single-threaded access, typically to some system resource.  As an example:    lock <-   let output =  . putStrLn  forkIO $ do ...; output "hello"  forkIO $ do ...; output "world" LHere we are creating a lock to ensure that when writing output our messages V do not get interleaved. This use of MVar never blocks on a put. It is permissible, H but rare, that a withLock contains a withLock inside it - but if so,  watch out for deadlocks. On GHC 7.6 and above with the  -threaded flag, brackets a call to . ! On lower versions (which lack /) this function just runs the argument action.  Create a . %Perform some operation while holding . Will prevent all other  operations from using the  while the action is ongoing. Like ; but will never block. If the operation cannot be executed  immediately it will return g.  Create a new  with a value. Read the current value of the .  Modify a , producing a new value and a return result.  Modify a , a restricted version of . .Perform some operation using the value in the ,  a restricted version of .  Create a new . 4Write a value into the Barrier, releasing anyone at . ) Any subsequent attempts to signal the  will be silently ignored. ,Wait until a barrier has been signaled with .  A version of  that never blocks, returning g - if the barrier has not yet been signaled. hijRklmnopqrstuvwxyz{|}~hijNone  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~mkjlnproqstuvTUVWXYZ[\]^_`cdabefQROPS M N4531267E'()*+;<:98"#$&%-,@A!J0K./=>?BCDFGHIL ghiwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q r s t u v w x y z { | } ~  7777 7 7 7 7 7777777777777777777 7!7"7#7$7%7&7'7(7)7*7+7,7-7.7/707172737475767778797:7;7<7=7>7?7@7A7B7C7D7E7F7G7HIJIKILIMNOPQRQSQTQUQVQWQXYZY[\]^_`abcbdefbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzb{b|b}b~bbbbbbbb                   !"#"$"%"&'()*+,-./0 1 2 3 4565758595:5;5<5=5>5?5@5ABCDE F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^_`_a_b_c_d_e_f_g_h_i_jklmklnkloklpklqklrklskltkluklvklwklxklyklzklzkl{kl|kl}k~k~k~k~k~k~k~k~k~k~k~k~k~k~k~k~Y extra-0.3.1System.Environment.Extra Numeric.ExtraControl.Concurrent.ExtraData.IORef.ExtraSystem.Time.ExtraData.Tuple.ExtraData.List.ExtraData.Either.ExtraControl.Monad.ExtraSystem.Directory.ExtraControl.Exception.ExtraSystem.Info.ExtraSystem.IO.ExtraSystem.Process.ExtraExtrabase!System.Environment.ExecutablePathgetExecutablePathSystem.Environment lookupEnvshowDP intToDouble intToFloat floatToDouble doubleToFloat GHC.Conc.SyncsetNumCapabilitiesControl.Concurrent forkFinally Data.IORef modifyIORef'atomicWriteIORefatomicModifyIORef'Secondssleep subtractTime showDuration offsetTimeoffsetTimeIncreasedurationfirstsecond***&&&dupebothfst3snd3thd3first3second3third3dupe3both3 Data.List dropWhileEnd repeatedlyfordisjointanySameallSamelistunconsunsnocconssnoctakeEnddropEnd concatUnzip concatUnzip3 takeWhileEnd trimStarttrimEndtrimlowerupper dropAroundword1sortOngroupOnnubOn groupSort groupSortOnmergemergeByreplacebreakEndspanEndwordsBylinesBy firstJustdrop1breakOn breakOnEndsplitOnsplit dropWhileEnd' stripSuffixchunksOf writeIORef'atomicWriteIORef'fromLeft fromRightisLeftisRight fromEitherwhenJustunit partitionM concatMapM mapMaybeMloopMwhileMwhenMunlessMifMnotM||^&&^anyMallMorMandMfindM firstJustMwithCurrentDirectorygetDirectoryContentsRecursivecreateDirectoryPrivatestringException showExceptionignoreretrycatch_ catchJust_handle_ handleJust_try_tryJust_ catchBool handleBooltryBool isWindowsgetProcessorCountreadFileEncoding readFileUTF8readFileBinary readFile'readFileEncoding' readFileUTF8'readFileBinary'writeFileEncoding writeFileUTF8writeFileBinary captureOutput withBuffering newTempFile withTempFile newTempDir withTempDir systemOutputsystem_ systemOutput_BarrierVarLockwithNumCapabilitiesnewLockwithLock withLockTrynewVarreadVar modifyVar modifyVar_withVar newBarrier signalBarrier waitBarrierwaitBarrierMaybe withProgNamewithArgs getProgNamegetEnvironmentgetEnvgetArgs GHC.Float showFloatfromRat floatToDigitsGHC.Real showSignedNumericshowOct showIntAtBaseshowIntshowHex showGFloat showFFloat showEFloat readSignedreadOctreadIntreadHex readFloatreadDecGHC.Read lexDigitsghc-prim GHC.TypesDouble Data.TuplefstsnduncurrycurryswapGHC.Basemap++foldrGHC.ListconcatfilterzipzipWith3zipWithzip3unzip3unzip takeWhiletaketailsplitAtspanscanr1scanrscanl1scanlreverse replicaterepeatornullnotElemlookuplengthlastiterateinitheadfoldr1foldlelem dropWhiledropcycle concatMapbreakanyandall!!wordsunwordsunlinessumproductminimummaximumlinesfoldl1zipWith7zipWith6zipWith5zipWith4zip7zip6zip5zip4unzip7unzip6unzip5unzip4unionByunionunfoldr transposetails subsequences stripPrefixsortBysort permutations partitionnubBynub minimumBy maximumBy mapAccumR mapAccumL isSuffixOf isPrefixOf isInfixOf intersperse intersectBy intersect intercalateinsertByinsertinitsgroupBygroup genericTakegenericSplitAtgenericReplicate genericLength genericIndex genericDropfoldl1'foldl' findIndices findIndexfind elemIndices elemIndexdeleteFirstsBydeleteBydelete\\ GHC.IORef writeIORefIORef readIORefnewIORef modifyIORef mkWeakIORefatomicModifyIORef Data.EitherLeftRightEithereitherrightspartitionEitherslefts Data.MaybeJustmapMaybeFalsefail>>=>>fmapreturn Control.MonadguardliftMMonadFunctor MonadPlus sequence_sequencemapM_mapM=<<mzeromplus zipWithM_zipWithMwhenvoidunless replicateM_ replicateMmsummfilter mapAndUnzipMliftM5liftM4liftM3liftM2joinforeverforM_forMfoldM_foldMfilterMap>=><=<directory-1.2.0.1System.DirectorycreateDirectorywritable searchablereadable executable PermissionssetPermissionssetOwnerWritablesetOwnerSearchablesetOwnerReadablesetOwnerExecutablesetCurrentDirectory renameFilerenameDirectory removeFileremoveDirectoryRecursiveremoveDirectorymakeRelativeToCurrentDirectorygetUserDocumentsDirectorygetTemporaryDirectorygetPermissionsgetModificationTimegetHomeDirectorygetDirectoryContentsgetCurrentDirectorygetAppUserDataDirectoryfindFilefindExecutableemptyPermissions doesFileExistdoesDirectoryExistcreateDirectoryIfMissingcopyPermissionscopyFilecanonicalizePathControl.Exception.Basecatch GHC.Exception Exception SomeException catchJusthandle handleJusttrytryJustboolassertGHC.IO.ExceptionioError toException fromExceptionGHC.IOUnmaskedMaskedUninterruptibleMaskedInterruptible MaskingStateuninterruptibleMask_uninterruptibleMaskunblockthrowIOmask_maskgetMaskingStateevaluateblockedblockthrowTo IOExceptionDeadlockBlockedIndefinitelyOnSTMBlockedIndefinitelyOnMVar UserInterrupt ThreadKilled StackOverflow HeapOverflowAsyncExceptionAssertionFailedUndefinedElementIndexOutOfBoundsArrayException ErrorCall UnderflowRatioZeroDenominatorOverflowLossOfPrecision DivideByZeroDenormalArithException RecUpdError RecSelError RecConErrorPatternMatchFailNonTermination NoMethodErrorNestedAtomicallyControl.ExceptionHandlerthrow onException mapExceptionfinallybracket_bracketOnErrorbracketcatchesallowInterruptgetNumberOfProcessors System.InfooscompilerVersion compilerNamearchGHC.IO.Handle.FDstdoutstderr System.IOprintIOFilePath writeFilereadLnreadIOreadFileputStrLnputStrputCharinteractgetLine getContentsgetChar appendFileGHC.IO.Handle.TypesHandleGHC.IO.Encoding.Types TextEncoding GHC.IO.IOMode WriteMode ReadWriteModeReadMode AppendModeIOModeoutputNLinputNL NewlineModeLFCRLFNewline NoBuffering LineBufferingBlockBuffering BufferMode GHC.IO.Handle HandlePosn GHC.IO.Device SeekFromEnd RelativeSeek AbsoluteSeekSeekModewithFilewithBinaryFile"openTempFileWithDefaultPermissions openTempFile(openBinaryTempFileWithDefaultPermissionsopenBinaryTempFilelocaleEncodinghReadyhPrintfixIOuniversalNewlineModenoNewlineTranslationnativeNewlineMode nativeNewlineGHC.IO.Handle.Text hWaitForInput hPutStrLnhPutStrhPutCharhPutBufNonBlockinghPutBufhGetLine hGetContentshGetChar hGetBufSomehGetBufNonBlockinghGetBufstdinopenFileopenBinaryFileisEOFhTellhShowhSetPosnhSetNewlineMode hSetFileSize hSetEncodinghSetEcho hSetBufferinghSetBinaryModehSeek hLookAhead hIsWritablehIsTerminalDevice hIsSeekable hIsReadablehIsOpenhIsEOF hIsClosedhGetPosn hGetEncodinghGetEcho hGetBufferinghFlush hFileSizehCloseGHC.IO.Encodingutf8_bomutf8utf32leutf32beutf32utf16leutf16beutf16mkTextEncodinglatin1char8process-1.1.0.2System.Process.Internals UseHandleInherit CreatePipe StdStream ProcessHandlestd_outstd_instd_errenvcwd create_groupcmdspec close_fds CreateProcess ShellCommand RawCommandCmdSpecSystem.ProcesswaitForProcessterminateProcesssystemshowCommandForUsershell runProcessrunInteractiveProcessrunInteractiveCommand runCommandreadProcessWithExitCode readProcess rawSystemprocinterruptProcessGroupOfgetProcessExitCode createProcessNothingGHC.MVarMVarThreadIdControl.Concurrent.SampleVar SampleVarControl.Concurrent.QSemNQSemNControl.Concurrent.QSemQSemControl.Concurrent.ChanChan tryTakeMVar tryPutMVartakeMVarputMVarnewMVar newEmptyMVar isEmptyMVaryieldthreadCapability myThreadIdmkWeakThreadId killThreadgetNumCapabilitiesforkOnWithUnmaskforkOnforkIOWithUnmaskforkIOUnmaskedforkIO GHC.Conc.IO threadDelaywriteSampleVar readSampleVar newSampleVarnewEmptySampleVarisEmptySampleVaremptySampleVar waitQSemN signalQSemNnewQSemNwaitQSem signalQSemnewQSemControl.Concurrent.MVarwithMVarswapMVarreadMVar modifyMVar_modifyMVarMasked_modifyMVarMasked modifyMVar mkWeakMVaraddMVarFinalizerwriteList2Chan writeChan unGetChanreadChannewChan isEmptyChangetChanContentsdupChanthreadWaitWritethreadWaitReadrunInUnboundThreadrunInBoundThreadrtsSupportsBoundThreadsnmergeIOmergeIOisCurrentThreadBoundforkOS