polysemy-account-0.2.0.0: Account management with Servant and Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Account.Interpreter.Accounts

Description

 
Synopsis

Documentation

deletePreviousFailure :: Members [Store i (Account p), Stop AccountsError] r => Uid i (Account p) -> Sem r () Source #

Fail if the account name is already present in the store. If the account status is Creating, however, a previous attempt has failed critically and the account can be overwritten.

interpretAccounts :: forall e i p r. Show e => Member (Query AccountByName (Maybe (Uid i (Account p))) !! e) r => Member (Query (AuthForAccount i) [Uid i (AccountAuth i)] !! e) r => Members [Password, Store i (Account p) !! e, Store i (AccountAuth i) !! e, Reader (AccountsConfig p) !! e, Id i] r => InterpreterFor (Accounts i p !! AccountsError) r Source #

Interpret Accounts using Store and Query from Polysemy.Db as the storage backend.

interpretAccountsState :: forall i p r. Ord i => Show i => Members [Log, Id i, Embed IO] r => AccountsConfig p -> [Uid i (Account p)] -> [Uid i (AccountAuth i)] -> InterpretersFor [Accounts i p !! AccountsError, Password] r Source #

Interpret Accounts and Password using AtomicState as storage backend.