classy-prelude-yesod 0.3.0 → 0.6.0
raw patch · 2 files changed
+4/−49 lines, 2 filesdep ~classy-preludedep ~classy-prelude-conduit
Dependency ranges changed: classy-prelude, classy-prelude-conduit
Files
- ClassyPrelude/Yesod.hs +1/−46
- classy-prelude-yesod.cabal +3/−3
ClassyPrelude/Yesod.hs view
@@ -3,11 +3,10 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} module ClassyPrelude.Yesod ( module X- , module ClassyPrelude.Yesod ) where import ClassyPrelude.Conduit as X hiding (lift)-import Yesod as X hiding (Header, insert, delete)+import Yesod as X hiding (Header) import qualified Yesod import Yesod.Static as X import Yesod.Feed as X@@ -17,47 +16,3 @@ import Database.Persist.Sql as X (SqlBackend, SqlPersistT) import Database.Persist.Sql as X (runMigration) import Data.Default as X (Default (..))--instance- ( backend ~ PersistMonadBackend m- , backend ~ PersistEntityBackend entity- , PersistStore m- , PersistEntity entity- , entity ~ entity'- ) => ClassyPrelude.Classes.CanInsert (entity -> m (KeyBackend backend entity')) where- insert = Yesod.insert---- | Non-typeclass insert for use with Persistent.------ If you don\'t use the @Key@ returned from @insert@, the type inferencing--- cannot tell which @insert@ function to use. Using @insertDB@ disambiguates.--- Another options is using 'voidKey'.------ Since 0.1.0.0-insertDB :: ( PersistStore m- , PersistEntity entity- , PersistMonadBackend m ~ PersistEntityBackend entity- )- => entity- -> m (Key entity)-insertDB = Yesod.insert---- | Ignore the @Key@ returned by insert.------ See 'insertDB' for more information. The following two lines are equivalent:------ > _ <- insertDB foo--- > voidKey $ insert foo------ Since 0.1.0.0-voidKey :: Functor m => m (KeyBackend backend entity) -> m ()-voidKey = void--instance- ( backend ~ PersistMonadBackend m- , backend ~ PersistEntityBackend entity- , PersistStore m- , PersistEntity entity- , a ~ ()- ) => ClassyPrelude.Classes.CanDelete (KeyBackend backend entity -> m a) where- delete = Yesod.delete
classy-prelude-yesod.cabal view
@@ -1,5 +1,5 @@ name: classy-prelude-yesod-version: 0.3.0+version: 0.6.0 synopsis: Provide a classy prelude including common Yesod functionality. description: This is an extension of classy-prelude-conduit, adding in commonly used functions and data types from Yesod. homepage: https://github.com/snoyberg/classy-prelude@@ -14,8 +14,8 @@ library exposed-modules: ClassyPrelude.Yesod build-depends: base >= 4 && < 5- , classy-prelude >= 0.5.3- , classy-prelude-conduit >= 0.5.3+ , classy-prelude >= 0.6+ , classy-prelude-conduit >= 0.6 , yesod >= 1.2 , yesod-newsfeed , yesod-static