lints
Getty Ritter
4 years ago
| 27 | 27 |
toIdent = TL.fromStrict . T.cons '«' . flip T.snoc '»'
|
| 28 | 28 |
|
| 29 | 29 |
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
|
| 31 | 31 |
[] -> throw "Invalid empty fragment name!"
|
| 32 | 32 |
(x : rs) -> case [ src
|
| 33 | 33 |
| src@Source {sourceName = n} <- sources,
|
| 68 | 68 |
[f] -> ExposeSections <$> A.parseAdnot f
|
| 69 | 69 |
_ -> Left "Too many arguments to sections"
|
| 70 | 70 |
|
| 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
|
| 73 | 73 |
|
| 74 | 74 |
parseConfig :: B.ByteString -> Either String Config
|
| 75 | 75 |
parseConfig = A.decode
|
| 28 | 28 |
import qualified System.IO as Sys
|
| 29 | 29 |
import qualified System.Posix.IO as Posix
|
| 30 | 30 |
import qualified System.Posix.Terminal as Posix
|
| 31 | |
import Prelude (Either (Left), FilePath, IO, ($))
|
| 31 |
import Prelude (Either (Left), FilePath, IO, ($), (.))
|
| 32 | 32 |
|
| 33 | 33 |
-- | Produce a 'Left' value from a format string
|
| 34 | 34 |
throw :: F.Format (Either TL.Text r) a -> a
|
| 35 | 35 |
throw f =
|
| 36 | |
F.runFormat f (\b -> Left (TL.toLazyText b))
|
| 36 |
F.runFormat f (Left . TL.toLazyText)
|
| 37 | 37 |
|
| 38 | 38 |
stderr :: TL.Text -> IO ()
|
| 39 | 39 |
stderr = TL.hPutStr Sys.stderr
|
| 1 | |
{-# LANGUAGE OverloadedStrings #-}
|
| 2 | |
|
| 3 | 1 |
module Bricoleur
|
| 4 | 2 |
( main,
|
| 5 | 3 |
Opt.getOpts,
|