packages feed

futhask-base 0.1.0.0 → 0.2.0.0

raw patch · 3 files changed

+7/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Futhask.Object: loadM :: (MonadTrans t, Serializable (t IO) a) => FilePath -> t IO (Maybe a)
- Futhask.Object: load :: (MonadTrans t, Serializable (t IO) a) => FilePath -> t IO (Maybe a)
+ Futhask.Object: load :: (MonadTrans t, Serializable (t IO) b) => FilePath -> t IO b

Files

ChangeLog.md view
@@ -1,3 +1,4 @@ # Changelog for futhask-base-+## 0.2.0+Change name of `load` to `loadM`, and add new `load` that emits error instead of wrapping in `Maybe`  ## Unreleased changes
futhask-base.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           futhask-base-version:        0.1.0.0+version:        0.2.0.0 stability:      experimental category:       FFI synopsis:       Base library for libraries generated by futhask
src/Futhask/Object.hs view
@@ -167,7 +167,10 @@ store fn a = encode a >>= lift . B.writeFile fn  -- | read object from file-load fn = lift (B.readFile fn) >>= decode +loadM fn = lift (B.readFile fn) >>= decode+load fn = loadM fn >>= \mo -> pure $ case mo of+    Nothing -> error (fn ++ " cannot be decoded.")+    Just o -> o  instance (FutharkOpaque fo, FutharkObject fo, ObjectContext fo ~ ctx, Monad m)     => Serializable (FutT ctx c m) (fo c) where