diff --git a/lib/Hikaru/Types.hs b/lib/Hikaru/Types.hs index 29522700f9fa0dea47dc113cd5d3e749f3d9e3f9..eff2e5e6b2e109614d82585380ecf7d66cc10671 100644 --- a/lib/Hikaru/Types.hs +++ b/lib/Hikaru/Types.hs @@ -155,6 +155,8 @@ where instance Param Bool where fromParam "true" = Just True fromParam "True" = Just True + fromParam "yes" = Just True + fromParam "Yes" = Just True fromParam "on" = Just True fromParam "On" = Just True fromParam "1" = Just True @@ -162,6 +164,8 @@ where fromParam "False" = Just False fromParam "off" = Just False fromParam "Off" = Just False + fromParam "no" = Just False + fromParam "No" = Just False fromParam "0" = Just False fromParam _else = Nothing {-# INLINE fromParam #-} @@ -179,6 +183,14 @@ where toParam char = pack [char] {-# INLINE toParam #-} + instance Param String where + fromParam "" = Nothing + fromParam sp = Just (cs sp) + {-# INLINE fromParam #-} + + toParam = cs + {-# INLINE toParam #-} + instance Param Text where fromParam "" = Nothing fromParam sp = Just sp