polysemy-wire-zoo-0.1.0: Polysemy interface for various libraries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Wire.Sem.Now

Synopsis

Documentation

data Now m a where Source #

Constructors

Get :: Now m UTCTime 

Instances

Instances details
GenericK (Now m a :: Type) Source # 
Instance details

Defined in Wire.Sem.Now

Associated Types

type RepK (Now m a) :: LoT k -> Type Source #

Methods

fromK :: forall (x :: LoT k). (Now m a :@@: x) -> RepK (Now m a) x Source #

toK :: forall (x :: LoT k). RepK (Now m a) x -> Now m a :@@: x Source #

GenericK (Now :: k -> Type -> Type) Source # 
Instance details

Defined in Wire.Sem.Now

Associated Types

type RepK Now :: LoT k -> Type Source #

Methods

fromK :: forall (x :: LoT k0). (Now :@@: x) -> RepK Now x Source #

toK :: forall (x :: LoT k0). RepK Now x -> Now :@@: x Source #

GenericK (Now m :: Type -> Type) Source # 
Instance details

Defined in Wire.Sem.Now

Associated Types

type RepK (Now m) :: LoT k -> Type Source #

Methods

fromK :: forall (x :: LoT k). (Now m :@@: x) -> RepK (Now m) x Source #

toK :: forall (x :: LoT k). RepK (Now m) x -> Now m :@@: x Source #

Show (Now m a) Source # 
Instance details

Defined in Wire.Sem.Now

Methods

showsPrec :: Int -> Now m a -> ShowS #

show :: Now m a -> String #

showList :: [Now m a] -> ShowS #

type RepK (Now m a :: Type) Source # 
Instance details

Defined in Wire.Sem.Now

type RepK (Now m a :: Type) = D1 ('MetaData "Now" "Wire.Sem.Now" "polysemy-wire-zoo-0.1.0-KbrNpKceVPG5WwaWfDjhTl" 'False) (C1 ('MetaCons "Get" 'PrefixI 'False) (('Kon (a ~~ UTCTime) :: Atom Type Constraint) :=>: (U1 :: LoT Type -> Type)))
type RepK (Now :: k -> Type -> Type) Source # 
Instance details

Defined in Wire.Sem.Now

type RepK (Now :: k -> Type -> Type) = D1 ('MetaData "Now" "Wire.Sem.Now" "polysemy-wire-zoo-0.1.0-KbrNpKceVPG5WwaWfDjhTl" 'False) (C1 ('MetaCons "Get" 'PrefixI 'False) (((('Kon ((~~) :: Type -> Type -> Constraint) :: Atom (k -> Type -> Type) (Type -> Type -> Constraint)) ':@: (Var1 :: Atom (k -> Type -> Type) Type)) ':@: ('Kon UTCTime :: Atom (k -> Type -> Type) Type)) :=>: (U1 :: LoT (k -> Type -> Type) -> Type)))
type RepK (Now m :: Type -> Type) Source # 
Instance details

Defined in Wire.Sem.Now

type RepK (Now m :: Type -> Type) = D1 ('MetaData "Now" "Wire.Sem.Now" "polysemy-wire-zoo-0.1.0-KbrNpKceVPG5WwaWfDjhTl" 'False) (C1 ('MetaCons "Get" 'PrefixI 'False) (((('Kon ((~~) :: Type -> Type -> Constraint) :: Atom (Type -> Type) (Type -> Type -> Constraint)) ':@: (Var0 :: Atom (Type -> Type) Type)) ':@: ('Kon UTCTime :: Atom (Type -> Type) Type)) :=>: (U1 :: LoT (Type -> Type) -> Type)))

get :: forall r. Member Now r => Sem r UTCTime Source #

boolTTL Source #

Arguments

:: forall t r a. (Member Now r, Ord t, FromUTC t) 
=> a

The value to return if the TTL is expired

-> a

The value to return if the TTL is alive

-> t 
-> Sem r a 

Check a time against Now, checking if it's still alive (hasn't occurred yet.)