Assign a value in elm

Viewed 1958

This is a really noob question, i'm sorry but my search on the internet can't find the answer. I have the following code:

-- MODEL

type alias Model = Int

model : Model
model =
  0


-- UPDATE

type Msg = Increment | Decrement | Reset

update : Msg -> Model -> Model
update msg model =
  case msg of
    Increment ->
      model + 1

    Decrement ->
      model - 1
    Reset ->
      model = 0

I am trying to implement the reset that sets the model value to 0. But i'm getting a compilation error:

The = operator is reserved for defining variables. Maybe you want == instead? Or maybe you are defining a variable, but there is whitespace before it?

Please help!

1 Answers
Related