-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate clang-format config based on some existing code base -- -- Please see the README on GitHub at -- https://github.com/0xd34df00d/coformat#readme @package coformat @version 0.3.0.0 module Language.Coformat.Descr data Stage Parsed :: Stage Supported :: Stage Value :: Stage type family CTData f ty data ConfigTypeT f CTInt :: CTData f Int -> ConfigTypeT f CTUnsigned :: CTData f Natural -> ConfigTypeT f CTBool :: CTData f Bool -> ConfigTypeT f CTString :: CTData f Void -> ConfigTypeT f CTStringVec :: CTData f Void -> ConfigTypeT f CTRawStringFormats :: CTData f Void -> ConfigTypeT f CTIncludeCats :: CTData f Void -> ConfigTypeT f CTEnum :: [Text] -> CTData f Text -> ConfigTypeT f [variants] :: ConfigTypeT f -> [Text] [enumValue] :: ConfigTypeT f -> CTData f Text data ConfigItemT f ConfigItem :: [Text] -> ConfigTypeT f -> ConfigItemT f [name] :: ConfigItemT f -> [Text] [value] :: ConfigItemT f -> ConfigTypeT f instance GHC.Show.Show (Language.Coformat.Descr.ConfigTypeT 'Language.Coformat.Descr.Parsed) instance GHC.Show.Show (Language.Coformat.Descr.ConfigTypeT 'Language.Coformat.Descr.Supported) instance GHC.Show.Show (Language.Coformat.Descr.ConfigTypeT 'Language.Coformat.Descr.Value) instance GHC.Classes.Eq (Language.Coformat.Descr.ConfigTypeT 'Language.Coformat.Descr.Value) instance GHC.Show.Show (Language.Coformat.Descr.ConfigItemT 'Language.Coformat.Descr.Parsed) instance GHC.Show.Show (Language.Coformat.Descr.ConfigItemT 'Language.Coformat.Descr.Supported) instance GHC.Show.Show (Language.Coformat.Descr.ConfigItemT 'Language.Coformat.Descr.Value) module Clang.Format.StyOpts data StyOpts StyOpts :: Text -> [ConfigItemT 'Value] -> StyOpts [basedOnStyle] :: StyOpts -> Text [additionalOpts] :: StyOpts -> [ConfigItemT 'Value] formatStyArg :: StyOpts -> ByteString instance Data.Aeson.Types.ToJSON.ToJSON Clang.Format.StyOpts.StyOpts module Clang.Format.YamlConversions fillConfigItems :: (MonadError e m, CoHas ParseException e, CoHas YamlAnalysisError e, CoHas ValueNotFound e) => [ConfigItemT 'Supported] -> ByteString -> m [ConfigItemT 'Value] data FillError data YamlConfigType StyleDump :: YamlConfigType PartialConfig :: YamlConfigType preprocessYaml :: (MonadError e m, CoHas ParseException e, CoHas YamlAnalysisError e, CoHas ValueNotFound e) => YamlConfigType -> ByteString -> m Object collectConfigItems :: (MonadError e m, CoHas ParseException e, CoHas YamlAnalysisError e) => [ConfigItemT 'Supported] -> Object -> m [ConfigItemT 'Value] formatClangFormat :: StyOpts -> ByteString instance Control.Monad.Except.CoHas.CoHas Clang.Format.YamlConversions.ValueNotFound Clang.Format.YamlConversions.FillError instance Control.Monad.Except.CoHas.CoHas Clang.Format.YamlConversions.YamlAnalysisError Clang.Format.YamlConversions.FillError instance Control.Monad.Except.CoHas.CoHas Data.Yaml.Internal.ParseException Clang.Format.YamlConversions.FillError instance GHC.Generics.Generic Clang.Format.YamlConversions.FillError instance GHC.Show.Show Clang.Format.YamlConversions.FillError instance GHC.Show.Show Clang.Format.YamlConversions.ValueNotFound instance GHC.Show.Show Clang.Format.YamlConversions.YamlAnalysisError module Clang.Format.DescrParser parseDescr :: ByteString -> Either String [ConfigItemT 'Parsed] module Language.Coformat.Descr.Operations filterParsedItems :: [ConfigItemT 'Parsed] -> [ConfigItemT 'Supported] replaceItemsWith :: [ConfigItemT 'Value] -> [ConfigItemT 'Value] -> [ConfigItemT 'Value] subtractMatching :: [ConfigItemT 'Value] -> [ConfigItemT 'Value] -> [ConfigItemT 'Value] type ParseableConfigState f = (CTData f Void ~ Void, Show (ConfigTypeT f)) parseConfigValue :: (MonadError String m, ParseableConfigState f) => ConfigItemT f -> String -> m (ConfigItemT 'Value) module Language.Coformat.Formatter.Failure data ExpectedFailure FormatterSegfaulted :: Text -> ExpectedFailure data UnexpectedFailure FormatterFailure :: Int -> Text -> UnexpectedFailure [errorCode] :: UnexpectedFailure -> Int [errorOutput] :: UnexpectedFailure -> Text data Failure ExpectedFailure :: ExpectedFailure -> Failure UnexpectedFailure :: UnexpectedFailure -> Failure failuresAreUnexpected :: Failure -> UnexpectedFailure instance Control.Monad.Except.CoHas.CoHas Language.Coformat.Formatter.Failure.UnexpectedFailure Language.Coformat.Formatter.Failure.Failure instance Control.Monad.Except.CoHas.CoHas Language.Coformat.Formatter.Failure.ExpectedFailure Language.Coformat.Formatter.Failure.Failure instance GHC.Generics.Generic Language.Coformat.Formatter.Failure.Failure instance GHC.Show.Show Language.Coformat.Formatter.Failure.Failure instance GHC.Classes.Eq Language.Coformat.Formatter.Failure.Failure instance GHC.Show.Show Language.Coformat.Formatter.Failure.UnexpectedFailure instance GHC.Classes.Eq Language.Coformat.Formatter.Failure.UnexpectedFailure instance GHC.Show.Show Language.Coformat.Formatter.Failure.ExpectedFailure instance GHC.Classes.Eq Language.Coformat.Formatter.Failure.ExpectedFailure module Language.Coformat.Score data Score calcScore :: PreparedFile -> ByteString -> Score data PreparedFile filename :: PreparedFile -> FilePath prepareFile :: MonadIO m => FilePath -> m PreparedFile instance GHC.Base.Monoid Language.Coformat.Score.Score instance GHC.Base.Semigroup Language.Coformat.Score.Score instance GHC.Generics.Generic Language.Coformat.Score.Score instance GHC.Enum.Bounded Language.Coformat.Score.Score instance GHC.Classes.Ord Language.Coformat.Score.Score instance GHC.Classes.Eq Language.Coformat.Score.Score instance GHC.Classes.Eq Language.Coformat.Score.PreparedFile instance GHC.Show.Show Language.Coformat.Score.Score module Language.Coformat.Util update :: Int -> (a -> a) -> [a] -> [a] forConcurrently' :: (MonadLoggerIO m, MonadError e m) => [a] -> (forall m'. (MonadLoggerIO m', MonadError e m') => a -> m' b) -> m [b] forConcurrentlyPooled :: (MonadLoggerIO m, MonadError e m, MonadReader r m, Has TaskGroup r) => [a] -> (forall m'. (MonadLoggerIO m', MonadReader r m', MonadError e m') => a -> m' b) -> m [b] convert :: MonadError e' m => (e -> e') -> ExceptT e m a -> m a subsetsN :: Natural -> [a] -> [[a]] module Language.Coformat.Formatter data OptsDescription stage OptsDescription :: [ConfigItemT stage] -> [Text] -> OptsDescription stage [knownOpts] :: OptsDescription stage -> [ConfigItemT stage] [baseStyles] :: OptsDescription stage -> [Text] data OptsSource opts StaticOpts :: opts -> OptsSource opts OptsFromFile :: FilePath -> (ByteString -> Either String opts) -> OptsSource opts OptsFromCmd :: CmdArgs -> (ByteString -> Either String opts) -> OptsSource opts parseOpts :: (MonadIO m, MonadError String m) => String -> OptsSource opts -> m opts data FormatterInfo FormatterInfo :: String -> OptsSource (OptsDescription 'Supported) -> [ConfigItemT 'Value] -> (Text -> [ConfigItemT 'Supported] -> [ConfigItemT 'Value] -> OptsSource [ConfigItemT 'Value]) -> (Text -> [ConfigItemT 'Value] -> FilePath -> CmdArgs) -> (Text -> [ConfigItemT 'Value] -> ByteString) -> FormatterInfo [execName] :: FormatterInfo -> String [formatterOpts] :: FormatterInfo -> OptsSource (OptsDescription 'Supported) [hardcodedOpts] :: FormatterInfo -> [ConfigItemT 'Value] [defaultStyleOpts] :: FormatterInfo -> Text -> [ConfigItemT 'Supported] -> [ConfigItemT 'Value] -> OptsSource [ConfigItemT 'Value] [formatFile] :: FormatterInfo -> Text -> [ConfigItemT 'Value] -> FilePath -> CmdArgs [serializeOptions] :: FormatterInfo -> Text -> [ConfigItemT 'Value] -> ByteString newtype CmdArgs CmdArgs :: [ByteString] -> CmdArgs [args] :: CmdArgs -> [ByteString] runCommand :: (MonadError err m, CoHas UnexpectedFailure err, CoHas ExpectedFailure err, MonadIO m) => String -> CmdArgs -> m ByteString data Formatter [Formatter] :: forall resumeObj. {formatterInfo :: FormatterInfo, parseResumeObject :: ByteString -> Either String resumeObj, parseResumeOptions :: [ConfigItemT 'Supported] -> resumeObj -> Either String (Text, [ConfigItemT 'Value])} -> Formatter instance GHC.Show.Show Language.Coformat.Formatter.CmdArgs module Clang.Format.Formatter clangFormatter :: Formatter module Language.Coformat.Variables data KnownVariateType Categorical :: KnownVariateType Integral :: KnownVariateType class Variate a where { type family VariateResult a :: Type -> Type; type family VariateType a :: KnownVariateType; } variate :: Variate a => a -> VariateResult a a varPrism :: Variate a => Prism' (ConfigTypeT 'Value) a data Variable varTy [MkDV] :: (Variate a, VariateType a ~ varTy, Foldable (VariateResult a)) => a -> Variable varTy data IxedVariable varTy IxedVariable :: Variable varTy -> Int -> IxedVariable varTy [discreteVar] :: IxedVariable varTy -> Variable varTy [varIdx] :: IxedVariable varTy -> Int type CategoricalVariate a = (Variate a, VariateType a ~ 'Categorical) type CategoricalVariable = Variable 'Categorical type IxedCategoricalVariable = IxedVariable 'Categorical type EnumVar = ([Text], Text) typToDV :: ConfigTypeT 'Value -> Maybe CategoricalVariable searchSpace :: Show a => Integral a => a -> [a] type IntegralVariate a = (Variate a, VariateType a ~ 'Integral) type IntegralVariable = Variable 'Integral type IxedIntegralVariable = IxedVariable 'Integral typToIV :: ConfigTypeT 'Value -> Maybe IntegralVariable data SomeIxedVariable :: Type [SomeIxedVariable] :: IxedVariable varTy -> SomeIxedVariable asSome :: [IxedVariable varTy] -> [SomeIxedVariable] instance Language.Coformat.Variables.Variate Language.Coformat.Variables.EnumVar instance Language.Coformat.Variables.Variate GHC.Types.Bool instance Language.Coformat.Variables.Variate GHC.Types.Int instance Language.Coformat.Variables.Variate GHC.Natural.Natural module Language.Coformat.Optimization data FmtEnv FmtEnv :: Text -> [PreparedFile] -> [ConfigItemT 'Value] -> FormatterInfo -> FmtEnv [baseStyle] :: FmtEnv -> Text [preparedFiles] :: FmtEnv -> [PreparedFile] [constantOpts] :: FmtEnv -> [ConfigItemT 'Value] [formatterInfo] :: FmtEnv -> FormatterInfo data OptEnv OptEnv :: [IxedCategoricalVariable] -> [IxedIntegralVariable] -> Natural -> OptEnv [categoricalVariables] :: OptEnv -> [IxedCategoricalVariable] [integralVariables] :: OptEnv -> [IxedIntegralVariable] [maxSubsetSize] :: OptEnv -> Natural runFormat :: (MonadError err m, CoHas UnexpectedFailure err, CoHas ExpectedFailure err, MonadIO m, MonadLogger m) => FormatterInfo -> PreparedFile -> String -> Text -> [ConfigItemT 'Value] -> m Score type OptMonad err r m = (MonadLoggerIO m, MonadError err m, CoHas UnexpectedFailure err, MonadReader r m, Has FmtEnv r) runFormatFiles :: (OptMonad err r m, CoHas ExpectedFailure err) => [ConfigItemT 'Value] -> String -> m Score chooseBaseStyle :: (MonadError String m, MonadLoggerIO m) => FormatterInfo -> [Text] -> [ConfigItemT 'Value] -> [PreparedFile] -> m (Text, Score) variateAt :: forall a. (Variate a, Foldable (VariateResult a)) => Proxy a -> Int -> [ConfigItemT 'Value] -> [[ConfigItemT 'Value]] data OptState OptState :: [ConfigItemT 'Value] -> Score -> OptState [currentOpts] :: OptState -> [ConfigItemT 'Value] [currentScore] :: OptState -> Score initOptState :: [ConfigItemT 'Value] -> Score -> OptState dropExpectedFailures :: OptMonad err r m => (forall err' r' m'. (OptMonad err' r' m', CoHas ExpectedFailure err') => m' Score) -> m Score variateSubset :: [SomeIxedVariable] -> [ConfigItemT 'Value] -> [[ConfigItemT 'Value]] showVariated :: [SomeIxedVariable] -> [ConfigItemT 'Value] -> String chooseBestSubset :: (OptMonad err r m, Has OptState r, Has TaskGroup r) => Natural -> [SomeIxedVariable] -> m (Maybe ([ConfigItemT 'Value], Score)) stepGDGeneric' :: (OptMonad err r m, Has TaskGroup r, Has OptEnv r, MonadState OptState m) => Natural -> [OptEnv -> [SomeIxedVariable]] -> m () stepGDGeneric :: (OptMonad err r m, Has TaskGroup r, Has OptEnv r, MonadState OptState m) => Natural -> [OptEnv -> [SomeIxedVariable]] -> m () fixGD :: (OptMonad err r m, Has TaskGroup r, Has OptEnv r, MonadState OptState m, err ~ UnexpectedFailure) => Maybe Int -> Natural -> m () instance GHC.Show.Show Language.Coformat.Optimization.OptState module Language.Coformat.Pipeline runOptPipeline :: (MonadError String m, MonadLoggerIO m) => PipelineOpts -> m ByteString data PipelineOpts PipelineOpts :: Maybe Natural -> Maybe FilePath -> NonEmpty FilePath -> TaskGroup -> [String] -> Formatter -> PipelineOpts [maxSubsetSize] :: PipelineOpts -> Maybe Natural [resumePath] :: PipelineOpts -> Maybe FilePath [input] :: PipelineOpts -> NonEmpty FilePath [taskGroup] :: PipelineOpts -> TaskGroup [forceStrs] :: PipelineOpts -> [String] [formatter] :: PipelineOpts -> Formatter