Recognize 'on' for booleans

This commit is contained in:
Michael Snoyman 2012-07-05 11:58:53 +03:00
parent ed2c67ad79
commit 9af79e4d13

View File

@ -370,6 +370,7 @@ boolField = Field
"" -> Right Nothing
"none" -> Right Nothing
"yes" -> Right $ Just True
"on" -> Right $ Just True
"no" -> Right $ Just False
t -> Left $ SomeMessage $ MsgInvalidBool t
showVal = either (\_ -> False)
@ -393,6 +394,7 @@ checkBoxField = Field
checkBoxParser [] = Right $ Just False
checkBoxParser (x:_) = case x of
"yes" -> Right $ Just True
"on" -> Right $ Just True
_ -> Right $ Just False
showVal = either (\_ -> False)