From a0c172c871f404f268850fd22ef90268576b0cc6 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 28 Aug 2025 13:37:39 +0000 Subject: Enforces not using `IOE` on `test-cam` application code --- hsm-cam/Test/Cam.hs | 9 +++++---- hsm-cam/hsm-cam.cabal | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hsm-cam/Test/Cam.hs b/hsm-cam/Test/Cam.hs index fc56b6c..5c8daf5 100644 --- a/hsm-cam/Test/Cam.hs +++ b/hsm-cam/Test/Cam.hs @@ -1,11 +1,12 @@ import Control.Monad (forM_) -import Data.ByteString.Lazy (writeFile) -import Effectful (liftIO, runEff) +import Effectful (runEff) +import Effectful.FileSystem (runFileSystem) +import Effectful.FileSystem.IO.ByteString.Lazy (writeFile) import Hsm.Cam (capturePng, runCam) import Hsm.Log (Severity(Info, Trace), runLog) import Prelude hiding (writeFile) main :: IO () main = - runEff . runLog @"cam" Trace . runLog @"libcamera" Info . runCam . forM_ [0 .. 31] $ \index -> - capturePng >>= liftIO . writeFile ("/tmp/hsm-cam-test" <> show @Int index <> ".png") + runEff . runFileSystem . runLog @"cam" Trace . runLog @"libcamera" Info . runCam . forM_ [0 .. 31] $ \index -> + capturePng >>= writeFile ("/tmp/hsm-cam-test" <> show @Int index <> ".png") diff --git a/hsm-cam/hsm-cam.cabal b/hsm-cam/hsm-cam.cabal index fe767cb..892a5fe 100644 --- a/hsm-cam/hsm-cam.cabal +++ b/hsm-cam/hsm-cam.cabal @@ -43,6 +43,7 @@ executable test-cam , base , bytestring , directory + , effectful , effectful-core , effectful-plugin , hsm-core -- cgit v1.2.1