From afa9d701538b9e56622a0bfdf8e04aa358c9cd82 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 15 Apr 2020 10:06:24 -0700 Subject: Reformatting Now I'm using ormolu instead of brittany for Haskell formatting now. Figured I should just make all of these big changes at once. --- Hero/Database.hs | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'Hero/Database.hs') diff --git a/Hero/Database.hs b/Hero/Database.hs index 5726f3c..0166c6f 100644 --- a/Hero/Database.hs +++ b/Hero/Database.hs @@ -2,20 +2,21 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# OPTIONS_GHC -fno-warn-orphans #-} + module Hero.Database - ( ComicDB - , getComics - , load - , dummy + ( ComicDB, + getComics, + load, + dummy, ) where -import Hero.App -import Data.Map ( Map ) -import qualified Data.Map as Map -import Dhall -import Protolude -import Servant ( Handler ) +import Data.Map (Map) +import qualified Data.Map as Map +import Dhall +import Hero.App +import Protolude +import Servant (Handler) type ComicDB = (Map ComicId Comic) @@ -25,14 +26,17 @@ load :: IO ComicDB load = listToComicDB <$> input auto "./comic-database.dhall" dummy :: IO ComicDB -dummy = return $ listToComicDB - [ Comic { comicId = "ComicId" - , comicPages = 10 - , comicName = "Dummy comic" - , comicIssue = "dummy issue" - , comicDescription = "Lorem ipsum" +dummy = + return $ + listToComicDB + [ Comic + { comicId = "ComicId", + comicPages = 10, + comicName = "Dummy comic", + comicIssue = "dummy issue", + comicDescription = "Lorem ipsum" } - ] + ] listToComicDB :: [Comic] -> ComicDB listToComicDB ls = Map.fromList $ (,) <$> comicId <*> identity <$> ls -- cgit v1.2.3