Safe Haskell | None |
---|---|
Language | Haskell98 |
General specific prelude for language-puppet. Customization of the Protolude with extra specific utilities.
Synopsis
- type Container = HashMap Text
- text2Scientific :: Text -> Maybe Scientific
- scientific2text :: Scientific -> Text
- strictifyEither :: Either a b -> Either a b
- ifromList :: (Monoid m, At m, Foldable f) => f (Index m, IxValue m) -> m
- ikeys :: (Eq k, Hashable k) => HashMap k v -> HashSet k
- ifromListWith :: (Monoid m, At m, Foldable f) => (IxValue m -> IxValue m -> IxValue m) -> f (Index m, IxValue m) -> m
- iinsertWith :: At m => (IxValue m -> IxValue m -> IxValue m) -> Index m -> IxValue m -> m -> m
- iunionWith :: (Hashable k, Eq k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
- dropInitialColons :: Text -> Text
- loggerName :: String
- logDebug :: Text -> IO ()
- logInfo :: Text -> IO ()
- logInfoStr :: String -> IO ()
- logWarning :: Text -> IO ()
- logWarningStr :: String -> IO ()
- logError :: Text -> IO ()
- logErrorStr :: String -> IO ()
- logCritical :: Text -> IO ()
- logCriticalStr :: String -> IO ()
- logDebugStr :: String -> IO ()
- unwrapError :: Doc -> Either PrettyError a -> IO a
- (<>) :: Semigroup a => a -> a -> a
- (<$$>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- (<//>) :: Doc -> Doc -> Doc
- align :: Doc -> Doc
- angles :: Doc -> Doc
- backslash :: Doc
- black :: Doc -> Doc
- blue :: Doc -> Doc
- bold :: Doc -> Doc
- braces :: Doc -> Doc
- brackets :: Doc -> Doc
- colon :: Doc
- column :: (Int -> Doc) -> Doc
- columns :: (Maybe Int -> Doc) -> Doc
- comma :: Doc
- cyan :: Doc -> Doc
- debold :: Doc -> Doc
- deunderline :: Doc -> Doc
- displayIO :: Handle -> SimpleDoc -> IO ()
- displayS :: SimpleDoc -> ShowS
- dot :: Doc
- dquote :: Doc
- dquotes :: Doc -> Doc
- dullblack :: Doc -> Doc
- dullblue :: Doc -> Doc
- dullcyan :: Doc -> Doc
- dullgreen :: Doc -> Doc
- dullmagenta :: Doc -> Doc
- dullred :: Doc -> Doc
- dullwhite :: Doc -> Doc
- dullyellow :: Doc -> Doc
- enclose :: Doc -> Doc -> Doc -> Doc
- encloseSep :: Doc -> Doc -> Doc -> [Doc] -> Doc
- equals :: Doc
- fill :: Int -> Doc -> Doc
- fillBreak :: Int -> Doc -> Doc
- fillCat :: [Doc] -> Doc
- fillSep :: [Doc] -> Doc
- flatAlt :: Doc -> Doc -> Doc
- green :: Doc -> Doc
- hPutDoc :: Handle -> Doc -> IO ()
- hang :: Int -> Doc -> Doc
- hardline :: Doc
- hcat :: [Doc] -> Doc
- hsep :: [Doc] -> Doc
- indent :: Int -> Doc -> Doc
- langle :: Doc
- lbrace :: Doc
- lbracket :: Doc
- line :: Doc
- linebreak :: Doc
- list :: [Doc] -> Doc
- lparen :: Doc
- magenta :: Doc -> Doc
- nest :: Int -> Doc -> Doc
- nesting :: (Int -> Doc) -> Doc
- onblack :: Doc -> Doc
- onblue :: Doc -> Doc
- oncyan :: Doc -> Doc
- ondullblack :: Doc -> Doc
- ondullblue :: Doc -> Doc
- ondullcyan :: Doc -> Doc
- ondullgreen :: Doc -> Doc
- ondullmagenta :: Doc -> Doc
- ondullred :: Doc -> Doc
- ondullwhite :: Doc -> Doc
- ondullyellow :: Doc -> Doc
- ongreen :: Doc -> Doc
- onmagenta :: Doc -> Doc
- onred :: Doc -> Doc
- onwhite :: Doc -> Doc
- onyellow :: Doc -> Doc
- parens :: Doc -> Doc
- plain :: Doc -> Doc
- punctuate :: Doc -> [Doc] -> [Doc]
- putDoc :: Doc -> IO ()
- rangle :: Doc
- rbrace :: Doc
- rbracket :: Doc
- red :: Doc -> Doc
- renderCompact :: Doc -> SimpleDoc
- renderPretty :: Float -> Int -> Doc -> SimpleDoc
- renderSmart :: Float -> Int -> Doc -> SimpleDoc
- rparen :: Doc
- semi :: Doc
- semiBraces :: [Doc] -> Doc
- sep :: [Doc] -> Doc
- softbreak :: Doc
- softline :: Doc
- space :: Doc
- squote :: Doc
- squotes :: Doc -> Doc
- tupled :: [Doc] -> Doc
- underline :: Doc -> Doc
- vcat :: [Doc] -> Doc
- vsep :: [Doc] -> Doc
- white :: Doc -> Doc
- yellow :: Doc -> Doc
- data Doc
- class Pretty a where
- pretty :: a -> Doc
- prettyList :: [a] -> Doc
- data SimpleDoc
- newtype PrettyError = PrettyError {}
- pplines :: Text -> Doc
- ppline :: Text -> Doc
- ppstring :: String -> Doc
- pptext :: String -> Doc
Documentation
text2Scientific :: Text -> Maybe Scientific Source #
scientific2text :: Scientific -> Text Source #
strictifyEither :: Either a b -> Either a b Source #
ifromList :: (Monoid m, At m, Foldable f) => f (Index m, IxValue m) -> m Source #
Helper for hashmap, in case we want another kind of map.
ikeys :: (Eq k, Hashable k) => HashMap k v -> HashSet k Source #
Return all the keys of a map in a set.
ifromListWith :: (Monoid m, At m, Foldable f) => (IxValue m -> IxValue m -> IxValue m) -> f (Index m, IxValue m) -> m Source #
iinsertWith :: At m => (IxValue m -> IxValue m -> IxValue m) -> Index m -> IxValue m -> m -> m Source #
iunionWith :: (Hashable k, Eq k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v Source #
dropInitialColons :: Text -> Text Source #
Remove the '::' token from a text if any.
loggerName :: String Source #
logInfoStr :: String -> IO () Source #
logWarning :: Text -> IO () Source #
logWarningStr :: String -> IO () Source #
logErrorStr :: String -> IO () Source #
logCritical :: Text -> IO () Source #
logCriticalStr :: String -> IO () Source #
logDebugStr :: String -> IO () Source #
unwrapError :: Doc -> Either PrettyError a -> IO a Source #
In case of a Left error, print and exit immediately.
deunderline :: Doc -> Doc #
dullmagenta :: Doc -> Doc #
dullyellow :: Doc -> Doc #
ondullblack :: Doc -> Doc #
ondullblue :: Doc -> Doc #
ondullcyan :: Doc -> Doc #
ondullgreen :: Doc -> Doc #
ondullmagenta :: Doc -> Doc #
ondullwhite :: Doc -> Doc #
ondullyellow :: Doc -> Doc #
renderCompact :: Doc -> SimpleDoc #
semiBraces :: [Doc] -> Doc #
Instances
Show Doc | |
IsString Doc | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal fromString :: String -> Doc # | |
Semigroup Doc | |
Monoid Doc | |
Pretty Doc | |
Defined in Text.PrettyPrint.ANSI.Leijen.Internal | |
MonadWriter InterpreterWriter InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types writer :: (a, InterpreterWriter) -> InterpreterMonad a # tell :: InterpreterWriter -> InterpreterMonad () # listen :: InterpreterMonad a -> InterpreterMonad (a, InterpreterWriter) # pass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterMonad a # | |
MonadThrowPos (Either Doc) Source # | |
Defined in Puppet.Interpreter.Types |
Instances
newtype PrettyError Source #
Instances
Show PrettyError Source # | |
Defined in XPrelude.PP showsPrec :: Int -> PrettyError -> ShowS # show :: PrettyError -> String # showList :: [PrettyError] -> ShowS # | |
IsString PrettyError Source # | |
Defined in XPrelude.PP fromString :: String -> PrettyError # | |
Semigroup PrettyError Source # | |
Defined in XPrelude.PP (<>) :: PrettyError -> PrettyError -> PrettyError # sconcat :: NonEmpty PrettyError -> PrettyError # stimes :: Integral b => b -> PrettyError -> PrettyError # | |
Monoid PrettyError Source # | |
Defined in XPrelude.PP mempty :: PrettyError # mappend :: PrettyError -> PrettyError -> PrettyError # mconcat :: [PrettyError] -> PrettyError # | |
Pretty PrettyError Source # | |
Defined in XPrelude.PP pretty :: PrettyError -> Doc # prettyList :: [PrettyError] -> Doc # | |
MonadError PrettyError InterpreterMonad Source # | |
Defined in Puppet.Interpreter.Types throwError :: PrettyError -> InterpreterMonad a # catchError :: InterpreterMonad a -> (PrettyError -> InterpreterMonad a) -> InterpreterMonad a # |