UQ|6      !"#$%&'()*+,-./012345(c) Brandon SimmonsBSD3-Brandon Simmons <brandon.m.simmons@gmail.com> experimentalportableNonean element in a FilePath:a simple wrapper to hold a base directory name, which can be either an absolute or relative path. This lets us give the DirTree a context, while still letting us store only directory and file namesO (not full paths) in the DirTree. (uses an infix constructor; don't be scared)Cthe String in the name field is always a file name, never a full path. The free type variable is used in the File constructor and can hold Handles, Strings representing a file's contents or anything else you can think of. We catch any IO errors in the Failed constructor. an Exception can be converted to a String with 6. bBuild an AnchoredDirTree, given the path to a directory, opening the files using readFile. Uses readDirectoryWith readFileR internally and has the effect of traversing the entire directory structure. See - for lazy production of a DirTree structure.Build a  rooted at p and using f to fill the   field of  nodes.The 7 arguments to fG will be the full path to the current file, and will include the root pF as a prefix. For example, the following would return a tree of full 7*s like "../tmp/foo" and "../tmp/bar/baz": !readDirectoryWith return "../tmp"Note though that the " function below already does this.A "lazy" version of O that does IO operations as needed i.e. as the tree is traversed in pure code.NOTE: This function uses 8# under the hood. This means that:@side effects are tied to evaluation order and only run on demand)you might receive exceptions in pure codewrite a DirTree of strings to disk. Clobbers files of the same name. Doesn't affect files in the directories (if any already exist) with different names. Returns a new AnchoredDirTree where failures were lifted into a  constructor:`writes the directory structure to disk and uses the provided function to write the contents of Files@ to disk. The return value of the function will become the new  B of the returned, where IO errors at each node are replaced with l constructors. The returned tree can be compared to the passed tree to see what operations, if any, failed:3a simple application of readDirectoryWith openFile:builds a DirTree from the contents of the directory passed to it, saving the base directory in the Anchored* wrapper. Errors are caught in the tree in the Failed constructor. The  S fields initially are populated with full paths to the files they are abstracting. identical to 0 but does directory reading IO lazily as needed:+True if any Failed constructors in the tree4True if there are no Failed constructors in the treereturns true if argument is a  constructor:returns a list of  constructors only:;maps a function to convert Failed DirTrees to Files or Dirs?Recursively sort a directory tree according to the Ord instanceRecursively sort a tree as in 4 but ignore the file contents of a File constructorTests equality of two trees, ignoring their free variable portion. Can be used to check if any files have been added or deleted, for instance.>a compare function that ignores the free "file" type variable:DEPRECATED. Use record  instead.If the argument is a # containing a sub-DirTree matching * then return that subtree, appending the   of the old root  to the 2 of the AnchoredDirTree wrapper. Otherwise return Nothing. applies the predicate to each constructor in the tree, removing it (and its children, of course) when the predicate returns False. The topmost constructor will always be preserved:! Flattens a 1 into a (never empty) list of tree constructors. % constructors will have [] as their  :"Allows for a function on a bare DirTree to be applied to an AnchoredDirTree within a Functor. Very similar to and useful in combination with 9:#)tuple up the complete file path with the  w contents, by building up the path, trie-style, from the root. The filepath will be relative to "anchored" directory. This allows us to, for example, mapM_ uncurry writeFile& over a DirTree of strings, although  does a better job of this.$writes the directory structure (not files) of a DirTree to the anchored directory. Returns a structure identical to the supplied tree with errors replaced by  constructors:%At  constructor, apply transformation function to all of directory's contents, then remove the Nothing's and recurse. This always preserves the topomst constructor.0AFirst compare constructors: Failed < Dir < File... Then compare  -... Then compare free variable parameter of  constructors1]Two DirTrees are equal if they have the same constructor, the same name (and in the case of s) their sorted   are equal:?:; <=>?@A !"#BC$DEF%&'()*+,-./01,  !"#$%&'()*+.  $#! %"&'()*+5:;  <=>?@A !"#BC$DEF%&'()*+,-./01"4G      !"#$%&'()*+,-./0123456789:8;<8=>8?@ABCDEFGHIJKLMN,directory-tree-0.12.1-70g9wpD5XETJmTKzzflzN7System.Directory.TreeFileNameAnchoredDirTree:/anchordirTreeDirTreeFailedDirFilenameerrcontentsfile readDirectoryreadDirectoryWithreadDirectoryWithLwriteDirectorywriteDirectoryWith openDirectorybuildbuildL anyFailed successfulfailedfailures failedMapsortDir sortDirShape equalShapecomparingShapefreedropTo filterDir flattenDirzipPaths writeJustDirs transformDir _contents_err_file_name_anchor_dirTree$fFunctorAnchoredDirTree$fTraversableDirTree$fFoldableDirTree$fFunctorDirTree $fOrdDirTree $fEqDirTree $fShowDirTree$fShowAnchoredDirTree$fOrdAnchoredDirTree$fEqAnchoredDirTreebaseGHC.ShowshowGHC.IOFilePath GHC.IO.UnsafeunsafeInterleaveIO Data.Functor<$>BuilderUserIO buildWith' buildAtOnce' unsafeMapMbuildLazilyUnsafe' sortDirBycomparingConstrtopDirbaseDir getDirsFileshandleDTremoveNonexistent