!      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ SafeNone2M,Zturtle+A line of text (does not contain newlines).[turtleThe [* exception is thrown when you construct a Z3 using an overloaded string literal or by calling  explicitly and the supplied string contains newlines. This is a programming error to do so: if you aren't sure that the input string is newline-free, do not rely on the   Z instance.HWhen debugging, it might be useful to look for implicit invocations of  for Z: Q>>> sh (do { line <- "Hello\nWorld"; echo line }) *** Exception: NewlineForbiddenIn the above example, echo expects its argument to be a Z, thus line :: Z. Since we bind line in Shell, the string literal "Hello\nWorld" has type Shell Z. The   (Shell Z)+ instance delegates the construction of a Z to the   Z) instance, where the exception is thrown.To fix the problem, use ^: R>>> sh (do { line <- select (textToLines "Hello\nWorld"); echo line }) Hello World]turtleConvert a line to a text value.^turtle&Split text into lines. The inverse of _._turtle%Merge lines into a single text value.`turtleiTry to convert a text value into a line. Precondition (checked): the argument does not contain newlines.aturtledConvert a text value into a line. Precondition (unchecked): the argument does not contain newlines.Z[\]^_`aZ]^_`a[\NoneHVCjturtleA j stringkturtleConcatenate two j stringslturtle Convert a jV string to a print function that takes zero or more typed arguments and returns a - stringmturtlePrint a j7 string to standard output (without a trailing newline)"printf ("Hello, "%s%"!\n") "world" Hello, world!nturtlePrint a j4 string to standard err (without a trailing newline)#eprintf ("Hello, "%s%"!\n") "world" Hello, world!oturtle Create your own format specifierpturtlej any  able value format w True"True"qturtlej an  value as a signed decimal format d 25"25"format d (-25)"-25"rturtlej a  value as an unsigned decimal format u 25"25"sturtlej a " value as an unsigned octal number format o 25"31"tturtlej a E value as an unsigned hexadecimal number (without a leading "0x") format x 25"19"uturtlej a 2 using decimal notation with 6 digits of precision format f 25.1 "25.100000"vturtlej a 5 using scientific notation with 6 digits of precision format e 25.1 "2.510000e1"wturtlej a [ using decimal notation for small exponents and scientific notation for large exponents format g 25.1 "25.100000"format g 123456789 "1.234568e8"format g 0.00000000001"1.000000e-11"xturtlej that inserts -format s "ABC""ABC"yturtlej that inserts a Zformat l "ABC""ABC"zturtlej a 7 into -{turtlej a P into -|turtle Convert a 'able value to any type that implements   (such as -) repr (1,2)"(1,2)"jklmnopqrstuvwxyz{|jklmnopqrstuvwxyz{|NoneMXhfturtle-A helpful message explaining what a flag doesThis will appear in the --help outputturtleProgram VersionturtleFooter of the program2This description will appear in the footer of the --help outputturtleHeader of the program2This description will appear in the header of the --help outputturtle-A brief description of what your program does2This description will appear in the header of the --help outputturtleThe name of a sub-command=This is lower-cased to create a sub-command. For example, a  of "Name" will parse name^ on the command line before parsing the remaining arguments using the command's subparser.turtle6The short one-character abbreviation for a flag (i.e. -n)turtle#The name of a command-line argumenteThis is used to infer the long name and metavariable for the command line flag. For example, an  of "name" will create a --name flag with a NAME metavariableturtle-Parse the given options from the command lineturtleLParse the given options from the command line and add additional informationExtended version of options3 with program version header and footer informationturtleThis parser returns  if the given flag is set and  if the flag is absentturtle=Build a flag-based option parser for any type by providing a --parsing functionturtleParse any type that implements turtle Parse an  as a flag-based optionturtle Parse an  as a flag-based optionturtleParse a  as a flag-based optionturtleParse a - value as a flag-based optionturtleParse a Z value as a flag-based optionturtleParse a 7 value as a flag-based optionturtleCBuild a positional argument parser for any type by providing a --parsing functionturtleParse any type that implements  as a positional argumentturtle Parse an  as a positional argumentturtle Parse an  as a positional argumentturtleParse a  as a positional argumentturtleParse a - as a positional argumentturtleParse a Z as a positional argumentturtleParse a 7 as a positional argumentturtle!Create a sub-command that parses ; and then parses the rest of the command-line arguments"The sub-command will have its own  and help textturtle$Create a named group of sub-commands#3#3NoneHMV5turtle,A fully backtracking pattern that parses an 'a' from some -turtleMatch a  against a -( input, returning all possible solutionsThe  must match the entire -turtleMatch any charactermatch anyChar "1""1"match anyChar """"turtleMatches the end of input match eof "1"[] match eof ""[()]turtle Synonym for turtle6Match any character that satisfies the given predicatematch (satisfy (== '1')) "1""1"match (satisfy (== '2')) "1"""turtleMatch a specific charactermatch (char '1') "1""1"match (char '2') "1"""turtle(Match any character except the given onematch (notChar '2') "1""1"match (notChar '1') "1"""turtleMatch a specific stringmatch (text "123") "123"["123"]You can also omit the  function if you enable the OverloadedStrings extension:match "123" "123"["123"]turtle1Match a specific string in a case-insensitive wayThis only handles ASCII stringsmatch (asciiCI "abc") "ABC"["ABC"]turtle%Match any one of the given charactersmatch (oneOf "1a") "1""1"match (oneOf "2a") "1"""turtle.Match anything other than the given charactersmatch (noneOf "2a") "1""1"match (noneOf "1a") "1"""turtleMatch a whitespace charactermatch space " "" "match space "1"""turtle(Match zero or more whitespace charactersmatch spaces " "[" "]match spaces ""[""]turtle'Match one or more whitespace charactersmatch spaces1 " "[" "]match spaces1 ""[]turtleMatch the tab character ('t')match tab "\t""\t" match tab " """turtleMatch the newline character ('n')match newline "\n""\n"match newline " """turtleMatches a carriage return ('r') followed by a newline ('n')match crlf "\r\n"["\r\n"]match crlf "\n\r"[]turtleMatch an uppercase lettermatch upper "A""A"match upper "a"""turtleMatch a lowercase lettermatch lower "a""a"match lower "A"""turtleMatch a letter or digitmatch alphaNum "1""1"match alphaNum "a""a"match alphaNum "A""A"match alphaNum "."""turtleMatch a lettermatch letter "A""A"match letter "a""a"match letter "1"""turtle Match a digitmatch digit "1""1"match digit "a"""turtleMatch a hexadecimal digitmatch hexDigit "1""1"match hexDigit "A""A"match hexDigit "a""a"match hexDigit "g"""turtleMatch an octal digitmatch octDigit "1""1"match octDigit "9"""turtle Match an unsigned decimal numbermatch decimal "123"[123]match decimal "-123"[]turtle9Transform a numeric parser to accept an optional leading '+' or '-' signmatch (signed decimal) "+123"[123]match (signed decimal) "-123"[-123]match (signed decimal) "123"[123]turtle( p) succeeds if p fails and fails if p succeedsmatch (invert "A") "A"[]match (invert "A") "B"[()]match (invert "A") "AA"[()]turtleMatch a  , but return -match (once (char '1')) "1"["1"]match (once (char '1')) ""[]turtle(Use this to match the prefix of a stringmatch "A" "ABC"[]match (prefix "A") "ABC"["A"]turtle(Use this to match the suffix of a stringmatch "C" "ABC"[]match (suffix "C") "ABC"["C"]turtle*Use this to match the interior of a stringmatch "B" "ABC"[]match (has "B") "ABC"["B"]turtle;Match the entire string if it begins with the given pattern;This returns the entire string, not just the matched prefix&match (begins "A" ) "ABC"["ABC"]&match (begins ("A" *> pure "1")) "ABC"["1BC"]turtle9Match the entire string if it ends with the given pattern;This returns the entire string, not just the matched prefix$match (ends "C" ) "ABC"["ABC"]$match (ends ("C" *> pure "1")) "ABC"["AB1"]turtle8Match the entire string if it contains the given pattern=This returns the entire string, not just the interior pattern(match (contains "B" ) "ABC"["ABC"](match (contains ("B" *> pure "1")) "ABC"["A1C"]turtle2Parse 0 or more occurrences of the given charactermatch (star anyChar) "123"["123"]match (star anyChar) ""[""] See also: turtle2Parse 1 or more occurrences of the given charactermatch (plus digit) "123"["123"]match (plus digit) ""[] See also: turtle}Patterns that match multiple times are greedy by default, meaning that they try to match as many times as possible. The > combinator makes a pattern match as few times as possiblefThis only changes the order in which solutions are returned, by prioritizing less greedy solutions.match (prefix (selfless (some anyChar))) "123"["1","12","123"].match (prefix (some anyChar) ) "123"["123","12","1"]turtleCApply the patterns in the list in order, until one of them succeeds*match (choice ["cat", "dog", "egg"]) "egg"["egg"]*match (choice ["cat", "dog", "egg"]) "cat"["cat"]*match (choice ["cat", "dog", "egg"]) "fan"[]turtleGApply the given pattern a fixed number of times, collecting the resultsmatch (count 3 anyChar) "123"["123"]match (count 4 anyChar) "123"[]turtleVApply the given pattern at least the given number of times, collecting the results match (lowerBounded 5 dot) "123"[] match (lowerBounded 2 dot) "123"["123"]turtleXApply the given pattern 0 or more times, up to a given bound, collecting the results match (upperBounded 5 dot) "123"["123"] match (upperBounded 2 dot) "123"[]2match ((,) <$> upperBounded 2 dot <*> chars) "123"[("12","3"),("1","23")]turtlepApply the given pattern a number of times restricted by given lower and upper bounds, collecting the results%match (bounded 2 5 "cat") "catcatcat"[["cat","cat","cat"]]match (bounded 2 5 "cat") "cat"[].match (bounded 2 5 "cat") "catcatcatcatcatcat"[]) could be implemented naively as follows: >bounded m n p = do x <- choice (map pure [m..n]) count x pturtleFTransform a parser to a succeed with an empty value instead of failing See also: match (option "1" <> "2") "12"["12"]match (option "1" <> "2") "2"["2"]turtle(between open close p) matches 'p' in between 'open' and 'close'<match (between (char '(') (char ')') (star anyChar)) "(123)"["123"];match (between (char '(') (char ')') (star anyChar)) "(123"[]turtleDiscard the pattern's resultmatch (skip anyChar) "1"[()]match (skip anyChar) ""[]turtleKRestrict the pattern to consume no more than the given number of charactersmatch (within 2 decimal) "12"[12]match (within 2 decimal) "1"[1]match (within 2 decimal) "123"[]turtleERequire the pattern to consume exactly the given number of charactersmatch (fixed 2 decimal) "12"[12]match (fixed 2 decimal) "1"[]turtlep  sep% matches zero or more occurrences of p separated by sep(match (decimal `sepBy` char ',') "1,2,3" [[1,2,3]]#match (decimal `sepBy` char ',') ""[[]]turtlep  sep$ matches one or more occurrences of p separated by sep$match (decimal `sepBy1` ",") "1,2,3" [[1,2,3]]match (decimal `sepBy1` ",") ""[]turtleLike star dot or  star anyChar, except more efficientturtleLike plus dot or  plus anyChar, except more efficientturtle;Pattern forms a semiring, this is the closest approximation44SafeESX1 turtleA  (Shell a) is a protected stream of a's with side effectsturtleThis is similar to ,  except that the begin field is pure?This small difference is necessary to implement a well-behaved  instance for turtleUse a ,  to reduce the stream of a's produced by a turtle6Provided for backwards compatibility with versions of  turtle-1.4.* and olderturtle0Provided for ease of migration from versions of  turtle-1.4.* and olderturtleUse a  to reduce the stream of a's produced by a turtleUse a * to reduce the stream of a's produced by a turtleFlipped version of &. Useful for reducing a stream of dataExampleSum a  of numbers:"select [1, 2, 3] & reduce Fold.sum6turtleRun a , to completion, discarding any unused valuesturtleRun a  to completion, ing any unused valuesturtleConvert a list to a $ that emits each element of the listturtle9Shell forms a semiring, this is the closest approximation22None %2MPSXg,turtleThe first line with the headerturtleDEvery other line: 1st element is header, 2nd element is original rowturtleAn abstract file size5Specify the units you want by using an accessor like !The  instance for % interprets numeric literals as bytesturtleThis type is the same as System.Directory. type except combining the  and  fields into a single ^) field for consistency with the Unix chmodM. This simplification is still entirely consistent with the behavior of System.Directory5, which treats the two fields as interchangeable.turtle Construct a  from an integer in tebibytesformat sz (TiB 42) "46.179 TB"let GiB n = TiB 1 in n1024turtle 1 tebibyte = 1024 gibibytesturtle Construct a  from an integer in gibibytesformat sz (GiB 42) "45.97 GB"let MiB n = GiB 1 in n1024turtle 1 gibibyte = 1024 mebibytesturtle Construct a  from an integer in mebibytesformat sz (MiB 42) "44.40 MB"let KiB n = MiB 1 in n1024turtle 1 mebibyte = 1024 kibibytesturtle Construct a  from an integer in kibibytesformat sz (KiB 42) "43.8 KB"let B n = KiB 1 in n1024turtle 1 kibibyte = 1024 bytesturtle Construct a  from an integer in terabytesformat sz (TB 42) "42.0 TB"let GB n = TB 1 in n1000turtle 1 terabyte = 1000 gigabytesturtle Construct a  from an integer in gigabytesformat sz (GB 42) "42.0 GB"let MB n = GB 1 in n1000turtle 1 gigabyte = 1000 megabytesturtle Construct a  from an integer in megabytesformat sz (MB 42) "42.0 MB"let KB n = MB 1 in n1000turtle 1 megabyte = 1000 kilobytes turtle Construct a  from an integer in kilobytesformat sz (KB 42) "42.0 KB"let B n = KB 1 in n1000!turtle 1 kilobyte = 1000 bytes"turtle Construct a  from an integer in bytesformat sz (B 42)"42 B"#turtleExtract a size in bytes$turtleRun a command using execvp, retrieving the exit codeThe command inherits stdout and stderr for the current process%turtle<Run a command line using the shell, retrieving the exit code#This command is more powerful than $c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stdout and stderr for the current process&turtleThis function is identical to $ except this throws   for non-zero exit codes'turtleThis function is identical to % except this throws   for non-zero exit codes(turtleRun a command using execvpD, retrieving the exit code and stdout as a non-lazy blob of TextThe command inherits stderr for the current process)turtlefRun a command line using the shell, retrieving the exit code and stdout as a non-lazy blob of Text#This command is more powerful than $c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stderr for the current process*turtleRun a command using execvpM, retrieving the exit code, stdout, and stderr as a non-lazy blob of Text+turtleoRun a command line using the shell, retrieving the exit code, stdout, and stderr as a non-lazy blob of Text#This command is more powerful than $c, but highly vulnerable to code injection if you template the command line with untrusted inputturtleHalt an 7 thread, re-raising any exceptions it might have thrown,turtle, generalizes % and $/ by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API-turtle- generalizes ) and (/ by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API.turtle. generalizes + and */ by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API/turtleRun a command using execvp , streaming stdout as lines of -The command inherits stderr for the current process0turtle.Run a command line using the shell, streaming stdout as lines of -#This command is more powerful than /c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stderr for the current process Throws an 6 exception if the command returns a non-zero exit code1turtle1 generalizes / and 0/ by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API Throws an 6 exception if the command returns a non-zero exit code2turtle2 generalizes 3 and 4/ by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API Throws an 6 exception if the command returns a non-zero exit code3turtle)Run a command using the shell, streaming stdout and stderr as lines of -. Lines from stdout are wrapped in  and lines from stderr are wrapped in . Throws an 6 exception if the command returns a non-zero exit code4turtle.Run a command line using the shell, streaming stdout and stderr as lines of -. Lines from stdout are wrapped in  and lines from stderr are wrapped in .#This command is more powerful than 3c, but highly vulnerable to code injection if you template the command line with untrusted input Throws an 6 exception if the command returns a non-zero exit code5turtlePrint exactly one line to stdout To print more than one line see  *, which also supports formatted output6turtlePrint exactly one line to stderr7turtleRead in a line from stdinReturns  if at end of input8turtle$Get command line arguments in a list9turtle%Set or modify an environment variableNote: This will change the current environment for all of your program's threads since this modifies the global state of the process:turtleDelete an environment variable;turtleLook up an environment variable<turtle"Retrieve all environment variables=turtleChange the current directoryNote: This will change the current directory for all of your program's threads since this modifies the global state of the process>turtle/Change the current directory. Once the current 4 is done, it returns back to the original directory.:set -XOverloadedStringscd "/"view (pushd "/tmp" >> pwd)FilePath "/tmp"pwd FilePath "/"?turtleGet the current directory@turtleGet the home directoryAturtle$Get the path pointed to by a symlinkBturtleCanonicalize a pathCturtle@Stream all immediate children of the given directory, excluding "." and ".."turtleCThis is used to remove the trailing slash from a path, because getPermissions/ will fail if a path ends with a trailing slashDturtle7Stream all recursive descendents of the given directoryEturtledStream the recursive descendents of a given directory between a given minimum and maximum depthFturtle7Stream all recursive descendents of the given directory;This skips any directories that fail the supplied predicate !lstree = lsif (\_ -> return True)GturtleMove a file or directory?Works if the two paths are on the same filesystem. If not, mv[ will still work when dealing with a regular file, but the operation will not be atomicHturtleCreate a directory!Fails if the directory is presentIturtle'Create a directory tree (equivalent to mkdir -p))Does not fail if the directory is presentJturtle Copy a fileKturtleCreate a symlink from one FilePath to anotherLturtleReturns  if the given 7 is not a symbolic link(This comes in handy in conjunction with F: lsif isNotSymbolicLinkMturtle1Copy a directory tree and preserve symbolic linksNturtle4Copy a directory tree and dereference symbolic linksOturtle Remove a filePturtleRemove a directoryQturtle'Remove a directory tree (equivalent to rm -r)Use at your own riskRturtleCheck if a file existsSturtleCheck if a directory existsTturtleCheck if a path existsUturtleLTouch a file, updating the access and modification times to the current time*Creates an empty file if it does not existturtleUnder the hood, System.Directory" does not distinguish between  and '. They both translate to the same  D permission. That means that we can always safely just set the  field and safely leave the  field as / because the two fields are combined with (5) to determine whether to set the executable bit.Vturtle-Update a file or directory's user permissions chmod rwo "foo.txt" -- chmod u=rw foo.txt chmod executable "foo.txt" -- chmod u+x foo.txt chmod nonwritable "foo.txt" -- chmod u-w foo.txt"The meaning of each permission is:Z (+r[ for short): For files, determines whether you can read from that file (such as with wg). For directories, determines whether or not you can list the directory contents (such as with C3). Note: if a directory is not readable then C, will stream an empty list of contents\ (+wZ for short): For files, determines whether you can write to that file (such as with zb). For directories, determines whether you can create a new file underneath that directory.^ (+x^ for short): For files, determines whether or not that file is executable (such as with $). For directories, determines whether or not you can read or execute files underneath that directory (such as with w or $)Wturtle*Get a file or directory's user permissionsXturtle*Set a file or directory's user permissionsYturtle5Copy a file or directory's permissions (analogous to chmod --reference)Zturtle +r[turtle -r\turtle +w]turtle -w^turtle +x_turtle -x`turtle -r -w -xaturtle +r -w -xbturtle -r +w -xcturtle -r -w +xdturtle +r +w -xeturtle +r -w +xfturtle -r +w +xgturtle +r +w +xhturtle:Time how long a command takes in monotonic wall clock time/Returns the duration alongside the return valueiturtleGet the system's host namejturtle(Show the full path of an executable filekturtle9Show all matching executables in PATH, not just the firstlturtleSleep for the given durationKA numeric literal argument is interpreted as seconds. In other words,  (sleep 2.0) will sleep for two seconds.mturtleExit with the given exit codeAn exit code of 0 indicates successnturtle&Throw an exception using the provided - messageoturtle Analogous to  in Bash6Runs the second command only if the first one returns pturtle Analogous to  in Bash5Run the second command only if the first one returns qturtle;Create a temporary directory underneath the given directory)Deletes the temporary directory when donerturtle6Create a temporary file underneath the given directory$Deletes the temporary file when doneNote that this provides the   of the file in order to avoid a potential race condition from the file being moved or deleted before you have a chance to open the file. The sW function provides a simpler API if you don't need to worry about that possibility.sturtle6Create a temporary file underneath the given directory$Deletes the temporary file when donetturtleFork a thread, acquiring an  valueuturtle Wait for an  action to completevturtleRead lines of - from standard inputwturtleRead lines of - from a filexturtleRead lines of - from a  yturtleStream lines of - to standard outputzturtleStream lines of - to a file{turtleStream lines of - to a  |turtleStream lines of - to append to a file}turtleStream lines of - to standard error~turtle$Read in a stream's contents strictlyturtle Acquire a Managed read-only   from a 7turtle Acquire a Managed write-only   from a 7turtle Acquire a Managed append-only   from a 7turtleCombine the output of multiple  s, in orderturtle$Keep all lines that match the given turtle Keep every - element that matches the given turtleReplace all occurrences of a  with its - result performs substitution on a line-by-line basis, meaning that substitutions may not span multiple lines. Additionally, substitutions may occur multiple times within the same line, like the behavior of  s/.../.../g.Warning: Do not use a V that matches the empty string, since it will match an infinite number of times.  tries to detect such  s and nW with an error message if they occur, but this detection is necessarily incomplete.turtleLike H, but the provided substitution must match the beginning of the lineturtleLike >, but the provided substitution must match the end of the lineturtleLike :, but the provided substitution must match the entire lineturtle3Make a `Shell Text -> Shell Text` function work on 7As instead. | Ignores any paths which cannot be decoded as valid -.turtleLike , but operates in place on a 7 (analogous to sed -i)turtleLike , but operates in place on a 7turtleLike , but operates in place on a 7turtleLike , but operates in place on a 7turtle@Search a directory recursively for all files matching the given turtle8Filter a shell of FilePaths according to a given patternturtle>Check if a file was last modified after a given timestampturtle?Check if a file was last modified before a given timestampturtle A Stream of "y"sturtleNumber each element of a  (starting at 0)turtle Merge two s together, element-wiseIf one @ is longer than the other, the excess elements are truncatedturtleA  that endlessly emits ()turtleLimit a  to a fixed number of valuesturtleLimit a % to values that satisfy the predicateUThis terminates the stream on the first value that does not satisfy the predicateturtleCache a m's output so that repeated runs of the script will reuse the result of previous runs. You must supply a 7, where the cached result will be stored.(The stored result is only reused if the  successfully ran to completion without any exceptions. Note: on some platforms Ctrl-C will flush standard input and signal end of file before killing the program, which may trick the program into "successfully" completing.turtle9Run a list of IO actions in parallel using fork and wait./view (parallel [(sleep 3) >> date, date, date])2016-12-01 17:22:10.83296 UTC2016-12-01 17:22:07.829876 UTC2016-12-01 17:22:07.829963 UTCturtle0Split a line into chunks delimited by the given turtleGet the current timeturtle%Get the time a file was last modifiedturtle%Get the size of a file or a directoryturtlej a & using a human readable representation format sz 42"42 B"format sz 2309 "2.309 KB"format sz 949203 "949.203 KB"format sz 1600000000 "1.600 GB"format sz 999999999999999999"999999.999 TB"turtle3Count the number of characters in the stream (like wc -c)yThis uses the convention that the elements of the stream are implicitly ended by newlines that are one character wideturtle.Count the number of words in the stream (like wc -w)turtle.Count the number of lines in the stream (like wc -l)PThis uses the convention that each element of the stream represents one lineturtleGet the status of a fileturtle3Size of the file in bytes. Does not follow symlinksturtleTime of last accessturtleTime of last modificationturtleFTime of last status change (i.e. owner, group, link count, mode, etc.)turtle9Get the status of a file, but don't follow symbolic linksturtleReturns the result of a t that outputs a single line. Note that if no lines / more than 1 line is produced by the Shell, this function will n with an error message. Gmain = do directory <- single (inshell "pwd" empty) print directoryturtle#Filter adjacent duplicate elements: view (uniq (select [1,1,2,1,3]))1213turtleQFilter adjacent duplicates determined after applying the function to the element:Dview (uniqOn fst (select [(1,'a'),(1,'b'),(2,'c'),(1,'d'),(3,'e')]))(1,'a')(2,'c')(1,'d')(3,'e')turtleEFilter adjacent duplicate elements determined via the given function:'view (uniqBy (==) (select [1,1,2,1,3]))1213turtle Return a new ) that discards duplicates from the input :)view (nub (select [1, 1, 2, 3, 3, 4, 3]))1234turtle Return a new K that discards duplicates determined via the given function from the input :.view (nubOn id (select [1, 1, 2, 3, 3, 4, 3]))1234turtle2Return a list of the sorted elements of the given , keeping duplicates:sort (select [1,4,2,3,3,7]) [1,2,3,3,4,7]turtle+Return a list of the elements of the given B, sorted after applying the given function and keeping duplicates: sortOn id (select [1,4,2,3,3,7]) [1,2,3,3,4,7]turtle+Return a list of the elements of the given 6, sorted by the given function and keeping duplicates:QsortBy (comparing fst) (select [(1,'a'),(4,'b'),(2,'c'),(3,'d'),(3,'e'),(7,'f')])1[(1,'a'),(2,'c'),(3,'d'),(3,'e'),(4,'b'),(7,'f')]turtleGroup an arbitrary stream of - into newline-delimited Zs+stdout (toLines ("ABC" <|> "DEF" <|> "GHI") ABCDEFGHIHstdout (toLines empty) -- Note that this always emits at least 1 `Line`3stdout (toLines ("ABC\nDEF" <|> "" <|> "GHI\nJKL"))ABCDEFGHIJKL$turtleCommandturtle ArgumentsturtleLines of standard inputturtle Exit code%turtle Command lineturtleLines of standard inputturtle Exit code&turtleCommandturtle ArgumentsturtleLines of standard input'turtle Command lineturtleLines of standard inputturtle Exit code(turtleCommandturtle ArgumentsturtleLines of standard inputturtleExit code and stdout)turtle Command lineturtleLines of standard inputturtleExit code and stdout*turtleCommandturtle ArgumentsturtleLines of standard inputturtle(Exit code, stdout, stderr)+turtle Command lineturtleLines of standard inputturtle(Exit code, stdout, stderr),turtleCommandturtleLines of standard inputturtle Exit code-turtleCommandturtleLines of standard inputturtleExit code and stdout.turtleCommandturtleLines of standard inputturtleExit code and stdout/turtleCommandturtle ArgumentsturtleLines of standard inputturtleLines of standard output0turtle Command lineturtleLines of standard inputturtleLines of standard output1turtleCommandturtleLines of standard inputturtleLines of standard output2turtleCommandturtleLines of standard inputturtleLines of standard output3turtleCommandturtle ArgumentsturtleLines of standard inputturtle!Lines of either standard output () or standard error ()4turtle Command lineturtleLines of standard inputturtle!Lines of either standard output () or standard error ()VturtlePermissions update functionturtlePathturtleUpdated permissionsqturtleParent directoryturtleDirectory name templaterturtleParent directoryturtleFile name templatesturtleParent directoryturtleFile name template89RSTUVWXY"      !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~5679889:;<=?@ABGHIJMNKLOPQRSTUhijklmnoprsqtu>vwxyz{|}~CFDE$%&'/034()*+,12-.VWXYZ[\]^_`abcdefg" " #!YXWVUTSR     o3p2NoneSX turtle(Read chunks of bytes from standard input9The chunks are not necessarily aligned to line boundariesturtle Read chunks of bytes from a file9The chunks are not necessarily aligned to line boundariesturtleRead chunks of bytes from a  9The chunks are not necessarily aligned to line boundariesturtle)Stream chunks of bytes to standard output9The chunks are not necessarily aligned to line boundariesturtle Stream chunks of bytes to a file7The chunks do not need to be aligned to line boundariesturtleStream chunks of bytes to a  7The chunks do not need to be aligned to line boundariesturtle*Append chunks of bytes to append to a file7The chunks do not need to be aligned to line boundariesturtle(Stream chunks of bytes to standard error7The chunks do not need to be aligned to line boundariesturtle$Read in a stream's contents strictlyturtleRun a command using execvp, retrieving the exit codeThe command inherits stdout and stderr for the current processturtle<Run a command line using the shell, retrieving the exit code#This command is more powerful than c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stdout and stderr for the current processturtleThis function is identical to  except this throws   for non-zero exit codesturtleThis function is identical to  except this throws   for non-zero exit codesturtleRun a command using execvpD, retrieving the exit code and stdout as a non-lazy blob of TextThe command inherits stderr for the current processturtlefRun a command line using the shell, retrieving the exit code and stdout as a non-lazy blob of Text#This command is more powerful than c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stderr for the current processturtleRun a command using execvpM, retrieving the exit code, stdout, and stderr as a non-lazy blob of TextturtleoRun a command line using the shell, retrieving the exit code, stdout, and stderr as a non-lazy blob of Text#This command is more powerful than c, but highly vulnerable to code injection if you template the command line with untrusted inputturtleHalt an 7 thread, re-raising any exceptions it might have thrownturtle generalizes  and / by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process APIturtle generalizes  and / by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process APIturtle generalizes  and / by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process APIturtleRun a command using execvp , streaming stdout as chunks of The command inherits stderr for the current processturtle.Run a command line using the shell, streaming stdout as chunks of #This command is more powerful than c, but highly vulnerable to code injection if you template the command line with untrusted inputThe command inherits stderr for the current processturtle generalizes  and / by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API Throws an 6 exception if the command returns a non-zero exit codeturtle generalizes  and / by allowing you to supply your own custom  CreateProcessM. This is for advanced users who feel comfortable using the lower-level process API Throws an 6 exception if the command returns a non-zero exit codeturtle)Run a command using the shell, streaming stdout and stderr as chunks of . Chunks from stdout are wrapped in  and chunks from stderr are wrapped in . Throws an 6 exception if the command returns a non-zero exit codeturtle.Run a command line using the shell, streaming stdout and stderr as chunks of . Chunks from stdout are wrapped in  and chunks from stderr are wrapped in .#This command is more powerful than c, but highly vulnerable to code injection if you template the command line with untrusted input Throws an 6 exception if the command returns a non-zero exit codeturtleInternal utility used by both  and turtleCompress a stream using zliboNote that this can decompress streams that are the concatenation of multiple compressed streams (just like gzip)Glet compressed = select [ "ABC", "DEF" ] & compress 0 defaultWindowBits0compressed & decompress defaultWindowBits & view"ABCDEF"A(compressed <|> compressed) & decompress defaultWindowBits & view"ABCDEF""ABCDEF"turtleDecompress a stream using zlib (just like the gzip command)turtle!Decode a stream of bytes as UTF8 -9NOTE: This function will throw a pure exception (i.e. an ?) if UTF8 decoding fails (mainly due to limitations in the text# package's stream decoding API)turtle!Encode a stream of bytes as UTF8 -turtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtle Exit codeturtle Command lineturtle(Chunks of bytes written to process inputturtle Exit codeturtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtle Command lineturtle(Chunks of bytes written to process inputturtle Exit codeturtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtleExit code and stdoutturtle Command lineturtle(Chunks of bytes written to process inputturtleExit code and stdoutturtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtle(Exit code, stdout, stderr)turtle Command lineturtle(Chunks of bytes written to process inputturtle(Exit code, stdout, stderr)turtleCommandturtle(Chunks of bytes written to process inputturtle Exit codeturtleCommandturtle(Chunks of bytes written to process inputturtleExit code and stdoutturtleCommandturtle(Chunks of bytes written to process inputturtleExit code and stdoutturtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtle(Chunks of bytes read from process outputturtle Command lineturtle(Chunks of bytes written to process inputturtle(Chunks of bytes read from process outputturtleCommandturtle(Chunks of bytes written to process inputturtle(Chunks of bytes read from process outputturtleCommandturtle(Chunks of bytes written to process inputturtle(Chunks of bytes read from process outputturtleCommandturtle Argumentsturtle(Chunks of bytes written to process inputturtleChunks of either output ( ) or error ()turtle Command lineturtle(Chunks of bytes written to process inputturtleChunks of either output ( ) or error ()turtleCompression levelturtleturtle!456!456None turtleFlipped version of . () =   ExamplesApply (+1) to a list, a   and a :Just 2 <&> (+1)Just 3[1,2,3] <&> (+1)[2,3,4]Right 3 <&> (+1)Right 4    %$#"!('&*),+-./0123789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ajklmnopqrstuvwxyz{|"      !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~L  %$#"!('& ./017:;<=>?@ABCDEFGHIJKLMNO*),+-PQ  1None !"#$%&%'()*+,-./0102034567898:;<=>?@ABCDEFGHFGHFGIFGIJKLMNOMNPMNQMNRMNSTUVWXYWXYWXZ[\]^_`^_a[bc[bd[be[bf[gh[gi[gj[gk[gl[gm[gn[go[gp[gq[gr[gs[gt[gu[gv[gw[gx[gyz{|z}~        !"#$%&'()*++,-.//01223456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~HIJKLMNOPQRSTUVWX (+     $turtle-1.5.20-6ftWKqBkZ0KL917JsuAMaLTurtle Turtle.ShellTurtle.Options Turtle.BytesTurtle.Prelude Turtle.Line Turtle.FormatTurtle.PatternTurtle.Internalprintf System.PosixownerExecuteMode Data.MaybeJust Data.EitherRightTurtle.Tutorialbase Data.String fromString Control.MonadguardGHC.Base<>memptymappendmconcatjoin<*>pure*>IsString ApplicativeMonoidGHC.IO.Handle.TypesHandleControl.Monad.IO.ClassliftIOMonadIOmfilterunless replicateM_forever<=<>=>Control.ApplicativeoptionalGHC.IO.Exception ExitFailure ExitSuccessExitCode Data.Foldablemsum Data.Function& Data.Functorvoid<$>when<*liftA2manysome<|>empty Alternativemplusmzero MonadPlus"foldl-1.4.8-AcOgph6rcL67JMcgbvL6Xf Control.FoldlFoldFoldM text-1.2.3.1Data.Text.InternalText$managed-1.0.7-BnsoB2y3IFn7VsT7css3VqControl.Monad.Managed runManagedwithmanagedManagedusing3optparse-applicative-0.15.1.0-ej5No6I3HDGI2Mvw1vhbTOptions.Applicative.TypesParser#zlib-0.6.2.2-HlOJpfD0LyC1aJNHM3M81mCodec.Compression.Zlib.Stream WindowBitsdefaultWindowBits-system-filepath-0.4.14-FRUtJu5zAWTG9MKrRBz8D6Filesystem.Path.InternalFilePath-system-fileio-0.3.16.4-HlRuLFEUs5510FaMgZTWEJ Filesystem writeTextFile readTextFileFilesystem.Path.CurrentOS decodeString encodeStringfromTexttoTextFilesystem.PathsplitExtension dropExtension<.> hasExtension extensionsplitDirectoriescollapse stripPrefix commonPrefixrelativeabsolutebasenamedirnamefilenameparent directoryroot time-1.8.0.2 Data.Time.Clock.Internal.UTCTimeUTCTime(Data.Time.Clock.Internal.NominalDiffTimeNominalDiffTime unix-2.7.2.2System.Posix.Files.CommonisSocketisSymbolicLink isDirectory isRegularFile isNamedPipeisCharacterDevice isBlockDevice FileStatusLineNewlineForbidden lineToText textToLines linesToText textToLineunsafeTextToLine$fExceptionNewlineForbidden$fIsStringLine$fSemigroupLine$fShowNewlineForbidden$fEqLine $fOrdLine $fShowLine $fMonoidLineFormat%formateprintf makeFormatwduoxfegslfputcrepr$fIsStringFormat$fCategoryTYPEFormat HelpMessagegetHelpMessage DescriptiongetDescription CommandNamegetCommandName ShortNameArgName getArgNameoptions optionsExtswitchoptoptReadoptInt optInteger optDoubleoptTextoptLineoptPathargargReadargInt argInteger argDoubleargTextargLineargPath subcommandsubcommandGroup$fIsStringArgName$fIsStringCommandName$fIsStringDescription$fIsStringHeader$fIsStringFooter$fIsStringHelpMessagePatternmatchanyChareofdotsatisfycharnotChartextasciiCIoneOfnoneOfspacespacesspaces1tabnewlinecrlfupperloweralphaNumletterdigithexDigitoctDigitdecimalsignedinvertonceprefixsuffixhasbeginsendscontainsstarplusselflesschoicecount lowerBounded upperBoundedboundedoptionbetweenskipwithinfixedsepBysepBy1charschars1$fIsStringPattern $fNumPattern$fMonoidPattern$fSemigroupPattern$fFunctorPattern$fApplicativePattern$fMonadPattern$fAlternativePattern$fMonadPlusPatternShell _foldShell FoldShellfoldIO_foldIO_Shell foldShellfoldreduceshviewselect$fIsStringShell $fNumShell $fMonoidShell$fSemigroupShell$fMonadFailShell$fMonadCatchShell$fMonadThrowShell$fMonadManagedShell$fMonadIOShell$fMonadPlusShell$fAlternativeShell $fMonadShell$fApplicativeShell$fFunctorShell WithHeaderHeaderRowSize Permissions _readable _writable _executable ShellFailedshellCommandLine shellExitCode ProcFailed procCommand procArguments procExitCodeTiB tebibytesGiB gibibytesMiB mebibytesKiB kibibytesTB terabytesGB gigabytesMB megabytesKB kilobytesBbytesprocshellprocsshells procStrict shellStrictprocStrictWithErrshellStrictWithErrsystem systemStrictsystemStrictWithErrinprocinshellstream streamWithErr inprocWithErrinshellWithErrechoerrreadline argumentsexportunsetneedenvcdpushdpwdhomereadlinkrealpathlslstreelsdepthlsifmvmkdirmktreecpsymlinkisNotSymbolicLinkcptreecptreeLrmrmdirrmtreetestfiletestdirtestpathtouchchmodgetmodsetmodcopymodreadable nonreadablewritable nonwritable executable nonexecutableooorooowoooxrworoxowxrwxtimehostnamewhichwhichAllsleepexitdie.&&..||. mktempdirmktemp mktempfileforkwaitstdininputinhandlestdoutoutput outhandleappendstderrstrictreadonly writeonly appendonlycatgrepgrepTextsed sedPrefix sedSuffix sedEntireonFilesinplace inplacePrefix inplaceSuffix inplaceEntirefindfindtreecmincmaxyesnlpasteendlesslimit limitWhilecacheparallelcutdatedatefiledusz countChars countWords countLinesstatfileSize accessTimemodificationTimestatusChangeTimelstatheadersingleuniquniqOnuniqBynubnubOnsortsortOnsortBytoLines$fExceptionProcFailed$fExceptionShellFailed $fShowSize$fShowProcFailed$fShowShellFailed$fEqPermissions$fReadPermissions$fOrdPermissions$fShowPermissions$fEqSize $fOrdSize $fNumSize$fShowWithHeadercompress decompresstoUTF8fromUTF8<&> ignoreSIGPIPEGHC.ShowShowGHC.RealIntegralghc-prim GHC.TypesWordDoubleVersionFooterTrueFalseGHC.ReadReadInt integer-gmpGHC.Integer.TypeIntegerCharIO(exceptions-0.10.4-622ySnQapwMAU2KS1exqorControl.Monad.Catch MonadCatch System.IOprintGHC.NumNumdirectory-1.3.3.0 System.Directory.Internal.Common searchablehalt"async-2.2.2-JNOgs3QkEuXLm97AkAPhACControl.Concurrent.AsyncAsyncLeft GHC.MaybeNothingdeslashtoSystemDirectoryPermissions GHC.Classes||&&bytestring-0.10.8.2Data.ByteString.Internal ByteString fromPopperGHC.Errerrorflipfmap