gdritter repos bricoleur / master
lints Getty Ritter 1 year, 2 months ago
4 changed file(s) with 5 addition(s) and 7 deletion(s). Collapse all Expand all
2727 toIdent = TL.fromStrict . T.cons '«' . flip T.snoc '»'
2828
2929 findFragments :: FilePath -> T.Text -> [Source] -> Either TL.Text (IO TL.Text)
30 findFragments root s sources = case (T.splitOn "/" s) of
30 findFragments root s sources = case T.splitOn "/" s of
3131 [] -> throw "Invalid empty fragment name!"
3232 (x : rs) -> case [ src
3333 | src@Source {sourceName = n} <- sources,
6868 [f] -> ExposeSections <$> A.parseAdnot f
6969 _ -> Left "Too many arguments to sections"
7070
71 namedMap = A.withProduct "exposed fragments" $ \p ->
72 NamedMap <$> mapM A.parseAdnot p
71 namedMap = A.withProduct "exposed fragments" $
72 fmap NamedMap . mapM A.parseAdnot
7373
7474 parseConfig :: B.ByteString -> Either String Config
7575 parseConfig = A.decode
2828 import qualified System.IO as Sys
2929 import qualified System.Posix.IO as Posix
3030 import qualified System.Posix.Terminal as Posix
31 import Prelude (Either (Left), FilePath, IO, ($))
31 import Prelude (Either (Left), FilePath, IO, ($), (.))
3232
3333 -- | Produce a 'Left' value from a format string
3434 throw :: F.Format (Either TL.Text r) a -> a
3535 throw f =
36 F.runFormat f (\b -> Left (TL.toLazyText b))
36 F.runFormat f (Left . TL.toLazyText)
3737
3838 stderr :: TL.Text -> IO ()
3939 stderr = TL.hPutStr Sys.stderr
1 {-# LANGUAGE OverloadedStrings #-}
2
31 module Bricoleur
42 ( main,
53 Opt.getOpts,