I am trying to find persistence in a Yesod application. My model file contains
Job issuer MemberId addDate UTCTime lastDate UTCTime title Text description Text deriving Show Read
And my handler:
getProfileR :: Handler RepHtml getProfileR = do jobs <- runDB $ selectList [] [Desc JobAddDate] defaultLayout $ do setTitle "title" $(widgetFile "profile")
In profile.hamlet I go through objects
$forall Job issuer addDate lastDate title description <- jobs <p>
However, I get the following error
Handler/Profile.hs:36:18: Couldn't match type `Entity' with `JobGeneric' In the return type of a call of `selectList' In the second argument of `($)', namely `selectList [] [Desc JobAddDate]' In a stmt of a 'do' block: jobs <- runDB $ selectList [] [Desc JobAddDate] Handler/Profile.hs:36:18: Kind incompatibility when matching types: t0 :: (* -> *) -> * -> * JobGeneric Database.Persist.GenericSql.Raw.SqlPersist :: * In the return type of a call of `selectList' In the second argument of `($)', namely `selectList [] [Desc JobAddDate]' In a stmt of a 'do' block: jobs <- runDB $ selectList [] [Desc JobAddDate] Build failure, pausing...
If line 36 is runDB line.
Being new to Haskell, I can't figure out what happened. I follow the Book of Yesod. They unfortunately avoid the Forest Site, so I canβt completely simulate their code.
source share