Skip to content
Snippets Groups Projects
Verified Commit 20293795 authored by jan.hamal.dvorak's avatar jan.hamal.dvorak
Browse files

Add (Param String) and expand (Param Bool)

parent 3d4b8e20
No related branches found
No related tags found
No related merge requests found
...@@ -155,6 +155,8 @@ where ...@@ -155,6 +155,8 @@ where
instance Param Bool where instance Param Bool where
fromParam "true" = Just True fromParam "true" = Just True
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 "On" = Just True fromParam "On" = Just True
fromParam "1" = Just True fromParam "1" = Just True
...@@ -162,6 +164,8 @@ where ...@@ -162,6 +164,8 @@ where
fromParam "False" = Just False fromParam "False" = Just False
fromParam "off" = Just False fromParam "off" = Just False
fromParam "Off" = Just False fromParam "Off" = Just False
fromParam "no" = Just False
fromParam "No" = Just False
fromParam "0" = Just False fromParam "0" = Just False
fromParam _else = Nothing fromParam _else = Nothing
{-# INLINE fromParam #-} {-# INLINE fromParam #-}
...@@ -179,6 +183,14 @@ where ...@@ -179,6 +183,14 @@ where
toParam char = pack [char] toParam char = pack [char]
{-# INLINE toParam #-} {-# INLINE toParam #-}
instance Param String where
fromParam "" = Nothing
fromParam sp = Just (cs sp)
{-# INLINE fromParam #-}
toParam = cs
{-# INLINE toParam #-}
instance Param Text where instance Param Text where
fromParam "" = Nothing fromParam "" = Nothing
fromParam sp = Just sp fromParam sp = Just sp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment