tricycle/elm-actor-framework/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.

Rerouted (cache, verified). The original is gone. This copy comes from a Lamdera package cache made before it went. The Lamdera package server serves a copy recovered from a Lamdera package cache from 2021-02-13.

What we checked: Rebuilt from the unpacked sources in a Lamdera package cache (5 copies agree), which Elm only writes after the published SHA-1 checked out; elm.json is byte-identical to package.elm-lang.org's; the exposed modules match docs.json; the zip is our own, so its SHA-1 is not the published one.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/tricycle/elm-actor-framework/zipball/1.4.0/

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

pidSystem : Pid

The System's Pid

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.

unsafePidFromInt : Int -> Pid

Create a Pid from an Int, should only be used when writing tests