include YesodPersist in get404 type signature

This commit is contained in:
Greg Weber 2014-01-16 22:21:55 -08:00
parent dfcbe249e4
commit 66af962af8

View File

@ -122,19 +122,19 @@ respondSourceDB :: YesodPersistRunner site
-> HandlerT site IO TypedContent -> HandlerT site IO TypedContent
respondSourceDB ctype = respondSource ctype . runDBSource respondSourceDB ctype = respondSource ctype . runDBSource
-- | Get the given entity by ID, or return a 404 not found if it doesn't exist. -- | Get the given entity by ID, or return a 404 not found if it doesn't exist.
get404 :: ( PersistStore (t m) get404 :: ( PersistEntity record
, PersistEntity val
, Monad (t m)
, m ~ HandlerT site IO , m ~ HandlerT site IO
, MonadTrans t , db ~ YesodPersistBackend site
, PersistMonadBackend (t m) ~ PersistEntityBackend val , PersistStore (db m)
) , YesodPersist site
=> Key val -> t m val , PersistMonadBackend (db m) ~ PersistEntityBackend record
) => Key record -> HandlerT site IO record
get404 key = do get404 key = do
mres <- get key mres <- runDB $ get key
case mres of case mres of
Nothing -> notFound' Nothing -> notFound
Just res -> return res Just res -> return res
-- | Get the given entity by unique key, or return a 404 not found if it doesn't -- | Get the given entity by unique key, or return a 404 not found if it doesn't