readCards :: (MonadConfig m, MonadIO m) => m [Card]
readCards = do
    tcfg <- ask
    let atomcfg = liftIO . atomically . readTVar $ tcfg
    folder <- dataFol <$> atomcfg
    (o :: Maybe [Value]) <- liftIO $ decode <$> BS.readFile (folder ++ "cards.json")
    let c :: [Card]
        c = maybe [] (mapMaybe (decode . encode)) o
    liftIO . infoM rootLoggerName $ "Loaded card database of total " ++ show (length c) ++ " cards"
    return c
readCards :: (MonadConfig m, MonadIO m) => m [Card]
readCards = do
    tcfg <- ask
    let atomcfg = liftIO . atomically . readTVar $ tcfg
    folder <- dataFol <$> atomcfg
    (o :: Maybe [Value]) <- liftIO $ decode <$> BS.readFile (folder ++ "cards.json")
    let c :: [Card]
        c = maybe [] (mapMaybe (decode . encode)) o
    liftIO . infoM rootLoggerName $ "Loaded card database of total " ++ show (length c) ++ " cards"
    return c
readCards = do
    tcfg <- ask
    let atomcfg = liftIO . atomically . readTVar $ tcfg
    folder <- dataFol <$> atomcfg
    (o :: Maybe [Value]) <- liftIO $ decode <$> BS.readFile (folder ++ "cards.json")
    let c :: [Card]
        c = maybe [] (mapMaybe (decode . encode)) o
    liftIO . infoM rootLoggerName $ "Loaded card database of total " ++ show (length c) ++ " cards"
    return c