diff options
author | Paul Oliver <contact@pauloliver.dev> | 2025-08-27 04:10:47 +0000 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2025-08-27 04:17:18 +0000 |
commit | ec1a6fba4c944d95edb2397b47b6cebc59e2758d (patch) | |
tree | 48e4eccaa30f6607ceac01e1f97007b8d39f0f00 /hsm-cam/Hsm/Cam.hs | |
parent | 3806bd1f5ce56afdbb4cc0c1ed54d53e25603be2 (diff) |
Moves commonly used `bracket` combinators into separate module
Diffstat (limited to 'hsm-cam/Hsm/Cam.hs')
-rw-r--r-- | hsm-cam/Hsm/Cam.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hsm-cam/Hsm/Cam.hs b/hsm-cam/Hsm/Cam.hs index c82cdd7..fe17057 100644 --- a/hsm-cam/Hsm/Cam.hs +++ b/hsm-cam/Hsm/Cam.hs @@ -44,6 +44,7 @@ import Hsm.Cam.FFI , stopCamera , stopCameraManager ) +import Hsm.Core.Bracket (bracketConst, bracketLiftIO_) import Hsm.Log (Log, Severity(Attention, Info, Trace), getLevel, logMsg, makeLoggerIO) import MMAP (mapShared, mkMmapFlags, mmap, munmap, protRead) import System.Directory (doesFileExist, removeFile) @@ -127,8 +128,6 @@ runCam action = do . bracketLiftIO_ createRequest (return ()) . bracket mapDmaBuffer unmapDmaBuffer $ \dmaBuffer -> evalStaticRep (Cam Rep {..}) action where - bracketConst alloc dealloc = bracket alloc dealloc . const - bracketLiftIO_ alloc dealloc = bracket_ (liftIO alloc) (liftIO dealloc) loggerAlloc = do logMsg @"cam" Info "Registering FFI logger" loggerIO <- makeLoggerIO @"cam" |