The main is a *value* of type `Program Never Model Msg`, it is not a
function.

The 3 types after Program, (Never, Model and Msg) are the arguments of the
type in the same way that String is an argument for List in `List String`

You can read that as "a Program that does not take any flags (Never) has
the type `Model` as it's main data type and `Msg` as the main type of
messages flowing through the app", that's the actual, full type.

You can also thing of the `Program` as a container type for the 3 types
that follow it, the same way List is a container type or Maybe is a
container type.



On Fri, Jul 21, 2017 at 8:39 AM, Eeek <indrajit...@gmail.com> wrote:

> I am beginner in Elm, and going through elm-tutorial.org. I have problem
> in understanding the declaration of main function in
> https://www.elm-tutorial.org/en/02-elm-arch/02-structure.html. It says
>
> main : Program Never Model Msg
>
>  What does it represent? I read under functions tutorial that, arguments
> are separated with ->. If there are no arguments then I would expect only
> one return. This don't belong to any of it. What is this way of declaring
> the function types?
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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