Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate select with Tagged #9

Open
jbrown215 opened this issue Apr 25, 2018 · 0 comments
Open

generate select with Tagged #9

jbrown215 opened this issue Apr 25, 2018 · 0 comments

Comments

@jbrown215
Copy link
Owner

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant