tricycle/system-actor-model/8.0.0

NOTE: the latest version is 9.0.0

Renamed to bellroy/system-actor-model. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as tricycle/system-actor-model still install under that name. 26 versions of 26 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/bellroy/system-actor-model.

What we checked: The repo moved to github.com/bellroy/system-actor-model. Rebuilt with git archive from commit 370f6c42a66a of https://github.com/bellroy/system-actor-model (zip prefix tricycle-system-actor-model-f9bf615/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 66800e0ed8b7af3ec7f7ea24e1579a08e4e550cd.

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/system-actor-model/zipball/8.0.0/

System.Component.Ui

Ui

A Ui component can't render other Actors.

Example usage

type alias Model =
    Int


type MsgIn
    = Increment
    | Decrement


type MsgOut
    = NoMsgOut


component : Ui Model MsgIn MsgOut
component =
    { init =
        \_ ->
            ( 0, [], Cmd.none )
    , update =
        \msgIn model ->
            case msgIn of
                Increment ->
                    ( model + 1, [], Cmd.none )


                Decrement ->
                    ( model - 1, [], Cmd.none )
    , view =
        \toSelf model ->
            Html.div []
                [ Html.button
                    [ Html.Events.onClick Decrement
                    ]
                    [ Html.text "-"
                    ]
                , Html.text <| String.fromInt model
                , Html.button
                    [ Html.Events.onClick Increment
                    ]
                    [ Html.text "+"
                    ]
                ]
    , subscriptions = always Sub.none
    , events = System.Event.ignoreAll
    }

Types

type alias Ui componentOutput componentModel componentMsgIn componentMsgOut msg =
{ init :
( PID, Value )
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
, update :
componentMsgIn
-> componentModel
-> ( componentModel, List componentMsgOut, Cmd componentMsgIn )
, subscriptions : componentModel -> Sub componentMsgIn
, events : ComponentEventHandlers componentMsgIn
, view : (componentMsgIn -> msg) -> componentModel -> componentOutput
}

The Type of an Ui Component

Creation

Ui
componentOutput
componentModel
componentMsgIn
componentMsgOut
(SystemMessage address actorName appMsg)
-> { wrapModel : componentModel -> applicationModel
, wrapMsg : componentMsgIn -> appMsg
, mapIn : appMsg -> Maybe componentMsgIn
, mapOut :
PID -> componentMsgOut -> SystemMessage address actorName appMsg
}
-> Actor
componentModel
applicationModel
componentOutput
(SystemMessage address actorName appMsg)

Create an Actor from an Ui Component