@@ -40,37 +40,46 @@ defaults.
41One common confusion with the `port` syntax is that the only difference
41One common confusion with the `port` syntax is that the only difference
42between incoming ports and outgoing ports is whether the type annotation comes
42between incoming ports and outgoing ports is whether the type annotation comes
43−with a definition. To make things a bit clearer, each case is getting a
43+with a definition. To make things a bit clearer, we are using the keywords
44−keyword.
44+`foreign input` and `foreign output`.
47−input dbResults : Stream String
47+foreign input dbResults : Stream String
49−output dbRequests : Stream String
49+foreign output dbRequests : Stream String
50−output dbRequests =
50+foreign output dbRequests =
51 Stream.map toRequest userNames
51 Stream.map toRequest userNames
54−### Loopbacks
54+### Input / Output
56−The biggest change in 0.15 is the addition of promises. To bring this concept
56+The biggest change in 0.15 is the addition of tasks, allowing us to represent
57−into Elm in a nice way, we needed to give it support at the declaration level.
57+arbitrary effects in Elm in a safe way. This parallels how ports work, so we
58−There are two ways to specify loopbacks. First is a loopback that you write to
58+are trying to draw attention to that in syntax. First addition is a way to
59−manually.
59+create new inputs to an Elm program.
62−loopback actions : Mailbox Action
62+input actions : Input Action
65−This creates a `Mailbox` that you can send messages to. The second kind of
65+This creates a `Input` that is made up of an `Address` you can send messages to
66−loopback runs promises, so it gets all of its values from a stream of promises.
66+and a `Stream` of those messages. This is similar to a `foreign input` except
67+there we use the name as the address. The second addition is a way to run
69−loopback dbResults : Stream (Result Http.Error String)
71− Stream.map toRequest userNames
71+output Stream.map toRequest userNames
74+This lets us turn tasks into effects in the world. Sometimes it is useful to
75+pipe the results of these tasks back into Elm. For that, we have the third and
79+input results : Stream (Result Http.Error String)
81+ Stream.map toRequest userNames