fizruk / http-api-data

Converting to/from HTTP API data like URL pieces, headers and query parameters.
http://hackage.haskell.org/package/http-api-data
Other
52 stars 42 forks source link

Can ordering guarantees be added to the docs? #144

Open saurabhnanda opened 3 months ago

saurabhnanda commented 3 months ago

If the following form is submitted...

<input type="text' name="photos[][id]" value="1" />
<input type="text' name="photos[][caption]" value="caption1" />

<input type="text' name="photos[][id]" value="2" />
<input type="text' name="photos[][caption]" value="caption2" />

<input type="text' name="photos[][id]" value="3" />
<input type="text' name="photos[][caption]" value="caption3" />

... does the library guarantee that the resultant values of the HashMap inside Form { unForm :: HashMap Text [Text] } will be in the same order as submitted by the browser, i.e. is the following result guaranteed?

HashMap.fromList
  [ ("photos[][id]", ["1", "2", "3"])
  , ("photos[][caption]", ["caption1", "caption2", "caption3"])
  ]

There are some stable function variants, but somehow the documentation doesn't give the above clarity/comfort from my point of view.