h*JsEI      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0.3.0.0 Safe-Inferred"9<> fs-simFile access errorfs-simA path ..a.. where a is a file rather than a dir4We record both the full path and the invalid suffix.fs-simA path ..a.. where a is a dir rather than a fileNo suffix is specified (it must be the last part of the file)fs-simA path ..a.. or ../a where directory or file a is missing4We record both the full path and the missing suffix.fs-sim?A file was opened with the O_EXCL flag, but it already existed.fs-sim0Simple in-memory representation of a file systemfs-simExamplefs-simMost general indexing functionfs-sim&alterDirMaybe might remove a directory fs-sim%Index the FsTree by the given FsPath. fs-simOpen a file: create it if necessary or throw an error if it existed already wile we were supposed to create it from scratch (when passed ).fs-sim=Replace the contents of the specified file (which must exist)fs-sim/Create a directory if it does not already existfs-sim?Create a directory and its parents if they do not already existfs-sim6Remove a directory (which must exist) and its contentsfs-sim Remove a file (which must exist)fs-simRename the file (which must exist) from the first path to the second path. If there is already a file at the latter path, it is replaced by the new one.fs-simTranslate to a treefs-simPath to look forfs-simAction on errorfs-simAlter the tree when foundfs-simAction on errorfs-simIf directory does not existfs-simIf directory existsfs-simAction on errorfs-simIf directory does not existfs-simIf directory existsfs-simAction on errorfs-simIf file does not existfs-simIf file existsfs-simAction on errorfs-simIf file does not existfs-simIf file exists     Safe-Inferred"%&/9< fs-sim/Monads in which we can simulate the file systemfs-sim File pointer'This is purely an internal abstraction.fs-simRead/write pointer=We record if we can read and/or write, and the current offsetfs-simAppend-only pointer3Offset is always the end of the file in append modefs-simMock handle internal statefs-sim Instantiate  with the mock handlefs-sim A mock handle to a file on disk.3This is only meaningful when interpreted against a !. fs-simWe store the files as an  of the file contentsfs-sim6Check whether the file handle is in write/append mode.%fs-simReturn  iff the handle is open.-Throws an exception if the handle is unknown.fs-simA set containing each file path that some open handle refers to.&fs-simNumber of open handlesfs-simUpdated file pointerWe lift this out as a separate concept primarily for the benefit of tests.See + for limitations.fs-sim1Modify the mock file system without a file handlefs-simAccess but do not modify the mock file system state without a file handlefs-sim9Require a file handle and may modify the mock file systemfs-sim?%#$%&9')0,-*(.+/12453678 "!;:<=>? Safe-Inferred1|Pfs-sim'Monad transformer that extends a monad m with pure features: (i) !$ state, and (ii) throwing/catching s.Rfs-sim6Mocked, monad transformer-based implementation of the  interface.4This implementation is pure when running in a monad m that is   ..This implementation runs in a primitive monad m extended with an P. monad transformer. It is recommended to use   or   instead because they hide the monad transformer. The caveat is that m should be IO-like.PQRPQR Safe-InferredKZfs-simAlternative to [ that creates TVar s internally.[fs-simEquip m with a HasFs$ instance using the mock file systemY[ZY[Z Safe-Inferred9)fs-simTag for \&s that describes whether it is either  definitely a finite stream, or possibly an infinite stream.Useful for the  instance of \ : when a \ is  definitely. finite, we can safely print the full stream.\fs-simA \ is a stream of  a s, which is possibly infinite or  definitely finite..Finiteness is tracked internally and used for  ing and the  instance.fs-sim"Info about the size of the stream.]fs-sim Advance the \ . Return the  a and the remaining \.Returns  by default if the \ is empty.^fs-simMake an empty \._fs-simMake a \! that always generates the given a.`fs-simMake a \( that infinitely repeats the given list.afs-simUNSAFE: Make a \% that is marked as definitely finite.This is unsafe since a user can pass in any list, and evaluating  or  on the resulting \ will diverge. It is the user's responsibility to only pass in a finite list.bfs-simMake a \% that is marked as possibly infinite.cfs-simReturn  if the stream is empty.A stream consisting of only :s (even if it is only one) is not considered to be empty.dfs-simShrink a stream like it is an .Possibly infinite streams are shrunk differently than lists that are definitely finite, which is to ensure that shrinking terminates. * Possibly infinite streams are shrunk by taking finite prefixes of the argument stream. As such, shrinking a possibly infinite stream creates definitely finite streams. * Definitely finite streams are shrunk like lists are shrunk normally, preserving that the created streams are still definitely finite.efs-simMake a  a generator based on an a generator.*Each element has a chance of being either ) or an element generated with the given a generator (wrapped in a ).1The first argument is the likelihood (as used by ) of a  where  has likelihood 2.ffs-simLike e, but with the likelihood of  fixed to 2. gfs-simGenerate a finite \ of length n.hfs-simGenerate an infinite \.ifs-simFully shows a \ if it is  definitely2 finite, or prints a placeholder string if it is possibly infinite.efs-simLikelihood of fs-simLikelihood of  affs-simLikelihood of  agfs-sim*Requested size of finite stream. Tip: use e.hfs-sim Tip: use e. \]_^b`acghefd \]_^b`acghefd Safe-Inferred %&D"kfs-sim%Error streams for the methods of the  type class.An $ is provided for each method of the  type class. This  will be used to generate potential errors that will be thrown by the corresponding method.For , an ErrorStreamWithCorruption% is provided to simulate corruption.An k is used in conjunction with  SimErrorFS, which is a layer on top of SimFS! that simulates methods throwing s.fs-sim2Model possible corruptions that could happen to a  call.fs-sim2The blob to write is substituted with corrupt junkfs-sim Only perform the write partiallyfs-simA  p, where p > 0, is a number representing how many fewer bytes should be read or written than requested.fs-sim for writing bytes to a file: an error and possibly some corruption, or a partial write.fs-sim: for reading bytes from a file: an error or a partial get.fs-simAn  is a possibly infinite \ of (Maybe) s." indicates that there is no error.Each time the  is used (see runErrorStream), the first element (; in case the list is empty) is taken from the list and an  with the remainder of the list is returned. The first element represents whether an error should be returned or not.An ! consists of a number of fields: , a , etc. Only the first fields is interesting. Therefore, we only generate the . The ' will be used to construct the actual .fs-simGiven a requested number of bytes to read/write, compute a partial number of bytes to read/write. We subtract p from the number of requested bytes. If that would result in 0 requested bytes or less, we request 1 byte. If the number of requested bytes was already 0, we can't simulate a partial read so we return 0 again.fs-simLike  , but for .fs-simGiven a bytestring that is requested to be written to disk, use ! to compute a partial bytestring.fs-sim Apply the  to the .If the bytestring is substituted by corrupt junk, then the output bytestring might% be larger than the input bytestring.fs-sim Apply the  to a .This either means that part of the bytes written to file are subsituted with junk, or that only part of the buffer will be written out to disk due to a partial write.With respect to junk substitution, the intent of this function is to model corruption of the bytes written to a file, not corruption of the in-memory buffer itself. As such, we don't corrupt the argument ' in place, but instead we return a new  that has the same contents plus some possible corruption. This ensures that the corruption is not visible to other parts of the program that use the same . Corruption will only be applied to the buffer at the the given , up to the requested . If there are not enough bytes in the bytearray, then corruption will only apply up until the end of the bytearray.With respect to partial writes, the function returns a new number of requested bytes, which is strictly smaller or equal to the input .NOTE: junk substitution and partial writes are mutually exclusive, and so this functions produces only one effect. Either the buffer contents are changed, or the  is reduced.fs-simShort-hand for the type of fs-simShort-hand for the type of fs-simShort-hand for the type of fs-simShort-hand for the type of fs-simReturn  if all streams are empty (null).fs-simUse the given * for each field/method. No corruption of .fs-simGenerator for k( that allows some things to be disabled.This is needed by the VolatileDB state machine tests, which try to predict what should happen based on the k!, which is too complex sometimes.fs-simAlternative to  that creates TVar s internally.fs-simIntroduce possibility of errorsfs-simRuns a computation provided an k and an initial !;, producing a result and the final state of the filesystem.fs-sim(Execute the next action using the given k.. After the action is finished, the previous k are restored.fs-sim0Advance to the next error in the stream of some  in the k stored in the ;. Extracts the right error stream from the state with the getter= and stores the advanced error stream in the state with the setter.fs-simExecute an action or throw an error, depending on the corresponding  (see  nextError).fs-sim Variant of  that works with s.-The path of the handle is retrieved from the ! using  handleFsPath.fs-simExecute the wrapped , throw an error, or simulate a partial read, depending on the corresponding  (see  nextError).fs-simIn the thread safe version of &, we simulate exactly the same errors.fs-simExecute the wrapped , throw an error and apply possible corruption to the blob to write, or simulate a partial write, depending on the corresponding  (see  nextError).fs-simExecute the wrapped , throw an error, or simulate a partial read, depending on the corresponding  (see  nextError).fs-simExecute the wrapped , throw an error, or simulate a partial read, depending on the corresponding  (see  nextError).fs-simExecute the wrapped , throw an error and apply possible corruption to the blob to write, or simulate a partial write, depending on the corresponding  (see  nextError).fs-simExecute the wrapped , throw an error and apply possible corruption to the blob to write, or simulate a partial write, depending on the corresponding  (see  nextError).fs-sim -> generate partial writesfs-sim -> generate  corruptionsfs-sim getterfs-sim setterfs-sim!The path for the error, if thrownfs-sim!Action in case no error is thrownfs-simExtra message for in the fs-sim getterfs-sim setterfs-sim!The path for the error, if thrownfs-sim!Action in case no error is thrownfs-simExtra message for in the fs-sim getterfs-sim setterfs-simWrapped fs-simWrapped fs-simWrapped 0klmnopqrstuvwxyz{|}~0klmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDE#$&FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef ghijklmnopqrstuuvwxyz{|}~ =KJIH;<%fs-sim-0.3.0.0-98Gu5SHMMLW4NP0bN7cbWHSystem.FS.Sim.FsTreeSystem.FS.Sim.MockFSSystem.FS.Sim.PrimSystem.FS.Sim.STMSystem.FS.Sim.StreamSystem.FS.Sim.Errorfs-simIO SeekFromEndControl.Monad.STSTsimHasFS simErrorHasFSTest.QuickCheckshrink InfiniteList FsTreeError FsExpectedDirFsExpectedFile FsMissingFsExistsFsTreeFileFolderexampleemptyindexgetFilegetDiropenFilereplacecreateDirIfMissingcreateDirWithParentsremoveDirRecursive removeFile renameFilefindpretty$fShowFsTreeError $fShowFsTree $fEqFsTree$fGenericFsTree$fFunctorFsTreeClosedHandleStateFilePtrOpenHandleState HandleState HandleMockFilesMockFS mockFiles handleIsOpennumOpenHandles dumpStatehOpenhClosehIsOpenhSeekhGetSome hGetSomeAthPutSome hTruncatehGetSizecreateDirectorycreateDirectoryIfMissing listDirectorydoesDirectoryExist doesFileExistremoveDirectoryRecursive intoBuffer fromBuffer hGetBufSome hGetBufSomeAt hPutBufSome hPutBufSomeAt $fFunctorSign$fGenericMockFS $fShowMockFS$fShowHandleState$fGenericHandleState$fShowClosedHandleState$fGenericClosedHandleState$fShowOpenHandleState$fGenericOpenHandleState $fShowFilePtr$fGenericFilePtr$fShowHandleMock$fEqHandleMock$fOrdHandleMock$fGenericHandleMock$fEnumHandleMockFSSimT runFSSimT primHasMockFS$fFunctorFSSimT$fApplicativeFSSimT $fMonadFSSimT$fMonadStateMockFSFSSimT$fMonadErrorFsErrorFSSimT$fPrimMonadFSSimTrunSimFS simHasFS'Stream runStreamalways repeatingunsafeMkFinite mkInfinitenull shrinkStreamgenMaybe genMaybe' genFinite genInfinite $fShowStream$fFunctorStreamErrors dumpStateEhOpenEhCloseEhSeekE hGetSomeE hGetSomeAtE hPutSomeE hTruncateE hGetSizeEcreateDirectoryEcreateDirectoryIfMissingElistDirectoryEdoesDirectoryExistEdoesFileExistEremoveDirectoryRecursiveE removeFileE renameFileE hGetBufSomeEhGetBufSomeAtE hPutBufSomeEhPutBufSomeAtE PutCorruptionSubstituteWithJunk PartialWriteBlobMkBlobgetBlobPartialErrorStreamPutSomeErrorStreamGetSome ErrorStreampartialiseByteCountpartialiseWord64partialiseByteStringblobToBS blobFromBScorruptByteString$fArbitraryPartial$fIsStringBlob$fArbitraryBlob$fArbitraryPutCorruption$fShowPutCorruption $fShowBlob $fShowPartialallNull emptyErrors simpleErrors genErrorssimErrorHasFS' runSimErrorFS withErrors$fArbitraryErrors $fShowErrorsalterF alterDirMaybe%fs-api-0.3.0.0-GFkzYC6REgYGzP4BeOuzdWSystem.FS.API.Types MustBeNewtoTreealterDiralterFileMaybe alterFileCanSimFSRWAppendHandle'Handle isWriteHandleghc-prim GHC.TypesTrue openFilePaths seekFilePtr modifyMockFS readMockFSwithHandleModifywithHandleReadwithOpenHandleModifywithOpenHandleReadFsInsufficientPermissionsFsResourceInappropriateTypeFsError System.FS.APIHasFS InternalInfobaseGHC.ShowShow GHC.MaybeMaybe*QuickCheck-2.15.0.1-JyXbAFb7UipIPAKrEhXkquTest.QuickCheck.Arbitrary_streamInternalInfoNothingshowJustTest.QuickCheck.Gen frequency FsErrorType fsErrorType fsErrorPathGHC.WordWord64bytestring-0.11.5.2Data.ByteString.Internal.Type ByteString corruptBufferData.Array.ByteMutableByteArray BufferOffsetSystem.Posix.Types ByteCount HPutBufSomeAt HPutBufSome HGetBufSomeAt HGetBufSomenext)strict-stm-1.5.0.0-G0TQC8fzqZw2lz0ptsBfjT-Control.Concurrent.Class.MonadSTM.Strict.TVar StrictTVarwithErrwithErr' hGetSome' hGetSomeAt' hPutSome'hGetBufSomeWithErrhGetBufSomeAtWithErrhPutBufSomeWithErrhPutBufSomeAtWithErr fsErrorString