generate select with Tagged
Opened this issue · 0 comments
jbrown215 commented
we need to generate select with Tagged. Here's the general template:
{-@ assume selectRECORDTagged :: forall <p :: User -> Bool>. f:[RefinedFilter<p> RECORD typ]
-> [SelectOpt RECORD]
-> Control.Monad.Trans.Reader.ReaderT backend m (Tagged<p> [Entity {v:RECORD | evalQsRECORD f v}]) @-}
selectRECORDTagged :: (PersistEntityBackend Friends ~ BaseBackend backend,
PersistEntity RECORD, Control.Monad.IO.Class.MonadIO m,
PersistQueryRead backend, PersistField typ) =>
[RefinedFilter RECORD typ]
-> [SelectOpt RECORD]
-> Control.Monad.Trans.Reader.ReaderT backend m (Tagged [Entity RECORD])
selectRECORDTagged fs ts = do
xs <- selectList (map toPersistentFilter fs) ts
return (Tagged xs)