# code-block-pro/1.3.0/build/shiki/samples/elm.sample

Code Block Pro – Beautiful Syntax Highlighting, version 1.3.0. 66 lines.

- Page: https://pluginprobe.com/plugins/code-block-pro/1.3.0/code/build/shiki/samples/elm.sample
- Raw: https://pluginprobe.com/plugins/code-block-pro/1.3.0/raw/build/shiki/samples/elm.sample
- Modified: 2022-08-22T22:25:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-block-pro/1.3.0/code/build/shiki/samples/elm.sample#L10-L20`.

```
module Main exposing (..)

-- Press buttons to increment and decrement a counter.
--
-- Read how it works:
--   https://guide.elm-lang.org/architecture/buttons.html
--


import Browser
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)



-- MAIN


main =
  Browser.sandbox { init = init, update = update, view = view }



-- MODEL


type alias Model = Int


init : Model
init =
  0



-- UPDATE


type Msg
  = Increment
  | Decrement


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

    Decrement ->
      model - 1



-- VIEW


view : Model -> Html Msg
view model =
  div []
    [ button [ onClick Decrement ] [ text "-" ]
    , div [] [ text (String.fromInt model) ]
    , button [ onClick Increment ] [ text "+" ]
    ]

-- From https://elm-lang.org/examples/buttons
```
