Runnable TODO
Runnable is one the most basic type of Halla programs. In order to create this type of program, simply define that accepts a list of Strings (which represents the arguments the program accepts) and returns a Cmd which the halla runtime will send.
type Runnable = List String -> Cmd a
Using a Runnable, everyone's favorite program "HelloWorld" would look like this:
helloworld : List String -> Cmd msg
helloworld args =
Cmd.print "Hello world!"
Actor TODO
If you need a program that not only capable of sending Cmds, but also receiving and acting upon external data, then you need a Actor.
type Actor msg =
{ init : List String -> Cmd msg
, publish : msg -> Cmd msgs
, subscribe : Sub msg
}
Actors are based on the Actor model. Using an Actor is a great way to build a simple application. If your use case is more complex, you can build your application as a series of multiple Actors that work together to solve your problems. Halla makes connecting these Actors together incredibly easy.