ghc-mod/src/GHCMod/Options/DocUtils.hs
2015-12-06 21:05:12 +03:00

37 lines
665 B
Haskell

module GHCMod.Options.DocUtils (
module PP,
desc,
code,
($$),
(##),
(<$$>),
(<||>)
) where
import Options.Applicative
import Data.Monoid (Monoid) -- for ghc<7.10
import Text.PrettyPrint.ANSI.Leijen as PP hiding ((<>), (<$>), (<$$>), int)
desc :: [Doc] -> InfoMod a
desc = footerDoc . Just . indent 2 . vsep
code :: [String] -> Doc
code x = vsep [line, indent 4 $ vsep $ map text x, line]
infixl 7 <||>
infixr 8 <$$>
infixr 8 $$
infixr 9 ##
($$) :: (a -> b) -> a -> b
($$) = ($)
(<||>) :: Alternative a => a b -> a b -> a b
(<||>) = (<|>)
(##) :: Monoid m => m -> m -> m
(##) = (<>)
(<$$>) :: Functor f => (a -> b) -> f a -> f b
(<$$>) = (<$>)