From 287d9e5c4fc50bcca2474b9783148181d7ede872 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 6 Apr 2026 23:35:05 +0200 Subject: Log watching --- src/Config.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Config.hs') diff --git a/src/Config.hs b/src/Config.hs index ee2909c..f50c8b6 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -5,11 +5,14 @@ {-# LANGUAGE TypeFamilies #-} module Config ( Config, Config'(..), ConfigStage(..), IfFull, - Channel(..), + Channel(..), prettyChannel, readConfig, enrichConfig, ) where +import Prelude hiding (foldl') -- exported since GHC 9.10 (base 4.20) + import Data.Char (isSpace) +import Data.List (foldl') import Data.Map.Strict (Map) import Data.Map.Strict qualified as Map import Data.Text (Text) @@ -70,6 +73,9 @@ type family IfFull stage a where data Channel = Channel { chanNetwork :: Text, chanChannel :: Text } deriving (Show, Eq, Ord) +prettyChannel :: Channel -> Text +prettyChannel (Channel nw ch) = nw <> T.pack "/" <> ch + readConfig :: FilePath -> IO (Config' User) readConfig path = foldl' parseLine initConfig . lines <$> readFile path -- cgit v1.3