Incrementing record property in Elm

Viewed 579

What's best way to increment property of record in Elm?

Let's say, that I have simple model like this -

model : Model
model =
    { counter = 0 }

And if I wanted to have in update something like this

update : Msg -> Model -> Model
update msg model =
  case msg of
    NoOp -> model
    Increment -> { model | counter = model.counter + 1}

Now, I know I can as well write my Increment as

Increment -> { model | counter = .counter model + 1 }

But I am wondering, if there is a way to do it similarly to this

Increment -> { model | counter += 1} || Increment -> { model | counter++ }

or even something like this

Increment -> { model | counter = counter + 1 }

Sorry if this is stupid question, I am just starting with Elm and would like some insight.

1 Answers
Related