Get rid of withMetadata in examples

This commit is contained in:
Jeroen Engels 2022-06-21 17:53:06 +02:00
parent 64bcace002
commit f7ed9b7642
2 changed files with 12 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -1017,13 +1017,13 @@ their name, like [`withExpressionEnterVisitor`](#withExpressionEnterVisitor),
contextCreator : Rule.ContextCreator () Context contextCreator : Rule.ContextCreator () Context
contextCreator = contextCreator =
Rule.initContextCreator Rule.initContextCreator
(\metadata () -> (\isInSourceDirectories () ->
{ hasTodoBeenImported = False { hasTodoBeenImported = False
, hasToStringBeenImported = False , hasToStringBeenImported = False
, isInSourceDirectories = Rule.isInSourceDirectories metadata , isInSourceDirectories = isInSourceDirectories
} }
) )
|> Rule.withMetadata |> Rule.withIsInSourceDirectories
-} -}
newModuleRuleSchemaUsingContextCreator : String -> ContextCreator () moduleContext -> ModuleRuleSchema {} moduleContext newModuleRuleSchemaUsingContextCreator : String -> ContextCreator () moduleContext -> ModuleRuleSchema {} moduleContext
@ -1763,12 +1763,12 @@ you to request more information
fromModuleToProject : Rule.ContextCreator ModuleContext ProjectContext fromModuleToProject : Rule.ContextCreator ModuleContext ProjectContext
fromModuleToProject = fromModuleToProject =
Rule.initContextCreator Rule.initContextCreator
(\moduleKey metadata moduleContext -> (\moduleKey moduleName moduleContext ->
{ moduleKeys = Dict.singleton (Rule.moduleNameFromMetadata metadata) moduleKey { moduleKeys = Dict.singleton moduleName moduleKey
} }
) )
|> Rule.withModuleKey |> Rule.withModuleKey
|> Rule.withMetadata |> Rule.withModuleName
-} -}
withModuleContextUsingContextCreator : withModuleContextUsingContextCreator :
@ -4987,11 +4987,8 @@ accumulate visitor ( previousErrors, previousContext ) =
-- TODO Move this to a different module later on -- TODO Move this to a different module later on
{-| Create a context based on some other context. {-| Create a module context from a project context or the other way around.
Use functions like [`withMetadata`](#withMetadata) to request more information. Use functions like [`withModuleName`](#withModuleName) to request more information.
`from` will usually be a `projectContext` and `to` a `moduleContext`.
-} -}
type ContextCreator from to type ContextCreator from to
= ContextCreator (AvailableData -> from -> to) RequestedData = ContextCreator (AvailableData -> from -> to) RequestedData
@ -5009,13 +5006,13 @@ type RequestedData
contextCreator : Rule.ContextCreator () Context contextCreator : Rule.ContextCreator () Context
contextCreator = contextCreator =
Rule.initContextCreator Rule.initContextCreator
(\metadata () -> (\moduleName () ->
{ moduleName = Rule.moduleNameFromMetadata metadata { moduleName = moduleName
-- ...other fields -- ...other fields
} }
) )
|> Rule.withMetadata |> Rule.withModuleName
-} -}
initContextCreator : (from -> to) -> ContextCreator from to initContextCreator : (from -> to) -> ContextCreator from to