packages feed

graphula 2.0.1.1 → 2.0.2.1

raw patch · 7 files changed

+40/−4 lines, 7 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Graphula: instance (Control.Monad.IO.Class.MonadIO m, GHC.Base.Applicative n, Control.Monad.IO.Class.MonadIO n) => Graphula.Class.MonadGraphulaFrontend (Graphula.GraphulaT n m)
+ Graphula: instance (Control.Monad.IO.Class.MonadIO m, Control.Monad.IO.Class.MonadIO n) => Graphula.Class.MonadGraphulaFrontend (Graphula.GraphulaT n m)
+ Graphula.Class: class (SafeToInsert a) => GraphulaSafeToInsert a
+ Graphula.Class: instance Database.Persist.Class.PersistEntity.SafeToInsert a => Graphula.Class.GraphulaSafeToInsert a
- Graphula: insert :: (MonadGraphulaFrontend m, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m) => Maybe (Key a) -> a -> m (Maybe (Entity a))
+ Graphula: insert :: (MonadGraphulaFrontend m, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m, GraphulaSafeToInsert a) => Maybe (Key a) -> a -> m (Maybe (Entity a))
- Graphula: node :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, GenerateKey a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a) => Dependencies a -> NodeOptions a -> m (Entity a)
+ Graphula: node :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, GenerateKey a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a, GraphulaSafeToInsert a) => Dependencies a -> NodeOptions a -> m (Entity a)
- Graphula: nodeKeyed :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a) => Key a -> Dependencies a -> NodeOptions a -> m (Entity a)
+ Graphula: nodeKeyed :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a, GraphulaSafeToInsert a) => Key a -> Dependencies a -> NodeOptions a -> m (Entity a)
- Graphula.Class: insert :: (MonadGraphulaFrontend m, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m) => Maybe (Key a) -> a -> m (Maybe (Entity a))
+ Graphula.Class: insert :: (MonadGraphulaFrontend m, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m, GraphulaSafeToInsert a) => Maybe (Key a) -> a -> m (Maybe (Entity a))
- Graphula.Node: node :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, GenerateKey a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a) => Dependencies a -> NodeOptions a -> m (Entity a)
+ Graphula.Node: node :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, GenerateKey a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a, GraphulaSafeToInsert a) => Dependencies a -> NodeOptions a -> m (Entity a)
- Graphula.Node: nodeKeyed :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a) => Key a -> Dependencies a -> NodeOptions a -> m (Entity a)
+ Graphula.Node: nodeKeyed :: forall a m. (MonadGraphula m, Logging m a, Arbitrary a, HasDependencies a, PersistEntityBackend a ~ SqlBackend, PersistEntity a, Typeable a, GraphulaSafeToInsert a) => Key a -> Dependencies a -> NodeOptions a -> m (Entity a)

Files

CHANGELOG.md view
@@ -1,6 +1,10 @@-## [*Unreleased*](https://github.com/freckle/graphula/compare/v2.0.1.1...main)+## [*Unreleased*](https://github.com/freckle/graphula/compare/v2.0.2.1...main)  None++## [v2.0.2.1](https://github.com/freckle/graphula/compare/v2.0.1.1...v2.0.2.1)++- Support persistent-2.14  ## [v2.0.1.1](https://github.com/freckle/graphula/compare/v2.0.0.5...v2.0.1.1) 
README.md view
@@ -21,6 +21,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-orphans #-}  module Main (module Main) where
graphula.cabal view
@@ -1,6 +1,6 @@ cabal-version:      1.12 name:               graphula-version:            2.0.1.1+version:            2.0.2.1 license:            MIT license-file:       LICENSE maintainer:         Freckle Education
src/Graphula.hs view
@@ -208,7 +208,7 @@   askGen = asks gen   logNode _ = pure () -instance (MonadIO m, Applicative n, MonadIO n) => MonadGraphulaFrontend (GraphulaT n m) where+instance (MonadIO m, MonadIO n) => MonadGraphulaFrontend (GraphulaT n m) where   insert mKey n = do     RunDB runDB <- asks dbRunner     lift . runDB $ case mKey of
src/Graphula/Class.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}@@ -14,6 +15,7 @@   ( MonadGraphula   , MonadGraphulaFrontend(..)   , MonadGraphulaBackend(..)+  , GraphulaSafeToInsert   ) where  import Control.Monad.IO.Class (MonadIO)@@ -22,13 +24,37 @@ import Database.Persist (Entity(..), Key, PersistEntity, PersistEntityBackend) import Database.Persist.Sql (SqlBackend) import Test.QuickCheck.Random (QCGen)+#if MIN_VERSION_persistent(2,14,0)+import Database.Persist.Class.PersistEntity (SafeToInsert)+#endif +-- | A class that provides backwards compatibility with @persistent-2.14@+--+-- If you are using that version or above, then this is a class alias for+-- 'SafeToInsert'. Otherwise, it is an identity alias.+--+class+#if MIN_VERSION_persistent(2,14,0)+    (SafeToInsert a) =>+#else+    () =>+#endif+    GraphulaSafeToInsert a++instance+#if MIN_VERSION_persistent(2,14,0)+    (SafeToInsert a) =>+#else+    () =>+#endif+    GraphulaSafeToInsert a+ type MonadGraphula m   = (Monad m, MonadIO m, MonadGraphulaBackend m, MonadGraphulaFrontend m)  class MonadGraphulaFrontend m where   insert-    :: (PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m)+    :: (PersistEntityBackend a ~ SqlBackend, PersistEntity a, Monad m, GraphulaSafeToInsert a)     => Maybe (Key a)     -> a     -> m (Maybe (Entity a))
src/Graphula/Node.hs view
@@ -114,6 +114,7 @@      , PersistEntityBackend a ~ SqlBackend      , PersistEntity a      , Typeable a+     , GraphulaSafeToInsert a      )   => Dependencies a   -> NodeOptions a@@ -134,6 +135,7 @@      , PersistEntityBackend a ~ SqlBackend      , PersistEntity a      , Typeable a+     , GraphulaSafeToInsert a      )   => Key a   -> Dependencies a@@ -150,6 +152,7 @@      , PersistEntityBackend a ~ SqlBackend      , PersistEntity a      , Typeable a+     , GraphulaSafeToInsert a      )   => m (Maybe (Key a))   -> Dependencies a@@ -179,6 +182,7 @@      , PersistEntityBackend a ~ SqlBackend      , PersistEntity a      , Typeable a+     , GraphulaSafeToInsert a      )   => Int   -> Int
test/README.lhs view
@@ -21,6 +21,7 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# OPTIONS_GHC -fno-warn-orphans #-}  module Main (module Main) where