Transform files using stylish-haskell

This commit is contained in:
Joscha 2018-01-05 03:00:24 +00:00
parent 5c60d90d82
commit 266acbe93d
2 changed files with 13 additions and 13 deletions

View file

@ -2,14 +2,14 @@ module Main
( main ( main
) where ) where
import Cards import Cards
import Control.Monad import Control.Monad
import Control.Monad.Trans.Class import Control.Monad.Trans.Class
import Control.Monad.Trans.Maybe import Control.Monad.Trans.Maybe
import Data.Char import Data.Char
import Data.Time import Data.Time
import System.Console.Haskeline import System.Console.Haskeline
import System.Console.Haskeline.History import System.Console.Haskeline.History
type Input = InputT IO type Input = InputT IO
@ -75,7 +75,7 @@ askElements time elms = do
-- TODO: Randomize order -- TODO: Randomize order
newCards <- askCountdown time l newCards <- askCountdown time l
return $ updateElements elms (fromCards newCards) return $ updateElements elms (fromCards newCards)
askCountdown :: UTCTime -> [(Integer, Card)] -> Input [(Integer, Card)] askCountdown :: UTCTime -> [(Integer, Card)] -> Input [(Integer, Card)]
askCountdown _ [] = return [] askCountdown _ [] = return []
askCountdown time l@((key, card):xs) = do askCountdown time l@((key, card):xs) = do

View file

@ -25,7 +25,7 @@ module Cards
import Control.Applicative import Control.Applicative
import Control.Monad import Control.Monad
import Data.List import Data.List
import qualified Data.Map.Strict as Map import qualified Data.Map.Strict as Map
import Data.Time import Data.Time
import Data.Void import Data.Void
import Text.Megaparsec import Text.Megaparsec
@ -46,16 +46,16 @@ data Element = ECard Card
-- | A single index card with one or more sides. -- | A single index card with one or more sides.
data Card = Card data Card = Card
{ sides :: [String] { sides :: [String]
-- ^ The sides of a 'Card'. -- ^ The sides of a 'Card'.
-- --
-- As opposed to real index cards, a 'Card' may have more or less than two -- As opposed to real index cards, a 'Card' may have more or less than two
-- sides. -- sides.
, tier :: Tier , tier :: Tier
-- ^ The 'Tier' of a 'Card'. -- ^ The 'Tier' of a 'Card'.
, lastChecked :: UTCTime , lastChecked :: UTCTime
-- ^ The time a 'Card' was last looked at. -- ^ The time a 'Card' was last looked at.
, offset :: NominalDiffTime , offset :: NominalDiffTime
-- ^ A random offset, used when determining whether a 'Card' needs to be -- ^ A random offset, used when determining whether a 'Card' needs to be
-- revised. -- revised.
-- --