tricycle/elm-actor-framework/1.2.0

NOTE: the latest version is 1.4.0

Renamed to bellroy/elm-actor-framework. It is published under that name, and new versions come out there.

Versions published as tricycle/elm-actor-framework still install under that name. 2 versions of 6 come from the new location (see their notes). 4 versions could not be recovered and cannot be installed.

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/bellroy/elm-actor-framework exists but has no tag 1.2.0; Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.2.0 found (1 same-name repos checked); no cached copy. Use another version.

Details

Framework.Actor

type alias Component appFlags componentModel componentMsgIn componentMsgOut output frameworkMsg =
{ init :
( Pid, appFlags )
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
, update :
componentMsgIn
-> componentModel
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
, subscriptions : componentModel -> Sub componentMsgIn
, view :
(componentMsgIn -> frameworkMsg)
-> componentModel
-> (Pid -> Maybe output)
-> output
}

Actor

type alias Actor appFlags componentModel appModel output frameworkMsg =
{ processMethods :
ProcessMethods componentModel appModel output frameworkMsg
, init : ( Pid, appFlags ) -> ( appModel, frameworkMsg )
, apply : componentModel -> Process appModel output frameworkMsg
}
{ toAppModel : componentModel -> appModel
, toAppMsg : componentMsgIn -> appMsg
, fromAppMsg : appMsg -> Maybe componentMsgIn
, onMsgOut :
{ self : Pid
, msgOut : componentMsgOut
}
-> FrameworkMessage
appFlags
appAddresses
appActors
appModel
appMsg
}
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
(FrameworkMessage
appFlags
appAddresses
appActors
appModel
appMsg
)
-> Actor
appFlags
componentModel
appModel
output
(FrameworkMessage
appFlags
appAddresses
appActors
appModel
appMsg
)

Progress a Component into an Actor by supplying it functions of how to handle application types.

Process

type alias ProcessMethods componentModel appModel output frameworkMsg =
ProcessMethods componentModel appModel output frameworkMsg
type alias Process appModel output frameworkMsg =
Process appModel output frameworkMsg

An Actor that has been spawned inside the framework always receives an unique identifier (PID).

The PID also holds information about who spawned (started) the process.

Process Identifier

type alias Pid =
Pid

The type of a Pid

spawnedBy : Pid -> Pid

Retrieve the Pid responsible for spawning the given Pid

Component Utility

( ( ( Pid, a )
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
)
-> ( Pid, appFlags )
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
)
-> Component
a
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg

Transform your components init function

( ( componentMsgIn
-> componentModel
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
)
-> componentMsgIn
-> componentModel
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
)
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg

Transform your components update function

( (componentModel -> Sub componentMsgIn)
-> componentModel
-> Sub componentMsgIn
)
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
output
frameworkMsg

Transform your components subscriptions function

( ( (componentMsgIn -> frameworkMsg)
-> componentModel
-> (Pid -> Maybe outputA)
-> outputA
)
-> (componentMsgIn -> frameworkMsg)
-> componentModel
-> (Pid -> Maybe outputB)
-> outputB
)
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
outputA
frameworkMsg
-> Component
appFlags
componentModel
componentMsgIn
componentMsgOut
outputB
frameworkMsg

Transform your components view function

Process Utility

pidCompare : Pid -> Pid -> Order

Compare two Pid's

pidEquals : Pid -> Pid -> Bool

Check if two Pid's are in fact the same

pidToInt : Pid -> Int

Returns an Integer representation of a Pid.

pidToString : Pid -> String

Returns a String representation of a Pid.