Module
Pinto.GenStatem
- Package
- erl-pinto
- Repository
- id3as/purescript-erl-pinto
This module represents gen_statem in OTP
See also gen_statem in the OTP docs (https://erlang.org/doc/man/gen_statem.html)
Note: This module is largely undocumented and is in alpha at the current time
it works largely like Pinto.GenServer
, but with even more types
#StatemType Source
newtype StatemType info internal timerName timerContent commonData stateId state
#StatemPid Source
newtype StatemPid info internal timerName timerContent commonData stateId state
Instances
HasPid (StatemPid info internal timerName timerContent commonData stateId state)
HasProcess info (StatemPid info internal timerName timerContent commonData stateId state)
#StatemRef Source
type StatemRef info internal timerName timerContent commonData stateId state = RegistryReference (StatemPid info internal timerName timerContent commonData stateId state) (StatemType info internal timerName timerContent commonData stateId state)
#SupportsReply Source
class SupportsReply builder where
Members
Instances
SupportsReply (InitActionsBuilder info internal timerName timerContent)
SupportsReply (StateEnterActionsBuilder timerName timerContent)
SupportsReply (EventActionsBuilder info internal timerName timerContent)
#SupportsAddTimeout Source
class SupportsAddTimeout :: (Type -> Type) -> Type -> Constraint
class SupportsAddTimeout builder timerContent where
Members
addTimeoutAction :: TimeoutAction timerContent -> builder timerContent -> builder timerContent
Instances
SupportsAddTimeout (InitActionsBuilder info internal timerName) timerContent
SupportsAddTimeout (StateEnterActionsBuilder timerName) timerContent
#SupportsNextEvent Source
class SupportsNextEvent builder event | builder -> event where
Members
addNextEvent :: event -> builder -> builder
Instances
SupportsNextEvent (InitActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
SupportsNextEvent (EventActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
#SupportsSelf Source
class SupportsSelf :: (Type -> Type -> Type -> Type -> Type -> Type -> Type -> (Type -> Type) -> Type -> Type) -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Constraint
class SupportsSelf context info internal timerName timerContent commonData stateId state where
Members
self :: context info internal timerName timerContent commonData stateId state Effect (StatemPid info internal timerName timerContent commonData stateId state)
Instances
SupportsSelf InitT info internal timerName timerContent commonData stateId state
SupportsSelf StateEnterT info internal timerName timerContent commonData stateId state
SupportsSelf EventT info internal timerName timerContent commonData stateId state
#SupportsNewActions Source
class SupportsNewActions builder where
Members
newActions :: builder
Instances
SupportsNewActions (InitActionsBuilder info internal timerName timerContent)
SupportsNewActions (StateEnterActionsBuilder timerName timerContent)
SupportsNewActions (EventActionsBuilder info internal timerName timerContent)
#DownReason Source
data DownReason
#InitResult Source
data InitResult info internal timerName timerContent commonData state
Constructors
InitOk state commonData
InitOkWithActions state commonData (InitActionsBuilder info internal timerName timerContent)
InitStop Foreign
InitIgnore
#InitT Source
newtype InitT :: forall k1 k2 k3 k4 k5 k6 k7. k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> (Type -> Type) -> Type -> Type
newtype InitT info internal timerName timerContent commonData stateId state m a
Instances
Functor (InitT info internal timerName timerContent commonData stateId state Effect)
Apply (InitT info internal timerName timerContent commonData stateId state Effect)
Applicative (InitT info internal timerName timerContent commonData stateId state Effect)
Bind (InitT info internal timerName timerContent commonData stateId state Effect)
Monad (InitT info internal timerName timerContent commonData stateId state Effect)
MonadTrans (InitT info internal timerName timerContent commonData stateId state)
SupportsSelf InitT info internal timerName timerContent commonData stateId state
#InitActionsBuilder Source
newtype InitActionsBuilder info internal timerName timerContent
Constructors
InitActionsBuilder (List (EventAction info internal timerName timerContent))
Instances
SupportsNewActions (InitActionsBuilder info internal timerName timerContent)
SupportsReply (InitActionsBuilder info internal timerName timerContent)
SupportsAddTimeout (InitActionsBuilder info internal timerName) timerContent
SupportsNextEvent (InitActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
ExportsTo (InitActionsBuilder a b c d) (List NativeAction)
#EventAction Source
data EventAction info internal timerName timerContent
Constructors
CommonAction (CommonAction timerName timerContent)
Postpone
NextEvent (Event info internal timerName timerContent)
Instances
ExportsTo (EventAction a b c d) NativeAction
#CommonAction Source
data CommonAction timerName timerContent
Constructors
Hibernate
TimeoutAction (TimeoutAction timerContent)
NamedTimeoutAction (NamedTimeoutAction timerName timerContent)
ReplyAction Reply
Instances
#EventFn Source
type EventFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Type
type EventFn info internal timerName timerContent commonData stateId state = state -> commonData -> EventT info internal timerName timerContent commonData stateId state Effect (EventResult info internal timerName timerContent commonData state)
#EventResult Source
data EventResult info internal timerName timerContent commonData state
Constructors
EventKeepStateAndData
EventKeepStateAndDataWithActions (EventActionsBuilder info internal timerName timerContent)
EventKeepState commonData
EventKeepStateWithActions commonData (EventActionsBuilder info internal timerName timerContent)
EventNextState state commonData
EventNextStateWithActions state commonData (EventActionsBuilder info internal timerName timerContent)
EventStopNormal
#TerminateFn Source
type TerminateFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Type
type TerminateFn info internal timerName timerContent commonData stateId state = ShutdownReason -> state -> commonData -> EventT info internal timerName timerContent commonData stateId state Effect Unit
#EventT Source
newtype EventT :: forall k1 k2 k3 k4 k5 k6 k7. k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> (Type -> Type) -> Type -> Type
newtype EventT info internal timerName timerContent commonData stateId state m a
Instances
Functor (EventT info internal timerName timerContent commonData stateId state Effect)
Apply (EventT info internal timerName timerContent commonData stateId state Effect)
Applicative (EventT info internal timerName timerContent commonData stateId state Effect)
Bind (EventT info internal timerName timerContent commonData stateId state Effect)
Monad (EventT info internal timerName timerContent commonData stateId state Effect)
MonadTrans (EventT info internal timerName timerContent commonData stateId state)
SupportsSelf EventT info internal timerName timerContent commonData stateId state
#EventActionsBuilder Source
newtype EventActionsBuilder info internal timerName timerContent
Instances
SupportsNewActions (EventActionsBuilder info internal timerName timerContent)
SupportsReply (EventActionsBuilder info internal timerName timerContent)
SupportsNextEvent (EventActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
ExportsTo (EventActionsBuilder a b c d) (List NativeAction)
#EnterFn Source
type EnterFn :: forall k1 k2. k1 -> k2 -> Type -> Type -> Type -> Type -> Type -> Type
type EnterFn info internal timerName timerContent commonData stateId state = stateId -> stateId -> state -> commonData -> StateEnterT info internal timerName timerContent commonData stateId state Effect (StateEnterResult timerName timerContent commonData)
#StateEnterResult Source
data StateEnterResult timerName timerContent commonData
Constructors
StateEnterOk commonData
StateEnterOkWithActions commonData (StateEnterActionsBuilder timerName timerContent)
StateEnterKeepData
StateEnterKeepDataWithActions (StateEnterActionsBuilder timerName timerContent)
#StateEnterT Source
newtype StateEnterT :: forall k1 k2 k3 k4 k5 k6 k7. k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> (Type -> Type) -> Type -> Type
newtype StateEnterT info internal timerName timerContent commonData stateId state m a
Instances
Functor (StateEnterT info internal timerName timerContent commonData stateId state Effect)
Apply (StateEnterT info internal timerName timerContent commonData stateId state Effect)
Applicative (StateEnterT info internal timerName timerContent commonData stateId state Effect)
Bind (StateEnterT info internal timerName timerContent commonData stateId state Effect)
Monad (StateEnterT info internal timerName timerContent commonData stateId state Effect)
MonadTrans (StateEnterT info internal timerName timerContent commonData stateId state)
SupportsSelf StateEnterT info internal timerName timerContent commonData stateId state
#StateEnterActionsBuilder Source
newtype StateEnterActionsBuilder timerName timerContent
Instances
SupportsNewActions (StateEnterActionsBuilder timerName timerContent)
SupportsReply (StateEnterActionsBuilder timerName timerContent)
SupportsAddTimeout (StateEnterActionsBuilder timerName) timerContent
ExportsTo (StateEnterActionsBuilder a b) (List NativeAction)
#TimeoutAction Source
data TimeoutAction timerContent
Constructors
SetTimeout (Timeout timerContent)
SetStateTimeout (Timeout timerContent)
UpdateTimeout timerContent
UpdateStateTimeout timerContent
Instances
#NamedTimeoutAction Source
data NamedTimeoutAction timerName timerContent
Constructors
SetNamedTimeout timerName (Timeout timerContent)
UpdateNamedTimeout timerName timerContent
CancelNamedTimeout
#Event Source
data Event info internal timerName timerContent
Constructors
EventInfo info
EventInternal internal
EventTimeout timerContent
EventNamedTimeout timerName timerContent
EventStateTimeout timerContent
Instances
SupportsNextEvent (InitActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
SupportsNextEvent (EventActionsBuilder info internal timerName timerContent) (Event info internal timerName timerContent)
ExportsTo (Event a b c d) NativeAction
#Spec Source
type Spec info internal timerName timerContent commonData stateId state = { getStateId :: state -> stateId, handleEnter :: Maybe (EnterFn info internal timerName timerContent commonData stateId state), handleEvent :: HandleEventFn info internal timerName timerContent commonData stateId state, init :: InitFn info internal timerName timerContent commonData stateId state, name :: Maybe (RegistryName (StatemType info internal timerName timerContent commonData stateId state)), terminate :: Maybe (TerminateFn info internal timerName timerContent commonData stateId state), trapExits :: Maybe (ExitMessage -> info) }
#startLink Source
startLink :: forall info internal timerName timerContent commonData stateId state. HasStateId stateId state => Spec info internal timerName timerContent commonData stateId state -> Effect (StartLinkResult (StatemPid info internal timerName timerContent commonData stateId state))
#procLibStartLink Source
procLibStartLink :: forall info internal timerName timerContent commonData stateId state. HasStateId stateId state => Spec info internal timerName timerContent commonData stateId state -> Effect (StartLinkResult (StatemPid info internal timerName timerContent commonData stateId state))
#defaultSpec Source
defaultSpec :: forall info internal timerName timerContent commonData stateId state. HasStateId stateId state => InitFn info internal timerName timerContent commonData stateId state -> HandleEventFn info internal timerName timerContent commonData stateId state -> Spec info internal timerName timerContent commonData stateId state
#call Source
call :: forall reply info internal timerName timerContent commonData stateId state. HasStateId stateId state => StatemRef info internal timerName timerContent commonData stateId state -> CallFn reply info internal timerName timerContent commonData stateId state -> Effect reply
#init Source
init :: forall info internal timerName timerContent commonData stateId state. EffectFn1 (Spec info internal timerName timerContent commonData stateId state) NativeInitResult
#handle_event Source
handle_event :: forall info internal timerName timerContent commonData stateId state. EffectFn4 Foreign Foreign stateId (OuterData info internal timerName timerContent commonData stateId state) NativeHandleEventResult
#NativeInitResult Source
data NativeInitResult :: Type
#NativeAction Source
data NativeAction :: Type
Instances
ExportsTo (InitActionsBuilder a b c d) (List NativeAction)
ExportsTo (EventActionsBuilder a b c d) (List NativeAction)
ExportsTo (StateEnterActionsBuilder a b) (List NativeAction)
ExportsTo (EventAction a b c d) NativeAction
ExportsTo (Event a b c d) NativeAction
ExportsTo (CommonAction a b) NativeAction
ExportsTo (TimeoutAction a) NativeAction
#NativeHandleEventResult Source
data NativeHandleEventResult :: Type
Re-exports from Control.Monad.Trans.Class
#lift Source
lift :: forall t m a. MonadTrans t => Monad m => m a -> t m a