packages feed

potoki-cereal 0.1 → 0.1.1

raw patch · 3 files changed

+40/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Potoki.Cereal.Consume: encodeToFile :: Serialize a => FilePath -> Consume a (Either IOException ())
+ Potoki.Cereal.Produce: directoryDecoded :: Serialize a => FilePath -> Produce (Either IOException (Either Text a))
+ Potoki.Cereal.Produce: fileDecoded :: Serialize a => FilePath -> Produce (Either IOException (Either Text a))

Files

+ library/Potoki/Cereal/Consume.hs view
@@ -0,0 +1,15 @@+module Potoki.Cereal.Consume+(+  encodeToFile,+)+where++import Potoki.Cereal.Prelude+import Potoki.Consume+import Potoki.Core.Transform+import qualified Potoki.Cereal.Transform as D+import qualified Data.Serialize as C+++encodeToFile :: C.Serialize a => FilePath -> Consume a (Either IOException ())+encodeToFile = transform D.encode . writeBytesToFile
+ library/Potoki/Cereal/Produce.hs view
@@ -0,0 +1,22 @@+module Potoki.Cereal.Produce+(+  fileDecoded,+  directoryDecoded,+)+where++import Potoki.Cereal.Prelude+import Potoki.Produce+import Potoki.Core.Transform+import qualified Potoki.Cereal.Transform as D+import qualified Data.Serialize as C+++fileDecoded :: C.Serialize a => FilePath -> Produce (Either IOException (Either Text a))+fileDecoded = transform (right D.decode) . fileBytes++directoryDecoded :: C.Serialize a => FilePath -> Produce (Either IOException (Either Text a))+directoryDecoded dirPath =+  transform+    (right (produce fileDecoded) >>^ join)+    (directoryContents dirPath)
potoki-cereal.cabal view
@@ -1,7 +1,7 @@ name:   potoki-cereal version:-  0.1+  0.1.1 synopsis:   Streaming serialization category:@@ -39,6 +39,8 @@   default-language:     Haskell2010   exposed-modules:+    Potoki.Cereal.Consume,+    Potoki.Cereal.Produce,     Potoki.Cereal.Transform   other-modules:     Potoki.Cereal.Prelude