Purify file operations
Factor out storeFile, unstoreFile, and verifyFile into a MTL style class. This class can provide its own Id type, and never returns FilePaths directly, which should allow a memory-only variant for testing purposes later. Control of storage ids now belongs to MonadFileStore. It was not really the place of the data layer (which is currently a set of SQL queries) to suddenly do one arbitrary file IO operation.
This commit is contained in:
parent
d2016d1863
commit
dd7a1b8970
11 changed files with 143 additions and 83 deletions
|
|
@ -13,6 +13,7 @@ default-extensions:
|
|||
- DerivingVia
|
||||
- ScopedTypeVariables
|
||||
- TypeApplications
|
||||
- TypeFamilies
|
||||
|
||||
ghc-options:
|
||||
- -Wall
|
||||
|
|
@ -45,10 +46,12 @@ library:
|
|||
- optparse-applicative
|
||||
- recursion-schemes
|
||||
- sqlite-simple
|
||||
- transformers
|
||||
exposed-modules:
|
||||
- CAStore.Command
|
||||
- CAStore.Command.Autocomplete
|
||||
- CAStore.Command.Type
|
||||
- CAStore.FileStore
|
||||
- CAStore.Config
|
||||
- CAStore.Config.CLI
|
||||
- CAStore.Config.Type
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue