Compare commits
3 Commits
02bc5a89a7
...
c8b4531513
Author | SHA1 | Date |
---|---|---|
|
c8b4531513 | 7 months ago |
|
51f618309d | 7 months ago |
|
8a7ba17c81 | 7 months ago |
4 changed files with 15 additions and 17 deletions
@ -1,25 +1,21 @@
|
||||
{-# LANGUAGE TypeFamilies #-} |
||||
module Types.Settings where |
||||
|
||||
import qualified Data.Text as T |
||||
|
||||
import Classes |
||||
|
||||
data Settings = Settings |
||||
{ settingsCurrency :: T.Text |
||||
, settingsDecimalPlaces :: Int |
||||
, settingsBlockRegistration :: Bool |
||||
{ settingsBlockRegistration :: Bool |
||||
} |
||||
deriving (Show) |
||||
|
||||
instance ToDatabase Settings where |
||||
|
||||
type InTuple Settings = (T.Text, Int, Bool) |
||||
type InTuple Settings = Bool |
||||
|
||||
toDatabase (Settings currency places reg) = (currency, places, reg) |
||||
toDatabase (Settings reg) = reg |
||||
|
||||
instance FromDatabase Settings where |
||||
|
||||
type OutTuple Settings = (T.Text, Int, Bool) |
||||
type OutTuple Settings = Bool |
||||
|
||||
fromDatabase (currency, places, reg) = Settings currency places reg |
||||
fromDatabase reg = Settings reg |
||||
|
Loading…
Reference in new issue