2023-01-28 22:58:05 -05:00
|
|
|
{-# LANGUAGE NoImplicitPrelude #-}
|
|
|
|
|
2022-12-11 17:51:11 -05:00
|
|
|
module Internal.Config
|
|
|
|
( readConfig
|
2023-01-05 22:16:06 -05:00
|
|
|
-- , readYaml
|
|
|
|
)
|
|
|
|
where
|
2022-12-11 17:51:11 -05:00
|
|
|
|
2023-01-05 22:16:06 -05:00
|
|
|
-- import Control.Exception
|
|
|
|
-- import Data.Yaml
|
|
|
|
import Dhall hiding (record)
|
|
|
|
import Internal.Types
|
2023-01-05 22:23:22 -05:00
|
|
|
import RIO
|
2022-12-11 17:51:11 -05:00
|
|
|
|
2023-01-05 22:23:22 -05:00
|
|
|
readConfig :: MonadUnliftIO m => FilePath -> m Config
|
|
|
|
readConfig confpath = liftIO $ unfix <$> inputFile auto confpath
|
2022-12-11 17:51:11 -05:00
|
|
|
|
2023-01-05 22:16:06 -05:00
|
|
|
-- readYaml :: FromJSON a => FilePath -> IO a
|
|
|
|
-- readYaml p = do
|
|
|
|
-- r <- decodeFileEither p
|
|
|
|
-- case r of
|
|
|
|
-- Right a -> return a
|
|
|
|
-- Left e -> throw e
|