aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-08-28 13:37:39 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-08-28 19:57:06 +0000
commita0c172c871f404f268850fd22ef90268576b0cc6 (patch)
treecedf100bafc7794bdb8cab516a597271715b61b3
parent0e7fd0dde11e1724de6ae40d77981b93ddb56ef8 (diff)
Enforces not using `IOE` on `test-cam` application code
-rw-r--r--hsm-cam/Test/Cam.hs9
-rw-r--r--hsm-cam/hsm-cam.cabal1
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