úÎN[K+      !"#$%&'()*Pportable Provides a simple data structure mirroring a directory tree on the  experimental-Brandon Simmons <brandon.m.simmons@gmail.com>Nonean element in a FilePath: Ga simple wrapper to hold a base directory name, which can be either an K absolute or relative path. This lets us give the DirTree a context, while 0 still letting us store only directory and file names (not full paths) in - the DirTree. (uses an infix constructor; don' t be scared) Gthe String in the name field is always a file name, never a full path. N 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. H We catch any IO errors in the Failed constructor. an Exception can be  converted to a String with +. Kbuild an AnchoredDirTree, given the path to a directory, opening the files  using readFile.  Uses 1 internally and has the effect of traversing the ! entire directory structure. See  for lazy production  of a DirTree structure. :same as readDirectory but allows us to, for example, use 6 ByteString.readFile to return a tree of ByteStrings. A lazy version of # that does IO operations as needed - i.e. as the tree is traversed in pure code.  NOTE:F This function uses unsafePerformIO under the hood. I believe our use B here is safe, but this function is experimental in this release: Fwrite a DirTree of strings to disk. Clobbers files of the same name.  Doesn'?t affect files in the directories (if any already exist) with D different names. Returns a new AnchoredDirTree where failures were  lifted into a   constructor: Jwrites the directory structure to disk and uses the provided function to  write the contents of Files0 to disk. The return value of the function will  become the new  3 of the returned, where IO errors at each node are  replaced with  4 constructors. The returned tree can be compared to 9 the passed tree to see what operations, if any, failed: 4a simple application of readDirectoryWith openFile: Jbuilds a DirTree from the contents of the directory passed to it, saving O the base directory in the Anchored* wrapper. Errors are caught in the tree in  the Failed constructor. The + fields initially are populated with full * paths to the files they are abstracting.  identical to 1 but does directory reading IO lazily as needed: ,True if any Failed constructors in the tree 5True if there are no Failed constructors in the tree returns 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 instance Recursively sort a tree as in # but ignore the file contents of a  File constructor JTests equality of two trees, ignoring their free variable portion. Can be F 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. Happlies the predicate to each constructor in the tree, removing it (and I 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  : "LAllows for a function on a bare DirTree to be applied to an AnchoredDirTree B within a Functor. Very similar to and useful in combination with ,: #)tuple up the complete file path with the  contents, by building up the C 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. $Iwrites the directory structure (not files) of a DirTree to the anchored K directory. Returns a structure identical to the supplied tree with errors  replaced by   constructors: -#First compare constructors: Failed < Dir < File...  Then compare  ... ) Then compare free variable parameter of  constructors .HTwo DirTrees are equal if they have the same constructor, the same name  (and in the case of s) their sorted   are equal: >/0 12345 !"#67$89:;%&'()*<=>?-.+  !"#$%&'()*-   $#! "%&'()*4/0   12345 !"#67$89:;%&'()*<=>?-.@      !"#$%&'()*+,-./-0123456789:;<=>?@ABCDEdirectory-tree-0.11.0System.Directory.TreeFileNameAnchoredDirTree:/anchordirTreeDirTreeFilefileDircontentsFailednameerr readDirectoryreadDirectoryWithreadDirectoryWithLwriteDirectorywriteDirectoryWith openDirectorybuildbuildL anyFailed successfulfailedfailures failedMapsortDir sortDirShape equalShapecomparingShapefreedropTo filterDir flattenDirzipPaths writeJustDirs _contents_err_file_name_anchor_dirTreebaseGHC.Showshow Data.Functor<$> $fOrdDirTree $fEqDirTreeBuilderUserIO buildWith' buildAtOnce'buildLazilyUnsafe' sortDirBycomparingConstrtopDirbaseDir getDirsFileshandleDTremoveNonexistent transform$fFunctorAnchoredDirTree$fTraversableDirTree$fFoldableDirTree$fFunctorDirTree