title: How to use select (dropdown) tag in Elm lang
body: <p>I want to render simple dropdown within my elm app with the following code but it's not working as expected. I want to keep union type Role in place and avoid using strings if it's possible.</p>
  
  <p>What's the best way to work with dropdown in Elm? I didn't find any example yet. </p>
  
  <pre><code>import Html exposing (..)
  import Html.App exposing (beginnerProgram)
  import Html.Events exposing (..)
  import Html.Attributes exposing (..)
  import Json.Decode
  
  main =
    beginnerProgram
      { model = initialModel
      , view = view
      , update = update
      }
  
  initialModel =
    { role = None
    }
  
  type Role
    = None
    | Admin
    | User
  
  type alias Model = 
    { role: Role
    }
  
  type Msg
    = SelectRole Role
  
  
  update msg model =
    case msg of
      SelectRole role -&gt;
        { model | role = role }
  
  
  view : Model -&gt; Html Msg
  view model =
    div
      []
      [ select
          [ ]
          [ viewOption None
          , viewOption Admin
          , viewOption User
          ]
      , pre [] [ text &lt;| toString model ]
      ]
  
  
  
  viewOption : Role -&gt; Html Msg
  viewOption role =
    option
      [ onClick (SelectRole role) ]
      [ text &lt;| toString role ]
  </code></pre>