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
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment