27 lines
533 B
Haskell
27 lines
533 B
Haskell
{-# LANGUAGE TypeFamilies #-}
|
|
module Types.Settings where
|
|
|
|
import qualified Data.Text as T
|
|
|
|
-- internal imports
|
|
|
|
import Classes
|
|
|
|
data Settings = Settings
|
|
{ settingsBlockRegistration :: Bool
|
|
, settingsImprintText :: T.Text
|
|
}
|
|
deriving (Show)
|
|
|
|
instance DatabaseRepresentation Settings where
|
|
|
|
type Representation Settings = (Bool, T.Text)
|
|
|
|
instance ToDatabase Settings where
|
|
|
|
toDatabase (Settings reg imprint) = (reg, imprint)
|
|
|
|
instance FromDatabase Settings where
|
|
|
|
fromDatabase (reg, imprint) = Settings reg imprint
|