Re: [elm-discuss] main : Program Never Model Msg -- What does it mean?

2017-07-21 Thread Андрей Коппель
This means that main returns Program type 
(http://package.elm-lang.org/packages/elm-lang/core/5.1.1/Platform#Program 
). 
It has three arguments which are flags, model and msg. Never means there will 
no always no flags. Model is your defined Model type. Msg is your defined Msg 
type.



Best,
Andrey

> On 21 Jul 2017, at 13:39, Eeek  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 
> .

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


Re: [elm-discuss] main : Program Never Model Msg -- What does it mean?

2017-07-21 Thread Peter Damoc
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  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.


[elm-discuss] main : Program Never Model Msg -- What does it mean?

2017-07-20 Thread Eeek
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.