An example add/multiply funnel, with a simulator.
A MessageResponse encapsulates a message.
NoResponse is currently unused, but many PortFunnel-aware modules will need it.
PortFunnel.FunnelSpecThe name of this module: "AddXY".
Our module descriptor.
Responsible for sending a CmdResponse back througt the port.
Called by PortFunnel.appProcess for each response returned by process.
The AddXY module doesn't send itself messages, so this is just PortFunnel.emptyCommander.
StateThe initial, empty state, so the application can initialize its state.
Message out the Cmd PortMake an AddMessage
Make a MultiplyMessage
Convert a Message to the same JSON string that gets sent
over the wire to the JS code.
Make a simulated Cmd port.
Convert our State to a list of strings.
AddMessageandMultiplyMessagego out from Elm to the JS.SumMessageandProductMessagecome back in.