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)
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, arg
Here's my take.
In C++ (Or Java, what-have-you), you could have something like this:
class Square {
private float size;
Square(float size) {
this.size = size;
}
void size(float size) {
this.size = size;
}
float size(void) {
return this.size;
}
float perimeter(void)
Le 20/07/2017 à 12:15, Peter Damoc a écrit :
>
>
> On Thu, Jul 20, 2017 at 12:49 PM, Christophe de Vienne
> mailto:christo...@cdevienne.info>> wrote:
>
>
> Well, it is more an intuition after more than 20 years of coding that an
> elaborated opinion.
>
> But the first thing that
On Thu, Jul 20, 2017 at 12:49 PM, Christophe de Vienne <
christo...@cdevienne.info> wrote:
>
> Well, it is more an intuition after more than 20 years of coding that an
> elaborated opinion.
>
> But the first thing that comes to my mind is the resulting complexity,
> and often confusion. I find tha
Le 20/07/2017 à 11:12, Dave Ford a écrit :
> Now, is it actually a systemic problem ? My intuition is that it is the
> root of many difficulties OO languages can have, even though it does not
> seem like a problem at first.
>
>
> Can you give an example? Specifically, without confus
>
> Now, is it actually a systemic problem ? My intuition is that it is the
> root of many difficulties OO languages can have, even though it does not
> seem like a problem at first.
Can you give an example? Specifically, without confusing the unrelated
issue of immutability?
--
You received th
On Thu, Jul 20, 2017 at 11:52 AM, Dave Ford wrote:
> On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc wrote:
>
>> "this" is associated with mutation. Elm is an immutable language.
>>
>
> I don't think that's true. I might be wrong, but I'm pretty sure that
> "this" has nothing specifically to do wit
Regardless of immutability, saying "this" imply a bound between the data
and the function, which is the very thing Elm wants to avoid.
So I think the systemic problem referred to here is "separation of data
and logic", and its incarnation (sort of) is the ability to say "this".
Now, is it actuall
I have minimised (almost 0% now) my use of this in JS, by using arrow
functions. Perhaps 'this' is a bad example, they're an arcane artifact...
Basically you're right, the guide isn't clear at best, wrong at worst : )
On Thu, 20 Jul 2017 at 10:52 Dave Ford wrote:
> On Thu, Jul 20, 2017 at 4:14
On Thu, Jul 20, 2017 at 4:24 AM, John Orford wrote:
> It's ambiguous
>
It's not. In Java it's very clearly and deterministically defined.
this.x = 123
>
Immutability is a different issue. "this" has nothing specifically to do
with mutability. The use of "this" is orthogonal to mutability.
--
On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc wrote:
> "this" is associated with mutation. Elm is an immutable language.
>
I don't think that's true. I might be wrong, but I'm pretty sure that
"this" has nothing specifically to do with mutation. I write immutable
objects all day long in java and
It's ambiguous, I also imagine it means avoiding:
this.x = 123
But then again, why do you need 'this' in the first place? In Elm you can
access anything in scope in the module.
I suppose this is useful for accessing class stuff which isn't in your
immediate method scope... which again leads you
"this" is associated with mutation. Elm is an immutable language.
In theory, one could have immutable objects where data and logic are
grouped together.
The best expression I've seen so far is the FauxO system in Gary
Bernhardt's Boundaries talk.
Something like this would constitute a non-trivial
There is a line from the docs that I am trying to understand: "Elm
encourages a strict separation of data and logic, and the ability to say
this is primarily used to break this separation. This is a systemic problem
in Object Oriented languages that Elm is purposely avoiding."
What is the syste
15 matches
Mail list logo