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

#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)

#HasStateId Source

class HasStateId stateId state  where

Members

#SupportsReply Source

class SupportsReply builder  where

Members

Instances

#SupportsAddTimeout Source

class SupportsAddTimeout :: (Type -> Type) -> Type -> Constraintclass SupportsAddTimeout builder timerContent  where

Members

Instances

#SupportsNextEvent Source

class SupportsNextEvent builder event | builder -> event where

Members

Instances

#SupportsSelf Source

class SupportsSelf :: (Type -> Type -> Type -> Type -> Type -> Type -> Type -> (Type -> Type) -> Type -> Type) -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Constraintclass 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

#SupportsNewActions Source

class SupportsNewActions builder  where

Members

Instances

#DownReason Source

#InitFn Source

type InitFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Typetype InitFn info internal timerName timerContent commonData stateId state = InitT info internal timerName timerContent commonData stateId state Effect (InitResult info internal timerName timerContent commonData state)

#InitResult Source

data InitResult info internal timerName timerContent commonData state

Constructors

#InitT Source

newtype InitT :: forall k1 k2 k3 k4 k5 k6 k7. k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> (Type -> Type) -> Type -> Typenewtype InitT info internal timerName timerContent commonData stateId state m a

Instances

#InitActionsBuilder Source

newtype InitActionsBuilder info internal timerName timerContent

Constructors

Instances

#EventAction Source

data EventAction info internal timerName timerContent

Constructors

Instances

#CommonAction Source

data CommonAction timerName timerContent

Constructors

Instances

#CastFn Source

type CastFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Typetype CastFn info internal timerName timerContent commonData stateId state = EventFn info internal timerName timerContent commonData stateId state

#CallFn Source

type CallFn :: forall k. k -> Type -> Type -> Type -> Type -> Type -> Type -> Type -> Typetype CallFn reply info internal timerName timerContent commonData stateId state = From reply -> EventFn info internal timerName timerContent commonData stateId state

#HandleEventFn Source

type HandleEventFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Typetype HandleEventFn info internal timerName timerContent commonData stateId state = Event info internal timerName timerContent -> EventFn info internal timerName timerContent commonData stateId state

#EventFn Source

type EventFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Typetype 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

#TerminateFn Source

type TerminateFn :: forall k. Type -> Type -> Type -> Type -> Type -> k -> Type -> Typetype 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 -> Typenewtype EventT info internal timerName timerContent commonData stateId state m a

Instances

#EventActionsBuilder Source

newtype EventActionsBuilder info internal timerName timerContent

Instances

#EnterFn Source

type EnterFn :: forall k1 k2. k1 -> k2 -> Type -> Type -> Type -> Type -> Type -> Typetype 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

#StateEnterT Source

newtype StateEnterT :: forall k1 k2 k3 k4 k5 k6 k7. k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> (Type -> Type) -> Type -> Typenewtype StateEnterT info internal timerName timerContent commonData stateId state m a

Instances

#StateEnterActionsBuilder Source

#TimeoutAction Source

data TimeoutAction timerContent

Constructors

Instances

#NamedTimeoutAction Source

data NamedTimeoutAction timerName timerContent

Constructors

#Timeout Source

data Timeout timerContent

Constructors

#Event Source

data Event info internal timerName timerContent

Constructors

Instances

#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) }

#From Source

newtype From :: forall k. k -> Typenewtype From reply

#Reply Source

data Reply :: Type

#reply Source

reply :: forall reply. From reply -> reply -> Reply

#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

#cast Source

cast :: forall info internal timerName timerContent commonData stateId state. HasStateId stateId state => StatemRef info internal timerName timerContent commonData stateId state -> CastFn info internal timerName timerContent commonData stateId state -> Effect Unit

#init Source

init :: forall info internal timerName timerContent commonData stateId state. EffectFn1 (Spec info internal timerName timerContent commonData stateId state) NativeInitResult

#callback_mode Source

#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

#terminate Source

terminate :: forall info internal timerName timerContent commonData stateId state. EffectFn3 Foreign stateId (OuterData info internal timerName timerContent commonData stateId state) Atom

#NativeInitResult Source

#OuterData Source

newtype OuterData info internal timerName timerContent commonData stateId state

#NativeHandleEventResult Source

Re-exports from Control.Monad.Trans.Class

#lift Source

lift :: forall t m a. MonadTrans t => Monad m => m a -> t m a

Re-exports from Pinto.Types

#ExitMessage Source

data ExitMessage

Constructors