elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 366 forks source link

Old info: Record update syntax doesn't allow type change #796

Closed malaire closed 5 years ago

malaire commented 5 years ago

src/pages/docs/records.elm talks about how "You can even change the type of value in a field" in section "Updating Records".

This isn't true anymore in Elm 0.19

Munksgaard commented 5 years ago

It also lists the following example which is not valid in 0.19:

rawInput =
  { name = "Tom"
  , country = "Finland"
  , age = "34"
  , height = "1.9"
  }

prettify person =
  { person |
      age = String.toInt person.age,
      height = String.toFloat person.height
  }

input =
  prettify rawInput
LiberalArtist commented 5 years ago

For anyone stumbling across this, here is the part of the 0.19 release note that explains this is no longer allowed.