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

GFromForm for Bool #134

Open MangoIV opened 1 year ago

MangoIV commented 1 year ago

Hi, I’m wondering if it’d make sense to have a special handling for Booleans in GFromForm like we have for Maybe. It’d make sense to write an instance that parses like Maybe but @Text and then fmaps with isJust st a checkbox can be recognised without checking their value or encoding it as Maybe Text on the Backend. Perhaps a newtype like “CheckBoxParam” or something with the same name that’s isomorphic to Bool would be worthwhile as well?