Îõ³h)JÇGŠ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ0.7.2.2 Safe-Inferred"%&)*18<ÁÃÌÑ×ÙÚÜãE“èshh1Helper class for variable number of arguments to cd builtin.shhßMimics the shell builtin "cd". Be careful using this function in a program, as it doesn't play well with multiple threads. Best to just use it in an interactive shell or for very simple transliterations of shell scripts.shh-Specify how executables should be referenced.shh7Find executables on PATH, but store their absolute pathshhAlways search on PATHshhõThis type represents a partially built command. Further arguments can be supplied to it, or it can be turned into a Á or directly executed in a context which supports that (such as ).shh"A class for building up a command.shhñA class for things that can be converted to arguments on the command line. The default implementation is to use ‘4 and then encode it using the file system encoding. shhOptions for making processes. shh)Delegate control-c handling to the child.shhClose file descriptors before execing.shhÃType representing a series or pipeline (or both) of shell commands.Proc%'s can communicate to each other via stdin, stdout and stderrã and can communicate to Haskell via their parameterised return type, or by throwing an exception.shh3Type used to represent destinations for redirects.  file is like > file in a shell, and  file is like >> file.shh"Things that can be converted to a ’.ÏThe results must use the file system encoding. Use this if you want to pass a  ByteString to , or if you want to turn a FilePath into a  ByteString.ÈIf you never change the file system encoding, it should be safe to use “ on these functions.shhÿThis class is used to allow most of the operators in Shh to be polymorphic in their return value. This makes using them in an à context easier (we can avoid having to prepend everything with a ).shh>When a process exits with a non-zero exit code we throw this Failure exception.?The only exception to this is when a process is terminated by SIGPIPE+ in a pipeline, in which case we ignore it.!shh7Failure can optionally contain the stderr of a process."shhåThis function needs to be called in order to use the library successfully from GHCi. If you use the  formatPrompt function from the  shh-extras5 package, this will be automatically called for you.#shh8Helper function that creates and potentially executes a $shhLike &> except that it keeps both return results. Be aware that the fst' element of this tuple may be hiding a SIGPIPE9 exception that will explode on you once you look at it.You probably want to use & unless you know you don't.%shhLike $(, but plumbs stderr. See the warning in $.&shhãUse this to send the output of one process into the input of another. This is just like a shell's `|` operator.The result is polymorphic in its output, and can result in either another `Proc a` or an `IO a` depending on the context in which it is used.ÑIf any intermediate process throws an exception, the whole pipeline is canceled.ÕThe result of the last process in the chain is the result returned by the pipeline. echo "Hello" |> wc 1 1 6'shh Similar to &Ë except that it connects stderr to stdin of the next process in the chain.NB: The next command to be &ì on will recapture the stdout of both preceding processes, because they are both going to the same handle!See the ( and ) operators for redirection.echo "Ignored" |!> wc "-c"Ignored0(shh3Redirect stdout of this process to another location&echo "Ignore me" &> Append "/dev/null")shh3Redirect stderr of this process to another locationecho "Shh" &!> StdOutShh*shhLift a Haskell function into a . The handles are the stdin stdout and stderr of the resulting +shhFlipped version of & with lower precedence.(captureTrim <| (echo "Hello" |> wc "-c")"6",shhòCreate a pipe, and close both ends on exception. The first argument is the read end, the second is the write end.=withPipe $ \r w -> hPutStr w "test" >> hClose w >> hGetLine r"test"-shhSimple ! that writes its argument to its stdout,. This behaves very much like the standard printfÑ utility, except that there is no restriction as to what can be in the argument.NB: String& arguments are encoded as UTF8, while  ByteString/ is passed through. Be aware if you are using OverloadedStringsî that you will get wrong results if using unicode in your string literal and it inferes anything other than String.writeOutput "Hello"Hello.shhSimple ! that writes its argument to its stderr . See also -.writeError "Hello" &> devNullHello/shhSimple ï that reads its input, and can react to it with an IO action. Does not write anything to its output. See also >./Á uses lazy IO to read its stdin, and works with infinite inputs.2yes |> readInput (pure . unlines . take 3 . lines) "y\ny\ny\n"0shhJoin a list of  ByteString:s with newline characters, terminating it with a newline.1shhLike /, but c s the string.*yes |> readInputEndBy "\n" (pure . take 3) ["y","y","y"]2shhLike /, but cs the string on the 0 byte..writeOutput "1\0\&2\0" |> readInputEndBy0 pure ["1","2"]3shhLike /, but cs the string on new lines.+writeOutput "a\nb\n" |> readInputLines pure ["a","b"]4shhCreates a pure  that simple transforms the stdin and writes it to stdout. The input can be infinite.&yes |> pureProc (BS.take 4) |> capture"y\ny\n"5shhÓCaptures the stdout of a process and prefixes all the lines with the given string.Ësome_command |> prefixLines "stdout: " |!> prefixLines "stderr: " &> StdErrstdout: this is stdoutstderr: this is stderr6shhProvide the stdin of a  from a ”Same as - s |> p7shhRun a process and capture its output lazily. Once the continuation is completed, the handles are closed. However, the process is run until it naturally terminates in order to capture the correct exit code. Most utilities behave correctly with this (e.g. cat* will terminate if you close the handle).Same as p |> readInput f8shh Shortcut for  "/dev/null"echo "Hello" &> devNull9shhRuns a  in . Like  , but you get to choose the handles. This is UNSAFE to expose externally, because there are restrictions on what the Handle can be. Within shh, we never call 9; with invalid handles, so we ignore that corner case (see r).:shh Create a ü from a command and a list of arguments. The boolean represents whether we should delegate control-c or not. Most uses of :" in Shh do not delegate control-c.;shh4Default ProcOptions as used by most of this library.<shh Create a  with custom options.=shh Create a Ï from a command and a list of arguments. Does not delegate control-c handling.>shh A special / which captures its stdin and presents it as a ” to Haskell.#printf "Hello" |> md5sum |> capture'"8b1a9953c4611296a827abf8c47804d7 -\n" This is just / pure6. Note that it is not lazy, and will read the entire  ByteString into memory.?shhLike >, except that it J$s leading and trailing white space.'printf "Hello" |> md5sum |> captureTrim%"8b1a9953c4611296a827abf8c47804d7 -"@shhLike >4, but splits the input using the provided separator.9NB: This is strict. If you want a streaming version, use /AshhSame as @ "\0".BshhSame as  captureSplit "\n".Cshh(Capture stdout, splitting it into words.DshhCapture stdout, and attempt to • itEshhApply a  to a ”'. That is, feed the bytestring to the stdin of the process and read the stdout. > apply md5sum "Hello"&"8b1a9953c4611296a827abf8c47804d7 -n"FshhFlipped, infix version of 6GshhInfix version of 6HshhWait on a given –", and throw an exception of type 0 if its exit code is non-zero (ignoring SIGPIPE)Ishh Drop trailing characters from a  ByteString$ while the given predicate matches. dropWhileEnd isSpace "a line \n""a line"Jshh$Trim leading and tailing whitespace.trim " a string \n" "a string"KshhRun a  action, catching any  exceptions and returning them.LshhLike KŒ except that it takes an exception predicate which selects which exceptions to catch. Any exception not matching the predicate (returning Nothing) is re-thrown.MshhRun a 2 with an action to take if an exception is thrown.NshhLike N except that it takes an exception predicate which selects which exceptions to catch. Any exceptions not matching the predicate (returning Nothing) are re-thrown.Oshh×Apply a function that translates non-0 exit codes to results. Any code that returns a Nothing will be thrown as a .Pshh=Apply a function to non-0 exit codes to extract a result. If Nothing is produced, the  is thrown.Qshh5Capture the stderr of the proc, and attach it to any  exceptions that are thrown. The stderr is also forwarded to downstream processes, or the inherited stderr handle. Note that capturing stderr inherently requires that the stderr is accumulated in memory, so be careful about processes that dump a lot of information.RshhRun a  action, ignoring any × exceptions. This can be used to prevent a process from interrupting a whole pipeline. false |> (sleep "0.1" >> echo 1)Ð*** Exception: Command `false` failed [exit 1] at CallStack (from HasCallStack):...0(ignoreFailure false) |> (sleep "0.1" >> echo 1)1SshhRun a Ñ action returning the exit code of the process instead of throwing an exception.exitCode false1TshhRun the é, but don't throw an exception if it exits with the given code. Note, that from this point on, if the proc did fail with the code, everything else now sees it as having exited with 0. If you need to know the code, you have to use S.UshhThis function turns a  into a list of ”s.%displayCommand $ echo "Hello, world!"["echo","Hello, world!"]Vshh$Get all executables on your `$PATH`.Wshh¨Get all uniquely named executables on your `$PATH` as absolute file names. The uniqueness is determined by the filename, and not the whole path. First one found wins.XshhèGet all uniquely named executables from the list of directories. Returns a list of absolute file names.Yshh>Execute the given command. Further arguments can be passed in.  exe "ls" "-l" See also Z and ^.˜NB: It is recommended that you use the template haskell functions to load executables from your path. If you do it manually, it is recommended to use withFrozenCallStack from  GHC.Stack 3echo :: Cmd echo = withFrozenCallStack (exe "echo")Zshh*Create a function for the executable named[shh‡Template Haskell function to create a function from a path that will be called. This does not check for executability at compile time.\shh"$(loadExeAs ref fnName executable) defines a function called fnName which executes the path in  executable. If  executable‹ is an absolute path it is used directly. If it is just an executable name, then it is searched for in the PATH environment variable. If ref is  SearchPathÍ, the short name is retained, and your PATH will be searched at runtime. If ref is AbsoluteÙ, a executable name will be turned into an absolute path, which will be used at runtime.]shh»Takes a string, and makes a Haskell identifier out of it. If the string is a path, the filename portion is used. The exact transformation is that alphanumeric characters are unchanged, - becomes _, and '* is used to escape all other characters. _ becomes '_, . becomes ''Á and anthing else is becomes a hex encoded number surrounded by ' characters.Justification for changing - to _ is that -5 appears far more commonly in executable names than _6 does, and so we give it the more ergonomic encoding.encodeIdentifier "nix-shell" "nix_shell"encodeIdentifier "R""_R"/encodeIdentifier "x86_64-unknown-linux-gnu-gcc""x86'_64_unknown_linux_gnu_gcc"encodeIdentifier "release.sh" "release''sh"^shh«Scans your '$PATH' environment variable and creates a function for each executable found. Binaries that would not create valid Haskell identifiers are encoded using the ] function._shhÊTest to see if an executable can be found either on the $PATH or absolute.`shhãLoad the given executables into the program, checking their executability and creating a function missingExecutables9 to do a runtime check for their availability. Uses the ]$ function to create function names.ashhSame as `., but allows you to modify the function names.bshhLike ^Æ, but allows you to modify the function name that would be generated.cshh¶Split a string separated by the provided separator. A trailing separator is ignored, and does not produce an empty string. Compatible with the output of most CLI programs, such as  find -print0.endBy "\n" "a\nb\n" ["a","b"]endBy "\n" "a\nb" ["a","b"]endBy "\n" "a\nb\n\n" ["a","b",""]dshh+Load executables from the given directorieseshh:Load executables from the given directories appended with "/bin".Useful for use with Nix.fshhÚLoad executables from the given dirs, applying the given transformation to the filenames.gshhÐFunction that splits '0' separated list of strings. Useful in conjunction with find . "-print0".hshhMimics the shell builtin "cd".ishh xargs1 n f runs f) for each item in the input separated by n. Similar to the standard xargs• utility, but you get to choose the separator, and it only does one argument per command. Compare the following two lines, which do the same thing.4printf "a\\0b" |> xargs "--null" "-L1" "echo" |> catab)printf "a\\0b" |> xargs1 "\0" echo |> catab-One benefit of this method over the standard xargs/ is that we can run Haskell functions as well.8yes |> head "-n" 5 |> xargs1 "\n" (const $ pure $ Sum 1)Sum {getSum = 5}jshhSimple Ä that reads its input and can react to the output by calling other :'s which can write something to its stdout. The internal  is given devnull as its input.kshhLike j, but splits the input.lshhLike j", but splits the input on 0 bytes.mshhLike j$, but splits the input on new lines.nshhCreate a null file handle.oshh Bracket a rpshhBracket three rsqshh Bracket two r"s and provide a null input handle.rshh Duplicate a —0 without trying to flush buffers. Only works on ˜s.€hDuplicate tries to "flush" read buffers by seeking backwards, which doesn't work for streams/pipes. Since we are simulating a  fork + exec in *ñ, losing the buffers is actually the expected behaviour. (System.Process doesn't attempt to flush the buffers).µNB: An alternate solution that we could implement (even for System.Process forks) is to create a fresh pipe and spawn an async task to forward buffered content from the original handle if there is something in the buffer. My concern would be that it might be a performance hit that people aren't expecting.Code basically copied from  ×http://hackage.haskell.org/package/base-4.12.0.0/docs/src/GHC.IO.Handle.html#hDuplicate with minor modifications.sshh(Helper function for duplicating a Handletshh(Helper function for duplicating a Handle}shhThe ™ instance for Ö pipes the stdout of one process into the stdin of the next. However, consider using &( instead which behaves when used in an  context. If you use š' in an IO monad you will be using the 9 instance of semigroup which is a sequential execution. & prevents that error.†shhThe [Char]/String1 instance encodes using the file system encoding.‡shhThe Char and String1 instances encode using the file system encoding.Šshh'Commands can be executed directly in IOõ  ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstõ"! #$%&'()*+,-./0123456789:  ;<=>?@ABCDEFGHIJKLMNOPQRST UVWXYZ[\]^_`abcdefghijklmnopqrst&1'1(9 )9 +1 Safe-Inferred)*ÁÃFÊÝ"Y=< ;:4-.5/123jklmi>?@ABC&'$%()+8GF6EJcg !RTKLMNQSPO U]`^deabfZ\VWÝ"Y=< ; :4-.5/123jklmi>?@ABC&'$%()+8GF6EJcg !RTKLMNQSPO U]`^deabfZ\VW›      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜–™š–›œžŸ– ¡¢£¤–¥¦–¥§–¨©–¨ª«shh-0.7.2.2-inplace Shh.Internalshh System.IOopenFileShhCdcd ExecReferenceAbsolute SearchPathCmdCommandtoArgsExecArgasArg asArgFromList ProcOptions delegateCtlccloseFdsProcStreamStdOutStdErrTruncateAppend ToFilePath toFilePath fromFilePathShellrunProcFailure failureProg failureArgs failureStack failureCode failureStdErrinitInteractive buildProcpipepipeErr|>|!>&>&!> nativeProc<|withPipe writeOutput writeError readInputunlinesreadInputEndByreadInputEndBy0readInputLinespureProc prefixLines writeProcwithReaddevNullrunProc'mkProc'defaultProcOptions mkProcWithmkProccapture captureTrim captureEndBy captureEndBy0 captureLines captureWords captureReadapply>>><<<waitProc dropWhileEndtrim tryFailuretryFailureJust catchFailurecatchFailureJusttranslateCode' translateCodefailWithStdErr ignoreFailureexitCode ignoreCodedisplayCommandpathBins pathBinsAbs findBinsInexeloadExerawExe loadExeAsencodeIdentifierloadEnvcheckExecutableload loadAnnotatedloadAnnotatedEnvendBy loadFromDirs loadFromBinsloadAnnotatedFromDirsendBy0cd'xargs1 readInputPreadInputEndByPreadInputEndBy0PreadInputLinesP withNullInput withDuplicatewithDuplicateswithDuplicateNullInputhDup dupHandleShh dupHandleShh_$fExceptionFailure $fShowFailure$fToFilePathByteString$fToFilePathByteString0$fToFilePath[] $fMonadProc$fApplicativeProc $fMonoidProc$fSemigroupProc $fMonadIOProc $fShellProc $fShellIO $fExecArgWord$fExecArgInteger $fExecArgInt$fExecArgByteString$fExecArgByteString0 $fExecArg[] $fExecArgChar $fCommand[] $fCommand[]0 $fCommandIO $fCommandFUN $fCommandProc$fCdFUN$fCdio $fFunctorProcghc-prim GHC.TypesIObaseGHC.ShowshowGHC.IOFilePath GHC.IO.UnsafeunsafePerformIObytestring-0.11.3.1Data.ByteString.Lazy.Internal ByteString Text.Readreadprocess-1.6.16.0System.Process.Common ProcessHandleGHC.IO.Handle.TypesHandle FileHandleGHC.Base Semigroup<>