Module

Pinto.GenStatem

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

newtype StatemType info internal timerName timerContent commonData stateId state

#StatemPid

newtype StatemPid info internal timerName timerContent commonData stateId state

Instances

#StatemRef

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

class HasStateId stateId state  where

Members

#SupportsReply

class SupportsReply builder  where

Members

Instances

#SupportsAddTimeout

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

Members

Instances

#SupportsNextEvent

class SupportsNextEvent builder event | builder -> event where

Members

Instances

#SupportsSelf

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

class SupportsNewActions builder  where

Members

Instances

#DownReason

#InitFn

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

data InitResult info internal timerName timerContent commonData state

Constructors

#InitT

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

newtype InitActionsBuilder info internal timerName timerContent

Constructors

Instances

#EventAction

data EventAction info internal timerName timerContent

Constructors

Instances

#CommonAction

data CommonAction timerName timerContent

Constructors

Instances

#CastFn

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

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

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

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

data EventResult info internal timerName timerContent commonData state

Constructors

#TerminateFn

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

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

newtype EventActionsBuilder info internal timerName timerContent

Instances

#EnterFn

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

data StateEnterResult timerName timerContent commonData

Constructors

#StateEnterT

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

#TimeoutAction

data TimeoutAction timerContent

Constructors

Instances

#NamedTimeoutAction

data NamedTimeoutAction timerName timerContent

Constructors

#Timeout

data Timeout timerContent

Constructors

#Event

data Event info internal timerName timerContent

Constructors

Instances

#Spec

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

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

#Reply

data Reply

#reply

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

#defaultSpec

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

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

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

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

#callback_mode

#handle_event

handle_event :: forall info internal timerName timerContent commonData stateId state. EffectFn4 Foreign Foreign stateId (OuterData info internal timerName timerContent commonData stateId state) NativeHandleEventResult

#terminate

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

#NativeInitResult

#OuterData

newtype OuterData info internal timerName timerContent commonData stateId state

#NativeHandleEventResult

Re-exports from Control.Monad.Trans.Class

#lift

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

Re-exports from Pinto.Types

#ExitMessage

data ExitMessage

Constructors

Modules