hw-polysemy-0.2.3.0: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageGHC2021

HaskellWorks.Polysemy.Hedgehog.Workspace

Synopsis

Documentation

workspace :: Member Hedgehog r => Member Log r => Member (Embed IO) r => Member (Error IOException) r => HasCallStack => FilePath -> (FilePath -> Sem r ()) -> Sem r () Source #

Create a workspace directory which will exist for at least the duration of the supplied block.

The directory will have the supplied prefix but contain a generated random suffix to prevent interference between tests

The directory will be deleted if the block succeeds, but left behind if the block fails.

moduleWorkspace :: Member Hedgehog r => Member Log r => Member (Embed IO) r => Member (Error IOException) r => String -> (FilePath -> Sem r ()) -> Sem r () Source #

Create a workspace directory which will exist for at least the duration of the supplied block.

The directory will have the prefix as "$prefixPath/$moduleName" but contain a generated random suffix to prevent interference between tests

The directory will be deleted if the block succeeds, but left behind if the block fails.

The prefix argument should not contain directory delimeters.