title: Elm 0.19 Maybe.withDefault
body: <p>I have read the documentation, but i still don't understand how to Maybe.withDefault in my code. Because from a String.toInt I get Maybe Int, I cant use a + sign to add the values I try to convert into Integers. This is Elm 0.19. How can I fix this?</p>
  
  <pre><code>import Browser
  import Html exposing (Html, button, div, text)
  import Html.Events exposing (onClick)
  
  
  main =
    Browser.sandbox { init = init, update = update, view = view }
  
  
  -- MODEL
  
  type alias Model = {mainNum : String, curNum : String}
  
  init : Model
  init =
    {
        mainNum = ""
        ,curNum = ""
    }
  
  -- UPDATE
  
  type Msg = AddNum String | Add | Clear 
  
  update : Msg -&gt; Model -&gt; Model
  update msg model =
    case msg of
      AddNum number -&gt;
          {model | curNum = model.curNum ++ number}
  
      Add -&gt;
          {model | curNum = String.fromInt ((String.toInt model.curNum) + 
  (String.toInt model.mainNum))}
  
      Clear -&gt;
          init
  
  
  
  -- VIEW
  
  view : Model -&gt; Html Msg
  view model =
    div []
      [ div [] [ text  model.curNum]
      , button [ onClick (AddNum "1" )] [ text "1" ]
      , button [ onClick (AddNum "2" )] [ text "2" ]
      , button [ onClick (AddNum "3" )] [ text "3" ]
      , div [] []
      , button [ onClick (AddNum "4" )] [ text "4" ]
      , button [ onClick (AddNum "5" )] [ text "5" ]
      , button [ onClick (AddNum "6" )] [ text "6" ]
      , div [] []
      , button [ onClick (AddNum "7" )] [ text "7" ]
      , button [ onClick (AddNum "8" )] [ text "8" ]
      , button [ onClick (AddNum "9" )] [ text "9" ]
      , div [] []
      , button [ onClick (AddNum "0" )] [ text "0" ]
      , button [ onClick Clear] [ text "Clear" ]
      ]
  </code></pre>