Hi,

Looking at the following

http://elm-lang.org/examples/http

I pretty much grok this, but have a couple of (likely dumb) questions -

1) When a function returns 'Cmd Msg', or 'Sub Msg', or 'Html Msg', what 
kind of a 'thing' is being returned ?

Obviously Msg is a type. But are Cmd/Sub/Html also types ? (I suspect not). 
And when you prefix then to Msg is the resulting thing also a type ? 
(suspect not). A list of types ?? (suspect not). A closure or a deferred or 
something ? Am guessing more likely

2) type Msg = MorePlease | NewGif (Result Http.Error String)

What's with the '(Result Http.Error String)' at the end ? I read the bit 
about union types but couldn't find anything relating to args in round 
brackets. If someone could point me to the relevant docs that would be 
great.

3) Why does complier fail if I change Msg to 'type Msg = NewGif | 
MorePlease (Result Http.Error String)' ?

Don't NewGif and MorePlease require the same HTTP calls ?

Elm looks great. Thanks in advance for any help and suggestions

Justin

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to