úÎmj‰     © 2016 Mark Karpov BSD 3 clause(Mark Karpov <markkarpov@openmailbox.org> experimentalportableNone!"(35> ³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 data types that include information specifying how to create temporary files and directories and whether to delete them automatically or not. Specifies name of temporary directory to use. Default is the system temporary directory. If the directory does not exist, it will be created, but not deleted.:Specify template 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 insteadoWe use this as named kind with two promoted constructors. The constructors are used as phantom types to index  .  !"#$%     !"#$%© 2016 Mark Karpov BSD 3 clause(Mark Karpov <markkarpov@openmailbox.org> experimentalportableNone(ÝCreate 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 given file name.This action throws &H by default instead of silently overwriting already existing file, use  and  to change this behavior.™Edit existing file. Name of the file is taken as the second argument. The third argument allows to perform actions on temporary copy of specified file.This action throws '* exception if target file does not exist.¨Create 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 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.ÿ5Create 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 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 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.(SUse temporary directory. This action is controlled by 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.*cCheck existence of file and perform actions according to given configuration. By default we throw && unless user has specified different  . If it's Z, then we don't need to do anything, file will be overwritten automatically, if we have /, then we should copy it into given directory.+XCheck existence of directory and perform actions according to given configuration. See *, overall behavior is the same.,”Move specified file to another location. File can be moved either by copying or by renaming, exact method is determined by supplied configuration.-æMove 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 supplied configuration..!Copy file to new location. Throw ' if it does not exist./cCopy 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.0=Perform specified 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 check, ConfigurationOriginal location Where to move- ConfigurationOriginal location Where to move.Original locationWhere to put copy of the file/Original location"Where to put copy of the directory0  ()*+,-./01      ! " #$%&'()*+,-,./012345678planb_DImZdlcBVOMAUeNvIGsLUrSystem.PlanB.Type System.PlanBSystem.Directory openTempFileCanHandleExistingoverrideIfExists useIfExistshowHandleExistingHasTemptempDir nameTemplatepreserveCorpsemoveByRenaming getTempDirgetNameTemplategetPreserveCorpsegetMoveByRenamingPbConfigAlreadyExistsBehavior AebOverrideAebUseSubjectNewExisting withNewFilewithExistingFile withNewDirwithExistingDirwithNewContainerwithExistingContainerbaseGHC.BaseMonoidmappendmempty pbcTempDirpbcNameTemplatepbcPreserveCorpsepbcMoveByRenamingpbcAlreadyExists$fCanHandleExistingPbConfig$fHasTempPbConfig$fMonoidPbConfigSystem.IO.ErroralreadyExistsErrorTypedoesNotExistErrorType withTempDirconstructFilePathcheckExistenceOfFilecheckExistenceOfDirmoveFilemoveDircopyFilecopyDirignoringIOErrors