reflex-monad-auth-0.1.0.1: Utilities to split reflex app to authorized and not authorized contexts

Safe HaskellNone
LanguageHaskell2010

Reflex.Auth.Trans

Synopsis

Documentation

type AuthEnv t info = ExternalRef t (Maybe info) Source #

Environment for AuthT

newtype AuthT info t m a Source #

Monad that implements HasAuth with simple reader inside

Constructors

AuthT 

Fields

Instances
(Group q, Additive q, Query q, Eq q, MonadQuery t q m, Monad m) => MonadQuery t q (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

(Monoid w, BehaviorWriter t w m) => BehaviorWriter t w (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

tellBehavior :: Behavior t w -> AuthT info t m () #

(Monoid w, DynamicWriter t w m) => DynamicWriter t w (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

tellDyn :: Dynamic t w -> AuthT info t m () #

(Semigroup w, EventWriter t w m) => EventWriter t w (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

tellEvent :: Event t w -> AuthT info t m () #

MonadReader e m => MonadReader e (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

ask :: AuthT info t m e #

local :: (e -> e) -> AuthT info t m a -> AuthT info t m a #

reader :: (e -> a) -> AuthT info t m a #

MonadState s m => MonadState s (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

get :: AuthT info t m s #

put :: s -> AuthT info t m () #

state :: (s -> (a, s)) -> AuthT info t m a #

NotReady t m => NotReady t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

notReadyUntil :: Event t a -> AuthT info t m () #

notReady :: AuthT info t m () #

PerformEvent t m => PerformEvent t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Associated Types

type Performable (AuthT info t m) :: Type -> Type #

Methods

performEvent :: Event t (Performable (AuthT info t m) a) -> AuthT info t m (Event t a) #

performEvent_ :: Event t (Performable (AuthT info t m) ()) -> AuthT info t m () #

TriggerEvent t m => TriggerEvent t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

newTriggerEvent :: AuthT info t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: AuthT info t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> AuthT info t m (Event t a) #

Requester t m => Requester t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Associated Types

type Request (AuthT info t m) :: Type -> Type #

type Response (AuthT info t m) :: Type -> Type #

Methods

requesting :: Event t (Request (AuthT info t m) a) -> AuthT info t m (Event t (Response (AuthT info t m) a)) #

requesting_ :: Event t (Request (AuthT info t m) a) -> AuthT info t m () #

PostBuild t m => PostBuild t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

getPostBuild :: AuthT info t m (Event t ()) #

Adjustable t m => Adjustable t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

runWithReplace :: AuthT info t m a -> Event t (AuthT info t m b) -> AuthT info t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> AuthT info t m v') -> IntMap v -> Event t (PatchIntMap v) -> AuthT info t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> AuthT info t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> AuthT info t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> AuthT info t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> AuthT info t m (DMap k v', Event t (PatchDMapWithMove k v')) #

(Eq info, Reflex t, MonadIO m, MonadHold t m, MonadFix m, Adjustable t m) => HasAuth t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Associated Types

type AuthInfo t (AuthT info t m) :: Type Source #

Methods

getAuthInfoRef :: AuthT info t m (ExternalRef t (Maybe (AuthInfo t (AuthT info t m)))) Source #

liftAuth :: AuthT info t m a -> ReaderT (AuthedEnv t (AuthT info t m)) (AuthT info t m) a -> AuthT info t m (Dynamic t a) Source #

MonadSample t m => MonadSample (t :: Type) (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

sample :: Behavior t a -> AuthT info t m a #

MonadHold t m => MonadHold (t :: Type) (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

hold :: a -> Event t a -> AuthT info t m (Behavior t a) #

holdDyn :: a -> Event t a -> AuthT info t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> AuthT info t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> AuthT info t m (Dynamic t a) #

headE :: Event t a -> AuthT info t m (Event t a) #

MonadTrans (AuthT info t) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

lift :: Monad m => m a -> AuthT info t m a #

Monad m => Monad (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

(>>=) :: AuthT info t m a -> (a -> AuthT info t m b) -> AuthT info t m b #

(>>) :: AuthT info t m a -> AuthT info t m b -> AuthT info t m b #

return :: a -> AuthT info t m a #

fail :: String -> AuthT info t m a #

Functor m => Functor (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

fmap :: (a -> b) -> AuthT info t m a -> AuthT info t m b #

(<$) :: a -> AuthT info t m b -> AuthT info t m a #

MonadFix m => MonadFix (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

mfix :: (a -> AuthT info t m a) -> AuthT info t m a #

Applicative m => Applicative (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

pure :: a -> AuthT info t m a #

(<*>) :: AuthT info t m (a -> b) -> AuthT info t m a -> AuthT info t m b #

liftA2 :: (a -> b -> c) -> AuthT info t m a -> AuthT info t m b -> AuthT info t m c #

(*>) :: AuthT info t m a -> AuthT info t m b -> AuthT info t m b #

(<*) :: AuthT info t m a -> AuthT info t m b -> AuthT info t m a #

MonadIO m => MonadIO (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

liftIO :: IO a -> AuthT info t m a #

MonadJSM m => MonadJSM (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Methods

liftJSM' :: JSM a -> AuthT info t m a #

Generic (AuthT info t m a) Source # 
Instance details

Defined in Reflex.Auth.Trans

Associated Types

type Rep (AuthT info t m a) :: Type -> Type #

Methods

from :: AuthT info t m a -> Rep (AuthT info t m a) x #

to :: Rep (AuthT info t m a) x -> AuthT info t m a #

type AuthInfo t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

type AuthInfo t (AuthT info t m) = info
type Performable (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

type Performable (AuthT info t m) = Performable (ReaderT (AuthEnv t info) m)
type Response (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

type Response (AuthT info t m) = Response (ReaderT (AuthEnv t info) m)
type Request (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

type Request (AuthT info t m) = Request (ReaderT (AuthEnv t info) m)
type Rep (AuthT info t m a) Source # 
Instance details

Defined in Reflex.Auth.Trans

type Rep (AuthT info t m a) = D1 (MetaData "AuthT" "Reflex.Auth.Trans" "reflex-monad-auth-0.1.0.1-inplace" True) (C1 (MetaCons "AuthT" PrefixI True) (S1 (MetaSel (Just "unAuthT") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (ReaderT (AuthEnv t info) m a))))

newAuthEnv :: (Reflex t, TriggerEvent t m, MonadIO m) => m (AuthEnv t info) Source #

Allocate new authorization environment that is not logged by default

runAuthT :: AuthT info t m a -> AuthEnv t info -> m a Source #

Execute widget with authorization logic with given environment.

runAuth :: (Reflex t, TriggerEvent t m, MonadIO m) => AuthT info t m a -> m a Source #

Simplified version of runAuthT