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

Add FromParam () and ToParam ()


Can be used to work with field existence.

Signed-off-by: default avatarJan Hamal Dvořák <mordae@anilinux.org>
parent 00ba7e1c
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,9 @@ where
instance FromParam Double where
fromParam = readMaybe . unpack
instance FromParam () where
fromParam _ = Just ()
instance FromParam Bool where
fromParam "true" = Just True
fromParam "True" = Just True
......@@ -158,6 +161,9 @@ where
instance ToParam Double where
toParam = pack . show
instance ToParam () where
toParam _ = ""
instance ToParam Bool where
toParam True = "true"
toParam False = "false"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment