title: Elm: JSON decoder, convert String to Bool
body: <p>I'm receiving a JSON that looks like this:</p>
  
  <pre><code>{ name: "NAME1", value: "true" }
  </code></pre>
  
  <p>I would like to create a json decoder that would create a record like this:</p>
  
  <pre><code>{ name: "NAME1", value: True }
  </code></pre>
  
  <p>I'm trying to make a decoder that transforms "true" into True. I did this so far:</p>
  
  <pre><code>userProperties : Json.Decode.Decoder Props
  userProperties =
    Json.Decode.object2 (,)
      ("name" := Json.Decode.string)
      ("value" := Json.Decode.string)
        `andThen` \val -&gt;
          let
            newVal = -- Do something here?
          in
            Json.Decode.succeed &lt;| newVal
  </code></pre>