You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building against stackage lts-18.1 (persistent-2.13.1.1),
monad-persist fails to build with multiple errors similar to the issue title.
These type classes were introduced by persistent>=2.10.0;
my guess is that the breakage was also introduced by this version.
Error when building monad-persist with persistent>=2.10.0
monad-persist > configuremonad-persist > Configuring monad-persist-0.0.3.0...monad-persist > buildmonad-persist > Preprocessing library for monad-persist-0.0.3.0..monad-persist > Building library for monad-persist-0.0.3.0..monad-persist > [1 of 2] Compiling Control.Monad.Persistmonad-persist >monad-persist > /run/user/1000/stack-62874c5080fdde7f/monad-persist-0.0.3.0/library/Control/Monad/Persist.hs:435:31: error:monad-persist > • Could not deduce (Sql.OnlyOneUniqueKey record)monad-persist > arising from a use of ‘Sql.upsert’monad-persist > from the context: MonadBaseControl IO mmonad-persist > bound by the instance declarationmonad-persist > at library/Control/Monad/Persist.hs:415:10-75monad-persist > or from: (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend)monad-persist > bound by the type signature for:monad-persist > upsert :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> [Update record] -> PersistT backend m (Entity record)monad-persist > at library/Control/Monad/Persist.hs:435:3-8monad-persist > Possible fix:monad-persist > add (Sql.OnlyOneUniqueKey record) to the context ofmonad-persist > the type signature for:monad-persist > upsert :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> [Update record] -> PersistT backend m (Entity record)monad-persist > • In the second argument of ‘($)’, namely ‘Sql.upsert a b’monad-persist > In the expression: liftPersistT $ Sql.upsert a bmonad-persist > In an equation for ‘upsert’:monad-persist > upsert a b = liftPersistT $ Sql.upsert a bmonad-persist > |monad-persist > 435 | upsert a b = liftPersistT $ Sql.upsert a bmonad-persist > | ^^^^^^^^^^^^^^monad-persist >monad-persist > /run/user/1000/stack-62874c5080fdde7f/monad-persist-0.0.3.0/library/Control/Monad/Persist.hs:436:33: error:monad-persist > • Could not deduce (Sql.AtLeastOneUniqueKey record)monad-persist > arising from a use of ‘Sql.getByValue’monad-persist > from the context: MonadBaseControl IO mmonad-persist > bound by the instance declarationmonad-persist > at library/Control/Monad/Persist.hs:415:10-75monad-persist > or from: (PersistUniqueRead backend,monad-persist > PersistRecordBackend record backend)monad-persist > bound by the type signature for:monad-persist > getByValue :: forall record.monad-persist > (PersistUniqueRead backend, PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Maybe (Entity record))monad-persist > at library/Control/Monad/Persist.hs:436:3-12monad-persist > Possible fix:monad-persist > add (Sql.AtLeastOneUniqueKey record) to the context ofmonad-persist > the type signature for:monad-persist > getByValue :: forall record.monad-persist > (PersistUniqueRead backend, PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Maybe (Entity record))monad-persist > • In the second argument of ‘($)’, namely ‘Sql.getByValue a’monad-persist > In the expression: liftPersistT $ Sql.getByValue amonad-persist > In an equation for ‘getByValue’:monad-persist > getByValue a = liftPersistT $ Sql.getByValue amonad-persist > |monad-persist > 436 | getByValue a = liftPersistT $ Sql.getByValue amonad-persist > | ^^^^^^^^^^^^^^^^monad-persist >monad-persist > /run/user/1000/stack-62874c5080fdde7f/monad-persist-0.0.3.0/library/Control/Monad/Persist.hs:437:31: error:monad-persist > • Could not deduce (Sql.AtLeastOneUniqueKey record)monad-persist > arising from a use of ‘Sql.insertBy’monad-persist > from the context: MonadBaseControl IO mmonad-persist > bound by the instance declarationmonad-persist > at library/Control/Monad/Persist.hs:415:10-75monad-persist > or from: (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend)monad-persist > bound by the type signature for:monad-persist > insertBy :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Either (Entity record) (Key record))monad-persist > at library/Control/Monad/Persist.hs:437:3-10monad-persist > Possible fix:monad-persist > add (Sql.AtLeastOneUniqueKey record) to the context ofmonad-persist > the type signature for:monad-persist > insertBy :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Either (Entity record) (Key record))monad-persist > • In the second argument of ‘($)’, namely ‘Sql.insertBy a’monad-persist > In the expression: liftPersistT $ Sql.insertBy amonad-persist > In an equation for ‘insertBy’:monad-persist > insertBy a = liftPersistT $ Sql.insertBy amonad-persist > |monad-persist > 437 | insertBy a = liftPersistT $ Sql.insertBy amonad-persist > | ^^^^^^^^^^^^^^monad-persist >monad-persist > /run/user/1000/stack-62874c5080fdde7f/monad-persist-0.0.3.0/library/Control/Monad/Persist.hs:440:33: error:monad-persist > • Could not deduce (Sql.OnlyOneUniqueKey record)monad-persist > arising from a use of ‘Sql.onlyUnique’monad-persist > from the context: MonadBaseControl IO mmonad-persist > bound by the instance declarationmonad-persist > at library/Control/Monad/Persist.hs:415:10-75monad-persist > or from: (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend)monad-persist > bound by the type signature for:monad-persist > onlyUnique :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Unique record)monad-persist > at library/Control/Monad/Persist.hs:440:3-12monad-persist > Possible fix:monad-persist > add (Sql.OnlyOneUniqueKey record) to the context ofmonad-persist > the type signature for:monad-persist > onlyUnique :: forall record.monad-persist > (PersistUniqueWrite backend,monad-persist > PersistRecordBackend record backend) =>monad-persist > record -> PersistT backend m (Unique record)monad-persist > • In the second argument of ‘($)’, namely ‘Sql.onlyUnique a’monad-persist > In the expression: liftPersistT $ Sql.onlyUnique amonad-persist > In an equation for ‘onlyUnique’:monad-persist > onlyUnique a = liftPersistT $ Sql.onlyUnique amonad-persist > |monad-persist > 440 | onlyUnique a = liftPersistT $ Sql.onlyUnique amonad-persist > | ^^^^^^^^^^^^^^^^monad-persist >
Adding the suggested constraints allows the package to compile (patch).
I don't know the package well-enough so I can't really say whether this fixes
the issue, other than tests pass (patch required to make the tests pass).
PS: lts-16.31 (persistent-2.10.5.3) is also broken.
The text was updated successfully, but these errors were encountered:
When building against stackage lts-18.1 (persistent-2.13.1.1),
monad-persist fails to build with multiple errors similar to the issue title.
These type classes were introduced by
persistent>=2.10.0
;my guess is that the breakage was also introduced by this version.
Error when building monad-persist with persistent>=2.10.0
Adding the suggested constraints allows the package to compile (patch).
I don't know the package well-enough so I can't really say whether this fixes
the issue, other than tests pass (patch required to make the tests pass).
PS: lts-16.31 (persistent-2.10.5.3) is also broken.
The text was updated successfully, but these errors were encountered: