Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
cblp committed Mar 7, 2020
1 parent 917823c commit bdb0507
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ff-core/lib/FF/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ newtype ConfigUI = ConfigUI
deriving (Eq, Show)

emptyConfig :: Config
emptyConfig = Config {dataDir = Nothing, externalEditor = Nothing, ui = defaultConfigUI}
emptyConfig =
Config{dataDir = Nothing, externalEditor = Nothing, ui = defaultConfigUI}

defaultConfigUI :: ConfigUI
defaultConfigUI = ConfigUI {shuffle = False}

instance FromJSON Config where
parseJSON = withObject "Config" $ \obj -> do
dataDir <- obj .:? "dataDir"
dataDir <- obj .:? "dataDir"
externalEditor <- obj .:? "externalEditor"
ui <- obj .:? "ui" .!= defaultConfigUI
ui <- obj .:? "ui" .!= defaultConfigUI
pure Config{..}

deriveJSON defaultOptions ''ConfigUI
Expand Down

0 comments on commit bdb0507

Please sign in to comment.