buuka/src/Operations/List.hs

28 lines
494 B
Haskell
Raw Normal View History

2021-01-01 08:29:24 +02:00
{-# LANGUAGE LambdaCase #-}
module Operations.List where
import Control.Monad.Buuka
import Control.Monad.Reader
2021-01-01 08:34:09 +02:00
(asks, liftIO)
2021-01-01 08:29:24 +02:00
import Data.Foldable
(traverse_)
import Data.Buuka
(Buuka)
2021-01-01 08:29:24 +02:00
import qualified Data.Buuka as B
import Operations.Format
2021-01-01 08:34:09 +02:00
2021-01-03 08:33:44 +02:00
import Data.Text
(Text)
import qualified Data.Text.IO as T
2021-01-01 08:34:09 +02:00
2021-01-01 08:29:24 +02:00
list :: BuukaM ()
list =
2021-01-03 08:33:44 +02:00
buukaQ (asks go) >>= traverse_ (liftIO . T.putStrLn)
2021-01-01 08:29:24 +02:00
where
2021-01-03 08:33:44 +02:00
go :: Buuka -> [Text]
go b = formatEntries b (B.elements b)