úÎnÈl!      © 2016 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone%&,9;D ³The type class includes data types that contain information about what to do when some object already exists. There are two scenarios currently supported: override it or use it.ŽThe option allows to avoid throwing exception if upon completion of specified action file with given name already exists in the file system.uThe option will copy already existing file into temporary location, so you can edit it instead of creating new file.©The type class is for the data types that include information specifying how to create temporary files and directories and whether to delete them automatically or not.§Specify name of temporary directory to use. The default is the system temporary directory. If the directory does not exist, it will be created, but won't be deleted.ESpecify the template string to use to name temporary directory, see  , default is "plan-b".a preserves temporary files and directories when exception is thrown (normally they are removed).‡By default files are moved by copying. Moving by renaming, although not always possible, often more efficient. This option enables it. PThe configuration allows to control behavior of the library in details. It's a !> and so various configuration settings can be combined using " while # represents default behavior.RWhen combining conflicting configuration settings, the value on the left side of " wins: 0overrideIfExists <> useIfExists -- will override8Custom behavior for cases when something already exists.,First delete that object, then do your thing)Continue to work with that object insteadkWe use this as a kind with two promoted constructors. The constructors are used as phantom types to index  . $%&'()      $%&'()© 2016 2017 Mark Karpov BSD 3 clause$Mark Karpov <markkarpov92@gmail.com> experimentalportableNone,ãCreate a new file. Name of the file is taken as the second argument. The third argument allows to perform actions (in simplest case just creation of file), result of those actions should be new file with the given file name.This action throws *H by default instead of silently overwriting already existing file, use  and  to change this behavior. Edit an existing file. Name of the file is taken as the second argument. The third argument allows to perform actions on temporary copy of the specified file.This action throws +* exception if target file does not exist.ªCreate a new directory. Name of the directory is specified as the second argument. The third argument allows to perform actions in sandboxed  version of new directory.This action throws *M by default instead of silently overwriting already existing directory, use  and to change this behavior.®Edit an existing directory. Name of the directory is specified as the second argument. The third argument allows to perform actions in sandboxed  copy of target directory.This action throws +/ exception if target directory does not exist.ÿ;Create a new container file. This is suitable for processing of all sorts of archive-like objects. The first and second arguments specify how to unpack directory from file and pack it back. The fourth argument names the new file. The fifth argument allows to perform actions knowing name of temporary directory.This action throws *H by default instead of silently overwriting already existing file, use  and to change this behavior. ÿ^Edit an existing container file. This is suitable for processing of all sorts of archive-like objects. The first and second arguments specify how to unpack directory from file and pack it back (overwriting old version). Fourth argument names container file to edit. The last argument allows to perform actions knowing name of temporary directory.This action throws +* exception if target file does not exist.,YUse a temporary directory. This action is controlled by the supplied configuration, see ç. The temporary directory is removed automatically when given action finishes, although this can be changed via the mentioned configuration value too. If given action finishes successfully, temporary directory is always deleted.-WConstruct name of file combining given directory path and file name from path to file..gCheck existence of file and perform actions according to the given configuration. By default we throw ** unless the user has specified different  . If it's Y, then we don't need to do anything, file will be overwritten automatically, if we have /, then we should copy it into given directory./\Check existence of directory and perform actions according to the given configuration. See ., overall behavior is the same.0šMove a specified file to another location. File can be moved either by copying or by renaming, exact method is determined by the supplied configuration.1ìMove a specified directory to another location. If destination location is already occupied, delete that object first. Directory can be moved either by copying or by renaming, exact method is determined by the supplied configuration.2%Copy a file to a new location. Throw + if it does not exist.3cCopy contents of one directory into another (recursively). Source directory must exist, otherwise +G is thrown. Destination directory will be created if it doesn't exist.46Perform an action ignoring IO exceptions it may throw. ConfigurationName of file to create#Given name of temporary file, do it ConfigurationName of file to edit#Given name of temporary file, do it ConfigurationName of directory to create(Given name of temporary directory, do it ConfigurationName of directory to edit(Given name of temporary directory, do it+How to unpack file into specified directory)How to pack specified directory into file ConfigurationName of container to create(Given name of temporary directory, do it +How to unpack file into specified directory)How to pack specified directory into file ConfigurationName of container to edit(Given name of temporary directory, do it, Configuration)Action to perform with the temporary file-Directory nameGet file name from this pathResulting path. Configuration!Where to copy file (when we have ) File to check/ Configuration&Where to copy directory (when we have )Directory to check0 ConfigurationOriginal location Where to move1 ConfigurationOriginal location Where to move2Original locationWhere to put copy of the file3Original location"Where to put copy of the directory4    ,-./012345      !"#$%&'(&')&'*+,-./&01&023456789:;<#plan-b-0.2.1-Il6KZ9Q1eCB762UvQwGstPSystem.PlanB.Type System.PlanBSystem.Directory openTempFileCanHandleExistingoverrideIfExists useIfExistshowHandleExistingHasTemptempDir nameTemplatepreserveCorpsemoveByRenaming getTempDirgetNameTemplategetPreserveCorpsegetMoveByRenamingPbConfigAlreadyExistsBehavior AebOverrideAebUseSubjectNewExisting$fCanHandleExistingPbConfig$fHasTempPbConfig$fMonoidPbConfig$fSemigroupPbConfig$fEqAlreadyExistsBehavior$fEnumAlreadyExistsBehavior$fBoundedAlreadyExistsBehavior withNewFilewithExistingFile withNewDirwithExistingDirwithNewContainerwithExistingContainerbaseGHC.BaseMonoidmappendmempty pbcTempDirpbcNameTemplatepbcPreserveCorpsepbcMoveByRenamingpbcAlreadyExistsSystem.IO.ErroralreadyExistsErrorTypedoesNotExistErrorType withTempDirconstructFilePathcheckExistenceOfFilecheckExistenceOfDirmoveFilemoveDircopyFilecopyDirignoringIOErrors