@[inline]
Equations
- Function.comp f g x = f (g x)
@[inline]
Equations
- Function.const β a x = a
@[macroInline]
Equations
- False.elim h = False.rec (fun x => C) h
Equations
- namedPattern x a h = a
@[nospecialize]
- default : α
Instances
- instInhabited
- instInhabitedSort
- instInhabitedForAll_1
- instInhabitedProp
- IO.AsyncList.instInhabitedAsyncList
- Lean.Elab.instInhabitedTacticInfo
- Lean.instInhabitedDeclarationRanges
- Lean.instInhabitedRat
- IO.instInhabitedError
- Lean.instInhabitedDataValue
- Lean.Macro.instInhabitedMethods
- Lean.instInhabitedConstructorVal
- Std.PersistentHashMap.instInhabitedNode
- Lean.Meta.Match.instInhabitedMatchEqns
- Lean.instInhabitedExprStructEq
- Lean.instInhabitedFVarIdMap
- ExceptCpsT.instInhabitedExceptCpsT
- Lean.instInhabitedEnvExtensionState
- Lean.Lsp.instInhabitedCancelParams
- Lean.ParserCompiler.instInhabitedCombinatorAttribute
- Lean.Meta.instInhabitedCongrLemma
- Lean.Server.Snapshots.instInhabitedSnapshot
- Lean.Xml.instInhabitedContent
- Lean.Elab.Term.StructInst.instInhabitedField
- Lean.instInhabitedTheoremVal
- Lean.Elab.instInhabitedDefView
- ByteArray.instInhabitedByteArray
- Lean.Meta.Simp.instInhabitedStep
- instInhabitedUInt32
- Lean.instInhabitedPosition
- Lean.Meta.Simp.instInhabitedConfig
- Lean.instInhabitedFVarId
- Lean.JsonRpc.instInhabitedResponseError
- instInhabitedUInt8
- Lean.Widget.instInhabitedMsgToInteractive
- Lean.instInhabitedOpaqueVal
- Lean.instInhabitedJson
- instInhabitedForInStep
- instInhabitedEIO
- Lean.instInhabitedTagAttribute
- instInhabitedSubstring
- instInhabitedStdGen
- IO.FS.instInhabitedStream
- Lean.Elab.instInhabitedInfoTree
- Lean.Meta.instInhabitedAuxLemmas
- Lean.Parser.instInhabitedParser
- Lean.Parser.instInhabitedLeadingIdentBehavior
- Lean.Parser.Trie.instInhabitedTrie
- Lean.instInhabitedStructureFieldInfo
- Lean.Meta.instInhabitedUnificationHints
- Lean.Meta.instInhabitedAltVarNames
- Lean.instInhabitedAxiomVal
- Lean.instInhabitedStructureInfo
- Lean.Parser.instInhabitedParserFn
- Lean.Elab.WF.instInhabitedTerminationHint
- Lean.instInhabitedInternalExceptionId
- Lean.Meta.DiscrTree.instInhabitedKey
- Lean.Parser.instInhabitedError
- Lean.Elab.instInhabitedMacroExpansionInfo
- Lean.IR.ExplicitRC.instInhabitedVarInfo
- Lean.Lsp.instInhabitedCompletionItemKind
- Lean.Elab.Term.instInhabitedNamedArg
- Lean.Elab.Command.instInhabitedInductiveView
- Lean.instInhabitedScopedEnvExtension
- Lean.instInhabitedDefinitionSafety
- Lean.instInhabitedEnumAttributes
- instInhabitedExceptT
- Std.instInhabitedFormat
- Lean.instInhabitedQuotKind
- Lean.instInhabitedSourceInfo
- Lean.Elab.instInhabitedPreDefinition
- Lean.SSet.instInhabitedSSet
- Lean.Parser.instInhabitedInputContext
- Lean.Lsp.instInhabitedDiagnosticSeverity
- Lean.Widget.instInhabitedEmbedFmt
- Lean.SimplePersistentEnvExtension.instInhabitedSimplePersistentEnvExtension
- Std.HashMap.instInhabitedHashMap
- Lean.Compiler.instInhabitedSpecInfo
- Lean.JsonRpc.instInhabitedRequest
- Lean.Meta.Match.instInhabitedMatchEqnsExtState
- EStateM.instInhabitedResult
- Lean.Elab.Term.instInhabitedTermElabResult
- Lean.Server.instInhabitedDocumentMeta
- Std.PersistentHashMap.instInhabitedPersistentHashMap
- Lean.Lsp.instInhabitedCompletionItem
- Lean.IR.UnreachableBranches.instInhabitedValue
- Lean.MetavarContext.instInhabitedMetavarContext
- Lean.Meta.instInhabitedParamInfo
- Lean.instInhabitedEnvironment
- Lean.Meta.instInhabitedUnificationHintEntry
- Lean.instInhabitedOptionDecl
- Lean.Meta.instInhabitedPostponedEntry
- Lean.instInhabitedLocalInstance
- Lean.Elab.Term.instInhabitedMVarErrorInfo
- Lean.instInhabitedPrefixTreeNode
- Lean.NameSSet.instInhabitedNameSSet
- Lean.instInhabitedFileMap
- Lean.NameHashSet.instInhabitedNameHashSet
- Lean.Widget.instInhabitedCodeToken
- Lean.Meta.instInhabitedSimpLemmas
- Lean.IR.instInhabitedVarId
- Lean.Elab.instInhabitedModifiers
- Lean.instInhabitedConstantInfo
- Lean.IR.instInhabitedParam
- Lean.Parser.instInhabitedParserCategory
- Lean.KeyedDeclsAttribute.instInhabitedExtensionState
- Subtype.instInhabitedSubtype
- IO.FS.instInhabitedSystemTime
- Lean.Meta.instInhabitedInfoCacheKey
- Lean.Elab.Term.instInhabitedSavedState
- Lean.instInhabitedKVMap
- instInhabitedPUnit
- Lean.instInhabitedLocalContext
- Lean.instInhabitedData
- Lean.Widget.MsgEmbed.instInhabitedRpcEncodingPacket
- Lean.PrettyPrinter.Delaborator.SubExpr.instInhabitedHoleIterator
- instInhabitedOption
- Lean.Elab.instInhabitedElabInfo
- Lean.Elab.Structural.instInhabitedM
- Lean.Elab.instInhabitedInfoState
- Lean.Meta.Simp.instInhabitedContext
- Lean.Meta.IndPredBelow.instInhabitedVariables
- Lean.instInhabitedAttributeApplicationTime
- Lean.Meta.instInhabitedInstanceEntry
- Lean.instInhabitedBinderInfo
- Lean.Lsp.instInhabitedPosition
- Lean.Macro.instInhabitedMethodsRef
- Lean.instInhabitedDeclaration
- String.instInhabitedRange
- Lean.instInhabitedSyntax
- Lean.instInhabitedRecursorRule
- Lean.MapDeclarationExtension.instInhabitedMapDeclarationExtension
- Lean.instInhabitedQuotVal
- Lean.instInhabitedExternAttrData
- Lean.PrettyPrinter.Delaborator.instInhabitedSubExpr
- Lean.Lsp.instInhabitedLeanFileProgressKind
- Lean.Elab.instInhabitedDefViewElabHeader
- instInhabitedUInt64
- Lean.Widget.instInhabitedInteractiveTermGoal
- Lean.Meta.instInhabitedCaseArraySizesSubgoal
- Lean.instInhabitedData_1
- Lean.Widget.instInhabitedInfoPopup
- Lean.Parser.instInhabitedPrattParsingTables
- Lean.Elab.instInhabitedRecKind
- Lean.Elab.Command.instInhabitedElabHeaderResult
- Lean.NameSet.instInhabitedNameSet
- Lean.instInhabitedOption
- Lean.Compiler.instInhabitedSpecState
- Lean.CollectFVars.instInhabitedState
- Lean.instInhabitedExpr
- Lean.instMVarIdSetInhabited
- Lean.instInhabitedAttributeExtensionState
- Lean.Elab.WF.instInhabitedTerminationHintValue
- Lean.Meta.Simp.instInhabitedResult
- instInhabitedUInt16
- Lean.Compiler.instInhabitedSpecializeAttributeKind
- Lean.CollectMVars.instInhabitedState
- Lean.Elab.Command.instInhabitedStructFieldKind
- Lean.Elab.Command.instInhabitedScope
- Std.Format.instInhabitedFlattenBehavior
- Lean.Lsp.instInhabitedDiagnosticCode
- Lean.Elab.instInhabitedInfo
- Lean.IR.instInhabitedIRType
- Lean.Lsp.instInhabitedDiagnosticRelatedInformation
- Lean.Elab.instInhabitedContextInfo
- Lean.instInhabitedReducibilityHints
- Lean.Parser.instInhabitedParserInfo
- Lean.Lsp.instInhabitedDiagnosticTag
- Lean.Elab.Term.StructInst.instInhabitedFieldVal
- Lean.instInhabitedMessageData
- Lean.Elab.instInhabitedTerminationHints
- Lean.Elab.WF.instInhabitedTerminationByElement
- Lean.Meta.instInhabitedDefaultInstances
- Lean.Meta.instInhabitedCaseValuesSubgoal
- Lean.Parser.instInhabitedModuleParserState
- Lean.Elab.Term.Do.instInhabitedAlt
- Lean.Meta.Match.instInhabitedPattern
- Lean.instInhabitedPrefixTree
- Lean.instInhabitedNameGenerator
- Lean.instInhabitedLazyInitExtension
- Lean.Elab.Term.StructInst.instInhabitedExplicitSourceInfo
- Lean.Meta.DiscrTree.instInhabitedDiscrTree
- instInhabitedTrue
- Lean.instInhabitedProjectionFunctionInfo
- Lean.instInhabitedEnvironmentHeader
- Std.instInhabitedRBTree
- Lean.IR.instInhabitedVarIdSet
- Lean.IR.instInhabitedLiveVarSet
- Lean.IR.instInhabitedIndexSet
- Std.instInhabitedPersistentArray
- Lean.Elab.instInhabitedVisibility
- Lean.instInhabitedDefinitionVal
- Lean.Elab.WF.instInhabitedTerminationBy
- Lean.Meta.instInhabitedSavedState
- Lean.instInhabitedParametricAttribute
- Std.PersistentHashMap.instInhabitedEntry
- Lean.Server.instInhabitedReference
- instInhabitedList
- Lean.Widget.instInhabitedTaggedText
- Lean.instInhabitedPPFns
- Lean.Lsp.instInhabitedLineRange
- Lean.ScopedEnvExtension.instInhabitedScopedEntries
- Lean.instInhabitedNameTrie
- Lean.instInhabitedLOption
- Lean.Elab.WF.instInhabitedEqnInfo
- Lean.instInhabitedMetavarKind
- Lean.instInhabitedRecursorVal
- Lean.Elab.instInhabitedAttribute
- Lean.instInhabitedMessageLog
- Lean.Compiler.instInhabitedSpecEntry
- Lean.Lsp.instInhabitedDiagnosticWith
- instInhabitedReaderT
- Lean.Server.instInhabitedRequestM
- Lean.Meta.SynthInstance.instInhabitedSynthM
- Lean.Core.instInhabitedCoreM
- Lean.Elab.Term.instInhabitedTermElabM
- Lean.PrettyPrinter.Delaborator.instInhabitedDelabM
- Lean.Elab.Command.instInhabitedCommandElabM
- Lean.Meta.instInhabitedMetaM
- Lean.Widget.TaggedText.instInhabitedTaggedState
- Lean.instInhabitedOccurrences
- Lean.Parser.TokenMap.instInhabitedTokenMap
- Sum.inhabitedLeft
- Sum.inhabitedRight
- EStateM.instInhabitedEStateM
- Lean.Lsp.instInhabitedPublishDiagnosticsParams
- Std.instInhabitedAssocList
- Lean.Parser.instInhabitedFirstTokens
- Lean.IR.instInhabitedAlt
- Lean.Elab.Term.instInhabitedMatchAltView
- Lean.Elab.Term.Do.instInhabitedCode
- Lean.instInhabitedMessage
- Lean.Meta.Match.instInhabitedProblem
- Lean.Meta.Simp.instInhabitedMethods
- Lean.instInhabitedPersistentEnvExtension
- Lean.Elab.Eqns.instInhabitedEqnInfoCore
- Lean.JsonRpc.instInhabitedNotification
- Lean.TagDeclarationExtension.instInhabitedTagDeclarationExtension
- Lean.instInhabitedTraceElem
- instInhabitedFloat
- Lean.instInhabitedModuleIdx
- Lean.Meta.instInhabitedCache
- instInhabitedNat
- Std.Format.instInhabitedSpaceResult
- Lean.Meta.instInhabitedTransparencyMode
- Lean.instInhabitedLBool
- Lean.JsonRpc.instInhabitedRequestID
- instInhabitedEST
- Lean.instInhabitedStructureState
- Lean.instInhabitedTraceState
- Lean.ScopedEnvExtension.instInhabitedDescr
- Lean.instInhabitedStructureDescr
- Lean.instInhabitedAttributeImpl
- Lean.Macro.instInhabitedState
- Lean.Lsp.instInhabitedRange
- Lean.Elab.Command.instInhabitedStructFieldInfo
- Lean.instFVarIdHashSetInhabited
- Lean.instInhabitedModuleData
- Lean.Meta.instInhabitedCongrLemmas
- Lean.IR.instInhabitedArg
- Lean.Meta.instInhabitedSimpLemma
- Lean.Meta.instInhabitedState
- Lean.Parser.ParserExtension.instInhabitedEntry
- Lean.instInhabitedConstantVal
- instInhabitedPNonScalar
- Lean.instInhabitedLocalDecl
- Lean.instInhabitedParserDescr
- Lean.Elab.Term.Do.ToTerm.instInhabitedKind
- Lean.Elab.Term.instInhabitedMVarErrorKind
- Lean.Elab.Tactic.instInhabitedState
- Std.instInhabitedPersistentArrayNode
- Lean.Parser.ParserExtension.instInhabitedState
- Lean.Lsp.instInhabitedRefIdent
- Lean.JsonRpc.instInhabitedErrorCode
- Array.instInhabitedArray
- Lean.OpenDecl.instInhabitedOpenDecl
- Lean.instInhabitedPersistentEnvExtensionState
- Lean.Meta.DiscrTree.instInhabitedTrie
- Lean.IR.instInhabitedDecl
- Lean.Widget.instInhabitedInteractiveGoal
- Lean.CollectLevelParams.instInhabitedState
- Lean.Meta.instInhabitedGeneralizeArg
- Lean.Meta.Match.instInhabitedAlt
- Lean.instInhabitedMVarId
- Lean.Compiler.CSimp.instInhabitedEntry
- Lean.Meta.instInhabitedAbstractMVarsResult
- Lean.Meta.instInhabitedFVarSubst
- instInhabitedProd
- Lean.instInhabitedReducibilityStatus
- Lean.instInhabitedDeclarationRange
- Lean.instInhabitedMVarIdMap
- Lean.Elab.Eqns.instInhabitedEqnsExtState
- System.instInhabitedFilePath
- Lean.Widget.instInhabitedMsgEmbed
- Lean.Widget.instInhabitedGetInteractiveDiagnosticsParams
- Lean.Elab.instInhabitedCommandInfo
- Lean.instInhabitedInductiveVal
- Lean.Meta.instInhabitedSimpEntry
- Lean.KeyedDeclsAttribute.instInhabitedDef
- Lean.Lsp.instInhabitedLocation
- Lean.Widget.instInhabitedInfoWithCtx
- Lean.Meta.SimpAll.instInhabitedEntry
- Std.HashSet.instInhabitedHashSet
- Lean.instInhabitedOptionDecls
- Std.PersistentHashSet.instInhabitedPersistentHashSet
- Lean.instInhabitedAttributeKind
- Lean.instInhabitedOptions
- instInhabitedBool
- Lean.instInhabitedConstructor
- FloatArray.instInhabitedFloatArray
- Lean.instInhabitedMacroScopesView
- Lean.instInhabitedException
- Lean.Elab.instInhabitedFieldInfo
- Lean.Elab.Term.StructInst.instInhabitedStruct
- Lean.Meta.Match.Extension.instInhabitedState
- Lean.Elab.Term.instInhabitedArg
- Lean.Elab.Command.instInhabitedCtorView
- Lean.instInhabitedHeadIndex
- Lean.Elab.instInhabitedTermInfo
- Lean.Elab.Term.CollectPatternVars.instInhabitedContext
- Lean.NameMap.instInhabitedNameMap
- Lean.Widget.instInhabitedInteractiveHypothesis
- Lean.Meta.instInhabitedInductionSubgoal
- instInhabitedExcept
- instInhabitedNonemptyType
- Lean.Elab.Eqns.instInhabitedUnfoldEqnExtState
- Lean.Elab.Term.StructInst.instInhabitedSource
- Lean.Elab.Command.instInhabitedState
- instInhabitedOrdering
- Lean.ScopedEnvExtension.instInhabitedStateStack
- Lean.Meta.instInhabitedInstances
- Lean.Meta.Closure.instInhabitedToProcessElement
- Lean.instInhabitedAttributeImplCore
- Lean.Compiler.instInhabitedSpecArgKind
- Lean.JsonRpc.instInhabitedResponse
- Lean.instInhabitedMessageSeverity
- Lean.instInhabitedName
- Lean.instInhabitedLiteral
- Lean.Meta.SynthInstance.instInhabitedConsumerNode
- Lean.Elab.Structural.instInhabitedEqnInfo
- String.instInhabitedString
- Lean.EnvExtension.instInhabitedEnvExtension
- Lean.instInhabitedClassState
- instInhabitedTask
- instInhabitedUSize
- Lean.KeyedDeclsAttribute.instInhabitedOLeanEntry
- instInhabitedNonScalar
- Lean.instInhabitedEnvExtensionInterface
- Lean.Elab.Term.instInhabitedState
- Lean.Elab.Term.StructInst.instInhabitedFieldLHS
- Lean.SMap.instInhabitedSMap
- Lean.instInhabitedInductiveType
- Lean.Core.instInhabitedState
- Lean.IR.instInhabitedJoinPointId
- Lean.PrettyPrinter.Delaborator.TopDownAnalyze.instInhabitedContext
- Lean.Parser.ParserExtension.instInhabitedOLeanEntry
- Lean.instInhabitedClosedTermCache
- Lean.Meta.SynthInstance.instInhabitedGeneratorNode
- Lean.instInhabitedMetavarDecl
- Lean.Server.instInhabitedWithRpcRef
- Char.instInhabitedChar
- Fin.instInhabitedFinHAddNatInstHAddInstAddNatOfNat
- Lean.instInhabitedLevel
- Lean.EnvExtensionInterfaceUnsafe.instInhabitedExt
- Lean.Elab.instInhabitedDefKind
- Lean.Parsec.instInhabitedParsec
- Lean.IR.instInhabitedFnBody
- Lean.Meta.SynthInstance.instInhabitedAnswer
- Int.instInhabitedInt
- Lean.instFVarIdSetInhabited
- Lean.Compiler.instInhabitedInlineAttributeKind
- Lean.Meta.instInhabitedCaseValueSubgoal
- instInhabitedForAll
- instInhabitedForAll_2
- Std.ShareCommon.State.inhabited
- Std.ShareCommon.PersistentState.inhabited
- intro: ∀ {α : Sort u}, α → Nonempty α
Equations
Equations
Equations
- Classical.ofNonempty = Classical.choice (_ : Nonempty α)
noncomputable instance
instNonemptyForAll
(α : Sort u)
{β : Sort v}
[inst : Nonempty β]
:
Nonempty (α → β)
Equations
noncomputable instance
instNonemptyForAll_1
(α : Sort u)
{β : α → Sort v}
[inst : ∀ (a : α), Nonempty (β a)]
:
Nonempty ((a : α) → β a)
Equations
- instInhabitedSort = { default := PUnit }
Equations
- instInhabitedForAll α = { default := fun x => default }
instance
instInhabitedForAll_1
(α : Sort u)
{β : α → Sort v}
[inst : (a : α) → Inhabited (β a)]
:
Inhabited ((a : α) → β a)
Equations
- instInhabitedForAll_1 α = { default := fun x => default }
Equations
- instInhabitedBool = { default := false }
@[inline]
Equations
- NonemptyType.type type = type.val
Equations
- instInhabitedNonemptyType = { default := { val := PUnit, property := (_ : Nonempty PUnit) } }
Instances
- instDecidableDitePropNot
- instDecidableIff
- instDecidableIteProp
- instDecidableRelLtLtOfOrd
- Lean.Rat.instDecidableLtRatInstLTRat
- instDecidableLtUInt32InstLTUInt32
- instDecidableLtUInt8InstLTUInt8
- Lean.Meta.DiscrTree.instDecidableLtKeyInstLTKey
- Lean.JsonNumber.instDecidableLtJsonNumberInstLTJsonNumber
- instDecidableLtUInt64InstLTUInt64
- instDecidableLtUInt16InstLTUInt16
- List.hasDecidableLt
- floatDecLt
- Nat.decLt
- Lean.JsonRpc.instDecidableLtRequestIDInstLTRequestID
- prodHasDecidableLt
- Lean.Name.instDecidableRelNameLtHasLtQuick
- Lean.instDecidableLtLiteralInstLTLiteral
- String.decLt
- instDecidableLtUSizeInstLTUSize
- Char.instDecidableLtCharInstLTChar
- Fin.decLt
- Int.decLt
- instDecidableEqProp
- instDecidableEqQuotient
- instDecidableEqUInt32
- Lean.instDecidableEqPosition
- instDecidableEqUInt8
- Lean.instDecidableEqJsonNumber
- Lean.Lsp.instDecidableEqCompletionItemKind
- Subtype.instDecidableEqSubtype
- instDecidableEqPUnit
- instDecidableEqOption
- instDecidableEqUInt64
- instDecidableEqUInt16
- String.instDecidableEqIterator
- instDecidableEqList
- instDecidableEqSum
- instDecidableEqNat
- instDecidableEqProd
- Lean.instDecidableEqDeclarationRange
- System.instDecidableEqFilePath
- instDecidableEqBool
- instDecidableEqString
- instDecidableEqUSize
- instDecidableEqChar
- instDecidableEqFin
- Int.instDecidableEqInt
- instDecidableTrue
- instDecidableNot
- instDecidableFalse
- instDecidableRelLeLeOfOrd
- Lean.Rat.instDecidableLeRatInstLERat
- instDecidableLeUInt32InstLEUInt32
- instDecidableLeUInt8InstLEUInt8
- instDecidableLeUInt64InstLEUInt64
- instDecidableLeUInt16InstLEUInt16
- List.instForAllListDecidableLeInstLEList
- floatDecLe
- Nat.decLe
- instDecidableLeUSizeInstLEUSize
- Char.instDecidableLeCharInstLEChar
- Fin.decLe
- Int.decLe
- Option.instDecidableRelOptionLt
- instDecidableAnd
- instDecidableOr
- instDecidableForAll
@[inlineIfReduce, nospecialize]
Equations
- decide p = Decidable.casesOn h (fun x => false) fun x => true
@[inline]
Equations
- DecidablePred r = ((a : α) → Decidable (r a))
@[inline]
Equations
- DecidableRel r = ((a b : α) → Decidable (r a b))
@[inline]
Equations
- DecidableEq α = ((a b : α) → Decidable (a = b))
@[inline]
- beq : α → α → Bool
Instances
- instBEq
- Lean.Lsp.instBEqRpcRef
- Lean.instBEqRat
- Lean.instBEqDataValue
- Lean.ExprStructEq.instBEqExprStructEq
- Lean.Lsp.instBEqCancelParams
- Lean.Meta.Simp.instBEqConfig
- Lean.instBEqFVarId
- Lean.JsonRpc.instBEqResponseError
- Lean.Json.instBEqJson
- Substring.hasBeq
- Lean.Parser.instBEqLeadingIdentBehavior
- IO.FS.instBEqFileType
- Lean.instBEqInternalExceptionId
- Lean.Meta.DiscrTree.instBEqKey
- Lean.Parser.instBEqError
- Lean.instBEqDefinitionSafety
- Lean.Lsp.instBEqDiagnosticSeverity
- Lean.IR.instBEqLitVal
- Lean.JsonRpc.instBEqRequest
- Lean.IR.UnreachableBranches.Value.instBEqValue
- Lean.instBEqLocalInstance
- Lean.IR.instBEqVarId
- IO.FS.instBEqSystemTime
- Lean.Meta.instBEqInfoCacheKey
- Lean.KVMap.instBEqKVMap
- Lean.instBEqData
- instBEqOption
- Lean.instBEqAttributeApplicationTime
- Lean.Meta.instBEqInstanceEntry
- Lean.instBEqBinderInfo
- Lean.Lsp.instBEqPosition
- Lean.Syntax.instBEqSyntax
- Lean.Server.FileWorker.instBEqGoToKind
- Lean.Lsp.instBEqLeanFileProgressKind
- Lean.instBEqData_1
- Lean.Expr.instBEqExpr
- Lean.Compiler.instBEqSpecializeAttributeKind
- Lean.Elab.Command.instBEqStructFieldKind
- Std.Format.instBEqFlattenBehavior
- Lean.Lsp.instBEqDiagnosticCode
- Lean.IR.IRType.instBEqIRType
- Lean.Lsp.instBEqDiagnosticRelatedInformation
- Lean.Lsp.instBEqDiagnosticTag
- Lean.Server.instBEqReference
- List.instBEqList
- Lean.Widget.instBEqTaggedText
- Lean.instBEqLOption
- Lean.Lsp.instBEqDiagnosticWith
- Lean.instBEqOccurrences
- Lean.Lsp.instBEqPublishDiagnosticsParams
- Lean.JsonRpc.instBEqNotification
- instBEqFloat
- Lean.Meta.instBEqTransparencyMode
- Lean.instBEqLBool
- Lean.JsonRpc.instBEqRequestID
- Lean.Lsp.instBEqRange
- Lean.IR.instBEqArg
- Lean.Meta.instBEqSimpLemma
- Lean.Lsp.instBEqRefIdent
- Lean.JsonRpc.instBEqErrorCode
- Array.instBEqArray
- Lean.instBEqMVarId
- Lean.IR.instBEqCtorInfo
- Lean.Meta.instBEqAbstractMVarsResult
- instBEqProd
- Lean.IR.Borrow.OwnedSet.instBEqKey
- Lean.Lsp.instBEqLocation
- Lean.IR.Borrow.ParamMap.instBEqKey
- Lean.instBEqAttributeKind
- Lean.instBEqHeadIndex
- instBEqOrdering
- Lean.JsonRpc.instBEqResponse
- Lean.instBEqMessageSeverity
- Lean.Name.instBEqName
- Lean.instBEqLiteral
- Lean.IR.instBEqJoinPointId
- Lean.Level.instBEqLevel
- Lean.Elab.instBEqDefKind
- Lean.IR.instBEqFnBody
- Lean.Compiler.instBEqInlineAttributeKind
@[macroInline]
Equations
- (if c then t else e) = Decidable.casesOn h (fun x => e) fun x => t
@[macroInline]
@[macroInline]
Equations
- instInhabitedNat = { default := Nat.zero }
- ofNat : α
Instances
- Lean.Rat.instOfNatRat
- instOfNatUInt32
- instOfNatUInt8
- Lean.Json.instOfNatJson
- Lean.JsonNumber.instOfNatJsonNumber
- Id.instOfNatId
- instOfNatUInt64
- instOfNatUInt16
- instOfNatFloat
- instOfNatNat
- Lean.JsonRpc.instOfNatRequestID
- instOfNatUSize
- Fin.instOfNatFinHAddNatInstHAddInstAddNatOfNat
- instOfNatInt
- Int.instOfNatInt
@[defaultInstance 100]
Equations
- instOfNatNat n = { ofNat := n }
- le : α → α → Prop
- lt : α → α → Prop
Instances
- Lean.Rat.instLTRat
- instLTUInt32
- instLTUInt8
- Lean.Meta.DiscrTree.instLTKey
- Lean.JsonNumber.instLTJsonNumber
- IO.FS.instLTSystemTime
- instLTOption
- Lean.Lsp.instLTPosition
- instLTUInt64
- instLTUInt16
- List.instLTList
- instLTFloat
- instLTNat
- Lean.JsonRpc.instLTRequestID
- Lean.Lsp.instLTRange
- instLTProd
- Lean.instLTLiteral
- String.instLTString
- instLTUSize
- Char.instLTChar
- instLTFin
- Int.instLTInt
Equations
- instTransEq r = { trans := @instTransEq.proof_1 α γ r }
Equations
- instTransEq_1 r = { trans := @instTransEq_1.proof_1 α β r }
- hDiv : α → β → γ
- hMod : α → β → γ
- hPow : α → β → γ
Instances
- hAppend : α → β → γ
Instances
- hOrElse : α → (Unit → β) → γ
Instances
- hAndThen : α → (Unit → β) → γ
Instances
- hShiftLeft : α → β → γ
Instances
- hShiftRight : α → β → γ
Instances
- add : α → α → α
- sub : α → α → α
- mul : α → α → α
- neg : α → α
Instances
- div : α → α → α
- mod : α → α → α
- pow : α → β → α
Instances
- append : α → α → α
Instances
- IO.AsyncList.instAppendAsyncList
- ByteArray.instAppendByteArray
- Std.Format.instAppendFormat
- Lean.MessageData.instAppendMessageData
- Std.PersistentArray.instAppendPersistentArray
- List.instAppendList
- instAppendSubarray
- Lean.MessageLog.instAppendMessageLog
- Array.instAppendArray
- Lean.Name.instAppendName
- String.instAppendString
- orElse : α → (Unit → α) → α
Instances
- MonadExcept.instOrElse
- instOrElse
- instOrElseEIO
- Lean.Parser.instOrElseParser
- Option.instOrElseOption
- Lean.PrettyPrinter.Delaborator.instOrElseDelabM
- Lean.PrettyPrinter.instOrElseParenthesizerM
- Lean.PrettyPrinter.instOrElseFormatterM
- Lean.Elab.Tactic.instOrElseTacticM
- Lean.Meta.instOrElseMetaM
- EStateM.instOrElseEStateM
- andThen : α → (Unit → α) → α
- and : α → α → α
- xor : α → α → α
- or : α → α → α
- complement : α → α
- shiftLeft : α → α → α
- shiftRight : α → α → α
@[defaultInstance 1000]
Equations
- instHAppend = { hAppend := fun a b => Append.append a b }
@[defaultInstance 1000]
Equations
- instHOrElse = { hOrElse := fun a b => OrElse.orElse a b }
@[defaultInstance 1000]
Equations
- instHAndThen = { hAndThen := fun a b => AndThen.andThen a b }
@[defaultInstance 1000]
Equations
- instHShiftLeft = { hShiftLeft := fun a b => ShiftLeft.shiftLeft a b }
@[defaultInstance 1000]
Equations
- instHShiftRight = { hShiftRight := fun a b => ShiftRight.shiftRight a b }
@[inline]
Equations
Equations
@[extern lean_uint8_of_nat]
Equations
- UInt8.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUInt8 = { default := UInt8.ofNatCore 0 instInhabitedUInt8.proof_1 }
@[extern lean_uint16_of_nat]
Equations
- UInt16.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUInt16 = { default := UInt16.ofNatCore 0 instInhabitedUInt16.proof_1 }
@[extern lean_uint32_of_nat]
Equations
- UInt32.ofNatCore n h = { val := { val := n, isLt := h } }
@[extern lean_uint32_to_nat]
Equations
- UInt32.toNat n = n.val.val
Equations
Equations
- instInhabitedUInt32 = { default := UInt32.ofNatCore 0 instInhabitedUInt32.proof_1 }
Equations
- instLTUInt32 = { lt := fun a b => a.val < b.val }
Equations
- instLEUInt32 = { le := fun a b => a.val ≤ b.val }
@[extern lean_uint32_dec_lt]
Equations
- UInt32.decLt a b = match a, b with | { val := n }, { val := m } => inferInstanceAs (Decidable (n < m))
@[extern lean_uint32_dec_le]
Equations
- UInt32.decLe a b = match a, b with | { val := n }, { val := m } => inferInstanceAs (Decidable (n ≤ m))
Equations
Equations
@[extern lean_uint64_of_nat]
Equations
- UInt64.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUInt64 = { default := UInt64.ofNatCore 0 instInhabitedUInt64.proof_1 }
@[extern lean_usize_of_nat]
Equations
- USize.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUSize = { default := USize.ofNatCore 0 instInhabitedUSize.proof_1 }
@[extern lean_usize_of_nat]
Equations
- USize.ofNat32 n h = { val := { val := n, isLt := (_ : n < USize.size) } }
@[inline]
@[inline]
Equations
@[extern lean_uint32_of_nat]
Equations
- Char.ofNatAux n h = { val := { val := { val := n, isLt := (_ : n < UInt32.size) } }, valid := h }
@[matchPattern, noinline]
Equations
- Char.ofNat n = if h : Nat.isValidChar n then Char.ofNatAux n h else { val := { val := { val := 0, isLt := Char.ofNat.proof_1 } }, valid := Char.ofNat.proof_2 }
Equations
- Char.utf8Size c = let v := c.val; if v ≤ UInt32.ofNatCore 127 Char.utf8Size.proof_1 then UInt32.ofNatCore 1 Char.utf8Size.proof_2 else if v ≤ UInt32.ofNatCore 2047 Char.utf8Size.proof_3 then UInt32.ofNatCore 2 Char.utf8Size.proof_4 else if v ≤ UInt32.ofNatCore 65535 Char.utf8Size.proof_5 then UInt32.ofNatCore 3 Char.utf8Size.proof_6 else UInt32.ofNatCore 4 Char.utf8Size.proof_7
Equations
- instInhabitedOption = { default := none }
@[macroInline]
Equations
- Option.getD x x = match x, x with | some x, x_1 => x | none, e => e
Equations
- instInhabitedList = { default := [] }
Equations
- List.hasDecEq [] [] = isTrue (_ : [] = [])
- List.hasDecEq (a :: as) [] = isFalse (_ : a :: as = [] → List.noConfusionType False (a :: as) [])
- List.hasDecEq [] (b :: bs) = isFalse (_ : [] = b :: bs → List.noConfusionType False [] (b :: bs))
- List.hasDecEq (a :: as) (b :: bs) = match decEq a b with | isTrue hab => match List.hasDecEq as bs with | isTrue habs => isTrue (_ : a :: as = b :: bs) | isFalse nabs => isFalse (_ : a :: as = b :: bs → False) | isFalse nab => isFalse (_ : a :: as = b :: bs → False)
Equations
- instDecidableEqList = List.hasDecEq
@[specialize]
Equations
- List.foldl f x [] = x
- List.foldl f x (b :: l) = List.foldl f (f x b) l
Equations
- List.length [] = 0
- List.length (a :: as) = List.length as + 1
Equations
- List.lengthTRAux [] x = x
- List.lengthTRAux (a :: as) x = List.lengthTRAux as (Nat.succ x)
Equations
- List.lengthTR as = List.lengthTRAux as 0
@[simp]
theorem
List.length_cons
{α : Type u_1}
(a : α)
(as : List α)
:
List.length (a :: as) = Nat.succ (List.length as)
Equations
- List.concat [] x = [x]
- List.concat (a :: as) x = a :: List.concat as x
@[extern lean_string_dec_eq]
Equations
Equations
- instInhabitedSubstring = { default := { str := "", startPos := 0, stopPos := 0 } }
@[inline]
Equations
- Substring.bsize x = match x with | { str := x, startPos := b, stopPos := e } => Nat.sub e b
@[extern lean_string_utf8_byte_size]
Equations
- String.utf8ByteSize x = match x with | { data := s } => String.utf8ByteSizeAux s 0
@[inline]
Equations
@[inline]
Equations
- String.toSubstring s = { str := s, startPos := 0, stopPos := String.bsize s }
@[extern lean_mk_empty_array_with_capacity]
Equations
- Array.mkEmpty c = { data := [] }
@[extern lean_array_get_size]
Equations
- Array.size a = List.length a.data
@[extern lean_array_fget]
Equations
- Array.get a i = List.get a.data i.val (_ : i.val < Array.size a)
@[inline]
Equations
- Array.getD a i v₀ = if h : i < Array.size a then Array.get a { val := i, isLt := h } else v₀
@[extern lean_array_get]
Equations
- Array.get! a i = Array.getD a i default
Equations
- Array.getOp self idx = Array.get! self idx
@[extern lean_array_push]
Equations
- Array.push a v = { data := List.concat a.data v }
@[inline]
Equations
- Array.setD a i v = if h : i < Array.size a then Array.set a { val := i, isLt := h } v else a
@[extern lean_array_set]
Equations
- Array.set! a i v = Array.setD a i v
Equations
- Array.appendCore as bs = (fun loop => loop (Array.size bs) 0 as) (Array.appendCore.loop bs)
Equations
- Array.appendCore.loop bs 0 j as = if hlt : j < Array.size bs then as else as
- Array.appendCore.loop bs (Nat.succ i') j as = if hlt : j < Array.size bs then Array.appendCore.loop bs i' (j + 1) (Array.push as (Array.get bs { val := j, isLt := hlt })) else as
@[inlineIfReduce]
Equations
- List.toArrayAux [] x = x
- List.toArrayAux (a :: as) x = List.toArrayAux as (Array.push x a)
@[inlineIfReduce]
Equations
- List.redLength [] = 0
- List.redLength (a :: as) = Nat.succ (List.redLength as)
@[matchPattern, inline]
Equations
- List.toArray as = List.toArrayAux as (Array.mkEmpty (List.redLength as))
- bind : {α β : Type u} → m α → (α → m β) → m β
Instances
- pure : {α : Type u} → α → f α
Instances
- map : {α β : Type u} → (α → β) → f α → f β
- mapConst : {α β : Type u} → α → f β → f α
- seq : {α β : Type u} → f (α → β) → (Unit → f α) → f β
Instances
- seqLeft : {α β : Type u} → f α → (Unit → f β) → f α
Instances
- seqRight : {α β : Type u} → f α → (Unit → f β) → f β
Instances
Instances
- ExceptCpsT.instMonadExceptCpsT
- instMonadEIO
- ExceptT.instMonadExceptT
- Id.instMonadId
- instMonadBaseIO
- StateRefT'.instMonadStateRefT'
- Lean.MonadStateCacheT.instMonadMonadStateCacheT
- StateT.instMonadStateT
- StateCpsT.instMonadStateCpsT
- ReaderT.instMonadReaderT
- Lean.Core.instMonadCoreM
- Lean.Elab.Term.instMonadTermElabM
- Lean.Elab.Command.instMonadCommandElabM
- Lean.Elab.Tactic.instMonadTacticM
- Lean.Meta.instMonadMetaM
- EStateM.instMonadEStateM
- instMonadEST
- instMonadST
- Except.instMonadExcept
- OptionT.instMonadOptionT
- Lean.MonadCacheT.instMonadMonadCacheT
- Lean.Parsec.instMonadParsec
instance
instInhabitedForAll_2
{α : Type u}
{m : Type u → Type v}
[inst : Monad m]
:
Inhabited (α → m α)
Equations
- instInhabitedForAll_2 = { default := pure }
def
Array.sequenceMap
{α : Type u}
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : Array α)
(f : α → m β)
:
m (Array β)
Equations
- Array.sequenceMap as f = (fun loop => loop (Array.size as) 0 Array.empty) (Array.sequenceMap.loop as f)
def
Array.sequenceMap.loop
{α : Type u}
{β : Type v}
{m : Type v → Type w}
[inst : Monad m]
(as : Array α)
(f : α → m β)
(i : Nat)
(j : Nat)
(bs : Array β)
:
m (Array β)
Equations
- Array.sequenceMap.loop as f 0 j bs = if hlt : j < Array.size as then pure bs else pure bs
- Array.sequenceMap.loop as f (Nat.succ i') j bs = if hlt : j < Array.size as then do let b ← f (Array.get as { val := j, isLt := hlt }) Array.sequenceMap.loop as f i' (j + 1) (Array.push bs b) else pure bs
- monadLift : {α : Type u} → m α → n α
Instances
- ExceptCpsT.instMonadLiftExceptCpsT
- ExceptT.instMonadLiftExceptT
- StateRefT'.instMonadLiftStateRefT'
- Lean.MonadStateCacheT.instMonadLiftMonadStateCacheT
- StateT.instMonadLiftStateT
- StateCpsT.instMonadLiftStateCpsT
- ReaderT.instMonadLiftReaderT
- OptionT.instMonadLiftOptionT
- Lean.MonadCacheT.instMonadLiftMonadCacheT
- Lean.Server.FileWorker.instMonadLiftIOEIOElabTaskError
- Lean.Server.instMonadLiftIORequestM
- Lean.Core.instMonadLiftIOCoreM
- instMonadLiftBaseIOEIO
- Lean.instMonadLiftImportMAttrM
- Lean.IR.NormalizeIds.instMonadLiftMN
- instMonadLiftSTEST
- IO.instMonadLiftSTRealWorldBaseIO
- ExceptT.instMonadLiftExceptExceptT
- monadLift : {α : Type u} → m α → n α
instance
instMonadLiftT
(m : Type u_1 → Type u_2)
(n : Type u_1 → Type u_3)
(o : Type u_1 → Type u_4)
[inst : MonadLift n o]
[inst : MonadLiftT m n]
:
MonadLiftT m o
Equations
- instMonadLiftT m n o = { monadLift := fun {α} x => MonadLift.monadLift (monadLift x) }
Equations
- instMonadLiftT_1 m = { monadLift := fun {α} x => x }
- monadMap : {α : Type u} → ({β : Type u} → m β → m β) → n α → n α
- monadMap : {α : Type u} → ({β : Type u} → m β → m β) → n α → n α
Instances
instance
instMonadFunctorT
(m : Type u_1 → Type u_2)
(n : Type u_1 → Type u_3)
(o : Type u_1 → Type u_4)
[inst : MonadFunctor n o]
[inst : MonadFunctorT m n]
:
MonadFunctorT m o
Equations
- instMonadFunctorT m n o = { monadMap := fun {α} f => MonadFunctor.monadMap fun {β} => monadMap fun {β} => f β }
Equations
- monadFunctorRefl m = { monadMap := fun {α} f => f α }
Equations
- instInhabitedExcept = { default := Except.error default }
- throw : {α : Type v} → ε → m α
- tryCatch : {α : Type v} → m α → (ε → m α) → m α
Instances
- ExceptCpsT.instMonadExceptOfExceptCpsT
- instMonadExceptOfEIO
- instMonadExceptOfExceptT
- instMonadExceptOfExceptT_1
- StateRefT'.instMonadExceptOfStateRefT'
- Lean.MonadStateCacheT.instMonadExceptOfMonadStateCacheT
- StateT.instMonadExceptOfStateT
- ReaderT.instMonadExceptOfReaderT
- EStateM.instMonadExceptOfEStateM
- instMonadExceptOfEST
- instMonadExceptOfExcept
- OptionT.instMonadExceptOfOptionT
- Lean.MonadCacheT.instMonadExceptOfMonadCacheT
- OptionT.instMonadExceptOfUnitOptionT
- Lean.MonadError.toMonadExceptOf
@[inline]
abbrev
throwThe
(ε : Type u)
{m : Type v → Type w}
[inst : MonadExceptOf ε m]
{α : Type v}
(e : ε)
:
m α
Equations
- throwThe ε e = MonadExceptOf.throw e
@[inline]
abbrev
tryCatchThe
(ε : Type u)
{m : Type v → Type w}
[inst : MonadExceptOf ε m]
{α : Type v}
(x : m α)
(handle : ε → m α)
:
m α
Equations
- tryCatchThe ε x handle = MonadExceptOf.tryCatch x handle
- throw : {α : Type v} → ε → m α
- tryCatch : {α : Type v} → m α → (ε → m α) → m α
instance
instMonadExcept
(ε : outParam (Type u))
(m : Type v → Type w)
[inst : MonadExceptOf ε m]
:
MonadExcept ε m
Equations
- instMonadExcept ε m = { throw := fun {α} => throwThe ε, tryCatch := fun {α} => tryCatchThe ε }
@[inline]
def
MonadExcept.orElse
{ε : Type u}
{m : Type v → Type w}
[inst : MonadExcept ε m]
{α : Type v}
(t₁ : m α)
(t₂ : Unit → m α)
:
m α
Equations
- MonadExcept.orElse t₁ t₂ = tryCatch t₁ fun x => t₂ ()
instance
MonadExcept.instOrElse
{ε : Type u}
{m : Type v → Type w}
[inst : MonadExcept ε m]
{α : Type v}
:
OrElse (m α)
Equations
- MonadExcept.instOrElse = { orElse := MonadExcept.orElse }
instance
instInhabitedReaderT
(ρ : Type u)
(m : Type u → Type v)
(α : Type u)
[inst : Inhabited (m α)]
:
Equations
- instInhabitedReaderT ρ m α = { default := fun x => default }
@[inline]
Equations
- ReaderT.run x r = x r
Equations
- ReaderT.instMonadLiftReaderT = { monadLift := fun {α} x x_1 => x }
instance
ReaderT.instMonadExceptOfReaderT
{ρ : Type u}
{m : Type u → Type v}
(ε : Type u_1)
[inst : MonadExceptOf ε m]
:
MonadExceptOf ε (ReaderT ρ m)
Equations
- ReaderT.instMonadExceptOfReaderT ε = { throw := fun {α} e => liftM (throw e), tryCatch := fun {α} x c r => tryCatchThe ε (x r) fun e => c e r }
@[inline]
Equations
- ReaderT.read = pure
@[inline]
def
ReaderT.pure
{ρ : Type u}
{m : Type u → Type v}
[inst : Monad m]
{α : Type u}
(a : α)
:
ReaderT ρ m α
Equations
- ReaderT.pure a r = pure a
@[inline]
def
ReaderT.bind
{ρ : Type u}
{m : Type u → Type v}
[inst : Monad m]
{α : Type u}
{β : Type u}
(x : ReaderT ρ m α)
(f : α → ReaderT ρ m β)
:
ReaderT ρ m β
Equations
- ReaderT.bind x f r = do let a ← x r f a r
@[inline]
def
ReaderT.map
{ρ : Type u}
{m : Type u → Type v}
[inst : Monad m]
{α : Type u}
{β : Type u}
(f : α → β)
(x : ReaderT ρ m α)
:
ReaderT ρ m β
Equations
- ReaderT.map f x r = f <$> x r
instance
ReaderT.instMonadFunctorReaderT
(ρ : Type u_1)
(m : Type u_1 → Type u_2)
[inst : Monad m]
:
MonadFunctor m (ReaderT ρ m)
Equations
- ReaderT.instMonadFunctorReaderT ρ m = { monadMap := fun {α} f x ctx => f α (x ctx) }
@[inline]
def
ReaderT.adapt
{ρ : Type u}
{m : Type u → Type v}
{ρ' : Type u}
[inst : Monad m]
{α : Type u}
(f : ρ' → ρ)
:
Equations
- ReaderT.adapt f x r = x (f r)
- read : m ρ
@[inline]
- read : m ρ
Instances
instance
instMonadReader
(ρ : Type u)
(m : Type u → Type v)
[inst : MonadReaderOf ρ m]
:
MonadReader ρ m
Equations
- instMonadReader ρ m = { read := readThe ρ }
instance
instMonadReaderOf
{ρ : Type u}
{m : Type u → Type v}
{n : Type u → Type w}
[inst : MonadLift m n]
[inst : MonadReaderOf ρ m]
:
MonadReaderOf ρ n
instance
instMonadReaderOfReaderT
{ρ : Type u}
{m : Type u → Type v}
[inst : Monad m]
:
MonadReaderOf ρ (ReaderT ρ m)
Equations
- instMonadReaderOfReaderT = { read := ReaderT.read }
- withReader : {α : Type u} → (ρ → ρ) → m α → m α
@[inline]
def
withTheReader
(ρ : Type u)
{m : Type u → Type v}
[inst : MonadWithReaderOf ρ m]
{α : Type u}
(f : ρ → ρ)
(x : m α)
:
m α
Equations
- withTheReader ρ f x = MonadWithReaderOf.withReader f x
- withReader : {α : Type u} → (ρ → ρ) → m α → m α
Instances
instance
instMonadWithReader
(ρ : Type u)
(m : Type u → Type v)
[inst : MonadWithReaderOf ρ m]
:
MonadWithReader ρ m
Equations
- instMonadWithReader ρ m = { withReader := fun {α} => withTheReader ρ }
instance
instMonadWithReaderOf
{ρ : Type u}
{m : Type u → Type v}
{n : Type u → Type v}
[inst : MonadFunctor m n]
[inst : MonadWithReaderOf ρ m]
:
Equations
- instMonadWithReaderOf = { withReader := fun {α} f => monadMap fun {β} => withTheReader ρ f }
instance
instMonadWithReaderOfReaderT
{ρ : Type u}
{m : Type u → Type v}
[inst : Monad m]
:
MonadWithReaderOf ρ (ReaderT ρ m)
Equations
- instMonadWithReaderOfReaderT = { withReader := fun {α} f x ctx => x (f ctx) }
@[inline]
@[inline]
Equations
- modifyThe σ f = MonadStateOf.modifyGet fun s => (PUnit.unit, f s)
@[inline]
abbrev
modifyGetThe
{α : Type u}
(σ : Type u)
{m : Type u → Type v}
[inst : MonadStateOf σ m]
(f : σ → α × σ)
:
m α
Equations
Instances
instance
instMonadState
(σ : Type u)
(m : Type u → Type v)
[inst : MonadStateOf σ m]
:
MonadState σ m
Equations
- instMonadState σ m = { get := getThe σ, set := set, modifyGet := fun {α} f => MonadStateOf.modifyGet f }
@[inline]
Equations
- modify f = modifyGet fun s => (PUnit.unit, f s)
instance
instMonadStateOf
{σ : Type u}
{m : Type u → Type v}
{n : Type u → Type w}
[inst : MonadLift m n]
[inst : MonadStateOf σ m]
:
MonadStateOf σ n
- ok: {ε σ α : Type u} → α → σ → EStateM.Result ε σ α
- error: {ε σ α : Type u} → ε → σ → EStateM.Result ε σ α
instance
EStateM.instInhabitedResult
{ε : Type u}
{σ : Type u}
{α : Type u}
[inst : Inhabited ε]
[inst : Inhabited σ]
:
Inhabited (EStateM.Result ε σ α)
Equations
- EStateM.instInhabitedResult = { default := EStateM.Result.error default default }
Equations
- EStateM ε σ α = (σ → EStateM.Result ε σ α)
Equations
- EStateM.instInhabitedEStateM = { default := fun s => EStateM.Result.error default s }
@[inline]
Equations
- EStateM.pure a s = EStateM.Result.ok a s
@[inline]
Equations
@[inline]
Equations
- EStateM.get s = EStateM.Result.ok s s
@[inline]
Equations
- EStateM.modifyGet f s = match f s with | (a, s) => EStateM.Result.ok a s
@[inline]
Equations
- EStateM.throw e s = EStateM.Result.error e s
- save : σ → δ
- restore : σ → δ → σ
Instances
@[inline]
def
EStateM.tryCatch
{ε : Type u}
{σ : Type u}
{δ : outParam (Type u)}
[inst : EStateM.Backtrackable δ σ]
{α : Type u}
(x : EStateM ε σ α)
(handle : ε → EStateM ε σ α)
:
EStateM ε σ α
Equations
- EStateM.tryCatch x handle s = let d := EStateM.Backtrackable.save s; match x s with | EStateM.Result.error e s => handle e (EStateM.Backtrackable.restore s d) | ok => ok
@[inline]
def
EStateM.orElse
{ε : Type u}
{σ : Type u}
{α : Type u}
{δ : outParam (Type u)}
[inst : EStateM.Backtrackable δ σ]
(x₁ : EStateM ε σ α)
(x₂ : Unit → EStateM ε σ α)
:
EStateM ε σ α
Equations
- EStateM.orElse x₁ x₂ s = let d := EStateM.Backtrackable.save s; match x₁ s with | EStateM.Result.error x s => x₂ () (EStateM.Backtrackable.restore s d) | ok => ok
@[inline]
def
EStateM.adaptExcept
{ε : Type u}
{σ : Type u}
{α : Type u}
{ε' : Type u}
(f : ε → ε')
(x : EStateM ε σ α)
:
EStateM ε' σ α
Equations
- EStateM.adaptExcept f x s = match x s with | EStateM.Result.error e s => EStateM.Result.error (f e) s | EStateM.Result.ok a s => EStateM.Result.ok a s
@[inline]
def
EStateM.bind
{ε : Type u}
{σ : Type u}
{α : Type u}
{β : Type u}
(x : EStateM ε σ α)
(f : α → EStateM ε σ β)
:
EStateM ε σ β
Equations
- EStateM.bind x f s = match x s with | EStateM.Result.ok a s => f a s | EStateM.Result.error e s => EStateM.Result.error e s
@[inline]
def
EStateM.map
{ε : Type u}
{σ : Type u}
{α : Type u}
{β : Type u}
(f : α → β)
(x : EStateM ε σ α)
:
EStateM ε σ β
Equations
- EStateM.map f x s = match x s with | EStateM.Result.ok a s => EStateM.Result.ok (f a) s | EStateM.Result.error e s => EStateM.Result.error e s
@[inline]
def
EStateM.seqRight
{ε : Type u}
{σ : Type u}
{α : Type u}
{β : Type u}
(x : EStateM ε σ α)
(y : Unit → EStateM ε σ β)
:
EStateM ε σ β
Equations
- EStateM.seqRight x y s = match x s with | EStateM.Result.ok x s => y () s | EStateM.Result.error e s => EStateM.Result.error e s
Equations
- EStateM.instMonadEStateM = Monad.mk
instance
EStateM.instOrElseEStateM
{ε : Type u}
{σ : Type u}
{α : Type u}
{δ : outParam (Type u)}
[inst : EStateM.Backtrackable δ σ]
:
Equations
- EStateM.instOrElseEStateM = { orElse := EStateM.orElse }
Equations
- EStateM.instMonadStateOfEStateM = { get := EStateM.get, set := EStateM.set, modifyGet := fun {α} => EStateM.modifyGet }
instance
EStateM.instMonadExceptOfEStateM
{ε : Type u}
{σ : Type u}
{δ : outParam (Type u)}
[inst : EStateM.Backtrackable δ σ]
:
MonadExceptOf ε (EStateM ε σ)
Equations
- EStateM.instMonadExceptOfEStateM = { throw := fun {α} => EStateM.throw, tryCatch := fun {α} => EStateM.tryCatch }
@[inline]
def
EStateM.run
{ε : Type u}
{σ : Type u}
{α : Type u}
(x : EStateM ε σ α)
(s : σ)
:
EStateM.Result ε σ α
Equations
- EStateM.run x s = x s
@[inline]
Equations
- EStateM.run' x s = match EStateM.run x s with | EStateM.Result.ok v x => some v | EStateM.Result.error x x_1 => none
@[inline]
Equations
@[inline]
Equations
- EStateM.dummyRestore s x = s
Equations
- EStateM.nonBacktrackable = { save := EStateM.dummySave, restore := EStateM.dummyRestore }
- hash : α → UInt64
Instances
- instHashable
- Lean.Lsp.instHashableRpcRef
- Lean.ExprStructEq.instHashableExprStructEq
- instHashableUInt32
- Lean.instHashableFVarId
- instHashableUInt8
- Lean.Meta.DiscrTree.instHashableKey
- Lean.IR.instHashableVarId
- Lean.Meta.InfoCacheKey.instHashableInfoCacheKey
- instHashableOption
- Lean.instHashableBinderInfo
- Lean.Lsp.instHashablePosition
- instHashableUInt64
- Lean.Expr.instHashableExpr
- instHashableUInt16
- instHashableList
- instHashableNat
- Lean.Meta.TransparencyMode.instHashableTransparencyMode
- Lean.Lsp.instHashableRange
- Lean.Lsp.instHashableRefIdent
- Lean.instHashableMVarId
- instHashableProd
- Lean.IR.Borrow.OwnedSet.instHashableKey
- System.instHashableFilePath
- Lean.IR.Borrow.ParamMap.instHashableKey
- instHashableBool
- Lean.HeadIndex.instHashableHeadIndex
- Lean.instHashableName
- Lean.instHashableLiteral
- instHashableString
- instHashableUSize
- Lean.IR.instHashableJoinPointId
- instHashableFin
- Lean.Level.instHashableLevel
- instHashableInt
Equations
- instHashableString = { hash := String.hash }
Equations
- Lean.instInhabitedName = { default := Lean.Name.anonymous }
Equations
- Lean.Name.hash x = match x with | Lean.Name.anonymous => UInt64.ofNatCore 1723 Lean.Name.hash.proof_1 | Lean.Name.str p s h => h | Lean.Name.num p v h => h
Equations
- Lean.instHashableName = { hash := Lean.Name.hash }
Equations
- Lean.Name.mkStr p s = Lean.Name.str p s (mixHash (hash p) (hash s))
Equations
- Lean.Name.mkNum p v = Lean.Name.num p v (mixHash (hash p) (if h : v < UInt64.size then UInt64.ofNatCore v h else UInt64.ofNatCore 17 Lean.Name.mkNum.proof_1))
Equations
@[extern lean_name_eq]
Equations
- Lean.Name.beq Lean.Name.anonymous Lean.Name.anonymous = true
- Lean.Name.beq (Lean.Name.str p₁ s₁ x_2) (Lean.Name.str p₂ s₂ x_3) = (s₁ == s₂ && Lean.Name.beq p₁ p₂)
- Lean.Name.beq (Lean.Name.num p₁ n₁ x_2) (Lean.Name.num p₂ n₂ x_3) = (n₁ == n₂ && Lean.Name.beq p₁ p₂)
- Lean.Name.beq x x = false
Equations
- Lean.Name.instBEqName = { beq := Lean.Name.beq }
Equations
- Lean.Name.append x Lean.Name.anonymous = x
- Lean.Name.append x (Lean.Name.str p s x_2) = Lean.Name.mkStr (Lean.Name.append x p) s
- Lean.Name.append x (Lean.Name.num p d x_2) = Lean.Name.mkNum (Lean.Name.append x p) d
Equations
- Lean.Name.instAppendName = { append := Lean.Name.append }
- original: Substring → String.Pos → Substring → String.Pos → Lean.SourceInfo
- synthetic: String.Pos → String.Pos → Lean.SourceInfo
- none: Lean.SourceInfo
Equations
- Lean.instInhabitedSourceInfo = { default := Lean.SourceInfo.none }
Equations
- Lean.SourceInfo.getPos? info originalOnly = match info, originalOnly with | Lean.SourceInfo.original x pos x_1 x_2, x_3 => some pos | Lean.SourceInfo.synthetic pos x, false => some pos | x, x_1 => none
- missing: Lean.Syntax
- node: Lean.SourceInfo → Lean.SyntaxNodeKind → Array Lean.Syntax → Lean.Syntax
- atom: Lean.SourceInfo → String → Lean.Syntax
- ident: Lean.SourceInfo → Substring → Lean.Name → List (Lean.Name × List String) → Lean.Syntax
Equations
- Lean.instInhabitedSyntax = { default := Lean.Syntax.missing }
Equations
- Lean.scientificLitKind = `scientificLit
Equations
- Lean.interpolatedStrLitKind = `interpolatedStrLitKind
Equations
- Lean.interpolatedStrKind = `interpolatedStrKind
Equations
- Lean.Syntax.getKind stx = match stx with | Lean.Syntax.node x k args => k | Lean.Syntax.missing => `missing | Lean.Syntax.atom x v => Lean.Name.mkSimple v | Lean.Syntax.ident x x_1 x_2 x_3 => Lean.identKind
Equations
- Lean.Syntax.setKind stx k = match stx with | Lean.Syntax.node info x args => Lean.Syntax.node info k args | x => stx
Equations
- Lean.Syntax.isOfKind stx k = (Lean.Syntax.getKind stx == k)
Equations
- Lean.Syntax.getArg stx i = match stx with | Lean.Syntax.node x x_1 args => Array.getD args i Lean.Syntax.missing | x => Lean.Syntax.missing
@[inline]
Equations
- Lean.Syntax.getOp self idx = Lean.Syntax.getArg self idx
Equations
- Lean.Syntax.getArgs stx = match stx with | Lean.Syntax.node x x_1 args => args | x => Array.empty
Equations
- Lean.Syntax.getNumArgs stx = match stx with | Lean.Syntax.node x x_1 args => Array.size args | x => 0
Equations
- Lean.Syntax.isMissing x = match x with | Lean.Syntax.missing => true | x => false
Equations
- Lean.Syntax.isNodeOf stx k n = (Lean.Syntax.isOfKind stx k && Lean.Syntax.getNumArgs stx == n)
Equations
- Lean.Syntax.isIdent x = match x with | Lean.Syntax.ident x x_1 x_2 x_3 => true | x => false
Equations
- Lean.Syntax.getId x = match x with | Lean.Syntax.ident x x_1 val x_2 => val | x => Lean.Name.anonymous
Equations
- Lean.Syntax.matchesNull stx n = Lean.Syntax.isNodeOf stx Lean.nullKind n
Equations
- Lean.Syntax.matchesIdent stx id = (Lean.Syntax.isIdent stx && Lean.Syntax.getId stx == id)
Equations
- Lean.Syntax.matchesLit stx k val = match stx with | Lean.Syntax.node x k' args => k == k' && match Array.getD args 0 Lean.Syntax.missing with | Lean.Syntax.atom x val' => val == val' | x => false | x => false
Equations
- Lean.Syntax.setArgs stx args = match stx with | Lean.Syntax.node info k x => Lean.Syntax.node info k args | stx => stx
Equations
- Lean.Syntax.setArg stx i arg = match stx with | Lean.Syntax.node info k args => Lean.Syntax.node info k (Array.setD args i arg) | stx => stx
Equations
- Lean.Syntax.getHeadInfo stx = match Lean.Syntax.getHeadInfo? stx with | some info => info | none => Lean.SourceInfo.none
Equations
- Lean.Syntax.getPos? stx originalOnly = Lean.SourceInfo.getPos? (Lean.Syntax.getHeadInfo stx) originalOnly
partial def
Lean.Syntax.getTailPos?.loop
(originalOnly : optParam Bool false)
(args : Array Lean.Syntax)
(i : Nat)
:
Equations
- Lean.SourceInfo.fromRef ref = let _discr := Lean.Syntax.getTailPos? ref; match Lean.Syntax.getPos? ref, Lean.Syntax.getTailPos? ref with | some pos, some tailPos => Lean.SourceInfo.synthetic pos tailPos | x, x_1 => Lean.SourceInfo.none
Equations
Equations
- Lean.mkAtomFrom src val = Lean.Syntax.atom (Lean.SourceInfo.fromRef src) val
- const: Lean.Name → Lean.ParserDescr
- unary: Lean.Name → Lean.ParserDescr → Lean.ParserDescr
- binary: Lean.Name → Lean.ParserDescr → Lean.ParserDescr → Lean.ParserDescr
- node: Lean.SyntaxNodeKind → Nat → Lean.ParserDescr → Lean.ParserDescr
- trailingNode: Lean.SyntaxNodeKind → Nat → Nat → Lean.ParserDescr → Lean.ParserDescr
- symbol: String → Lean.ParserDescr
- nonReservedSymbol: String → Bool → Lean.ParserDescr
- cat: Lean.Name → Nat → Lean.ParserDescr
- parser: Lean.Name → Lean.ParserDescr
- nodeWithAntiquot: String → Lean.SyntaxNodeKind → Lean.ParserDescr → Lean.ParserDescr
- sepBy: Lean.ParserDescr → String → Lean.ParserDescr → optParam Bool false → Lean.ParserDescr
- sepBy1: Lean.ParserDescr → String → Lean.ParserDescr → optParam Bool false → Lean.ParserDescr
Equations
- Lean.instInhabitedParserDescr = { default := Lean.ParserDescr.symbol "" }
@[inline]
Equations
Equations
- getRef : m Lean.Syntax
- withRef : {α : Type} → Lean.Syntax → m α → m α
Instances
- Lean.instMonadRef
- Lean.MonadQuotation.toMonadRef
- Lean.MonadError.toMonadRef
- Lean.MonadStateCacheT.instMonadRefMonadStateCacheT
- Lean.Core.instMonadRefCoreM
- Lean.Macro.instMonadRefMacroM
- Lean.Elab.Command.instMonadRefCommandElabM
- Lean.Elab.Level.instMonadRefLevelElabM
- Lean.MonadCacheT.instMonadRefMonadCacheT
instance
Lean.instMonadRef
(m : Type → Type)
(n : Type → Type)
[inst : MonadLift m n]
[inst : MonadFunctor m n]
[inst : Lean.MonadRef m]
:
Equations
- Lean.instMonadRef m n = { getRef := liftM Lean.getRef, withRef := fun {α} ref x => monadMap (fun {β} => Lean.MonadRef.withRef ref) x }
Equations
- Lean.replaceRef ref oldRef = match Lean.Syntax.getPos? ref with | some x => ref | x => oldRef
@[inline]
def
Lean.withRef
{m : Type → Type}
[inst : Monad m]
[inst : Lean.MonadRef m]
{α : Type}
(ref : Lean.Syntax)
(x : m α)
:
m α
Equations
- Lean.withRef ref x = do let oldRef ← Lean.getRef let ref : Lean.Syntax := Lean.replaceRef ref oldRef Lean.MonadRef.withRef ref x
- getCurrMacroScope : m Lean.MacroScope
- getMainModule : m Lean.Name
- withFreshMacroScope : {α : Type} → m α → m α
Instances
- Lean.instMonadQuotation
- Lean.Unhygienic.instMonadQuotationUnhygienic
- Lean.PrettyPrinter.instMonadQuotationUnexpandM
- Lean.Elab.Term.instMonadQuotationTermElabM
- Lean.Macro.instMonadQuotationMacroM
- Lean.PrettyPrinter.Delaborator.instMonadQuotationDelabM
- Lean.Elab.Command.instMonadQuotationCommandElabM
- Lean.PrettyPrinter.Parenthesizer.instMonadQuotationParenthesizerM
Equations
- Lean.MonadRef.mkInfoFromRefPos = do let a ← Lean.getRef pure (Lean.SourceInfo.fromRef a)
instance
Lean.instMonadQuotation
{m : Type → Type}
{n : Type → Type}
[inst : MonadFunctor m n]
[inst : MonadLift m n]
[inst : Lean.MonadQuotation m]
:
Equations
- Lean.instMonadQuotation = Lean.MonadQuotation.mk (liftM Lean.getCurrMacroScope) (liftM Lean.getMainModule) fun {α} => monadMap fun {β} => Lean.withFreshMacroScope
Equations
- Lean.Name.hasMacroScopes (Lean.Name.str x_1 s x_2) = (s == "_hyg")
- Lean.Name.hasMacroScopes (Lean.Name.num p x_1 x_2) = Lean.Name.hasMacroScopes p
- Lean.Name.hasMacroScopes x = false
Equations
- Lean.Name.eraseMacroScopes n = match Lean.Name.hasMacroScopes n with | true => Lean.eraseMacroScopesAux n | false => n
Equations
- Lean.Name.simpMacroScopes n = match Lean.Name.hasMacroScopes n with | true => Lean.simpMacroScopesAux n | false => n
- name : Lean.Name
- imported : Lean.Name
- mainModule : Lean.Name
- scopes : List Lean.MacroScope
Equations
- Lean.instInhabitedMacroScopesView = { default := { name := default, imported := default, mainModule := default, scopes := default } }
Equations
- Lean.MacroScopesView.review view = match view.scopes with | [] => view.name | x :: x_1 => let base := Lean.Name.mkStr (Lean.Name.mkStr view.name "_@" ++ view.imported ++ view.mainModule) "_hyg"; List.foldl Lean.Name.mkNum base view.scopes
Equations
- Lean.extractMacroScopes n = match Lean.Name.hasMacroScopes n with | true => Lean.extractMacroScopesAux n [] | false => { name := n, imported := Lean.Name.anonymous, mainModule := Lean.Name.anonymous, scopes := [] }
Equations
- Lean.addMacroScope mainModule n scp = match Lean.Name.hasMacroScopes n with | true => let view := Lean.extractMacroScopes n; match view.mainModule == mainModule with | true => Lean.Name.mkNum n scp | false => Lean.MacroScopesView.review { name := view.name, imported := List.foldl Lean.Name.mkNum (view.imported ++ view.mainModule) view.scopes, mainModule := mainModule, scopes := [scp] } | false => Lean.Name.mkNum (Lean.Name.mkStr (Lean.Name.mkStr n "_@" ++ mainModule) "_hyg") scp
@[inline]
def
Lean.MonadQuotation.addMacroScope
{m : Type → Type}
[inst : Lean.MonadQuotation m]
[inst : Monad m]
(n : Lean.Name)
:
Equations
- Lean.MonadQuotation.addMacroScope n = do let mainModule ← Lean.getMainModule let scp ← Lean.getCurrMacroScope pure (Lean.addMacroScope mainModule n scp)
Equations
-
Lean.maxRecDepthErrorMessage = "maximum recursion depth has been reached (use `set_option maxRecDepth
` to increase limit)"
- methods : Lean.Macro.MethodsRef
- mainModule : Lean.Name
- currMacroScope : Lean.MacroScope
- currRecDepth : Nat
- maxRecDepth : Nat
- ref : Lean.Syntax
- error: Lean.Syntax → String → Lean.Macro.Exception
- unsupportedSyntax: Lean.Macro.Exception
- macroScope : Lean.MacroScope
- traceMsgs : List (Lean.Name × String)
Equations
- Lean.Macro.instInhabitedState = { default := { macroScope := default, traceMsgs := default } }
@[inline]
@[inline]
Equations
Equations
- Lean.Macro.instMonadRefMacroM = { getRef := do let ctx ← read pure ctx.ref, withRef := fun {α} ref x => withReader (fun ctx => { methods := ctx.methods, mainModule := ctx.mainModule, currMacroScope := ctx.currMacroScope, currRecDepth := ctx.currRecDepth, maxRecDepth := ctx.maxRecDepth, ref := ref }) x }
Equations
- Lean.Macro.addMacroScope n = do let ctx ← read pure (Lean.addMacroScope ctx.mainModule n ctx.currMacroScope)
Equations
- Lean.Macro.throwUnsupported = throw Lean.Macro.Exception.unsupportedSyntax
Equations
- Lean.Macro.throwError msg = do let ref ← Lean.getRef throw (Lean.Macro.Exception.error ref msg)
Equations
- Lean.Macro.throwErrorAt ref msg = Lean.withRef ref (Lean.Macro.throwError msg)
@[inline]
Equations
- Lean.Macro.withFreshMacroScope x = do let fresh ← modifyGet fun s => (s.macroScope, { macroScope := s.macroScope + 1, traceMsgs := s.traceMsgs }) withReader (fun ctx => { methods := ctx.methods, mainModule := ctx.mainModule, currMacroScope := fresh, currRecDepth := ctx.currRecDepth, maxRecDepth := ctx.maxRecDepth, ref := ctx.ref }) x
@[inline]
Equations
- Lean.Macro.withIncRecDepth ref x = do let ctx ← read match ctx.currRecDepth == ctx.maxRecDepth with | true => throw (Lean.Macro.Exception.error ref Lean.maxRecDepthErrorMessage) | false => withReader (fun ctx => { methods := ctx.methods, mainModule := ctx.mainModule, currMacroScope := ctx.currMacroScope, currRecDepth := ctx.currRecDepth + 1, maxRecDepth := ctx.maxRecDepth, ref := ctx.ref }) x
Equations
- Lean.Macro.instMonadQuotationMacroM = Lean.MonadQuotation.mk (fun ctx => pure ctx.currMacroScope) (fun ctx => pure ctx.mainModule) fun {α} => Lean.Macro.withFreshMacroScope
- expandMacro? : Lean.Syntax → Lean.MacroM (Option Lean.Syntax)
- getCurrNamespace : Lean.MacroM Lean.Name
- hasDecl : Lean.Name → Lean.MacroM Bool
- resolveNamespace? : Lean.Name → Lean.MacroM (Option Lean.Name)
- resolveGlobalName : Lean.Name → Lean.MacroM (List (Lean.Name × List String))
Equations
- Lean.Macro.instInhabitedMethods = { default := { expandMacro? := default, getCurrNamespace := default, hasDecl := default, resolveNamespace? := default, resolveGlobalName := default } }
Equations
- Lean.Macro.mkMethodsImp methods = unsafeCast methods
@[implementedBy Lean.Macro.mkMethodsImp]
Equations
- Lean.Macro.instInhabitedMethodsRef = { default := Lean.Macro.mkMethods default }
Equations
- Lean.Macro.getMethodsImp = do let ctx ← read pure (unsafeCast ctx.methods)
@[implementedBy Lean.Macro.getMethodsImp]
Equations
- Lean.expandMacro? stx = do let a ← Lean.Macro.getMethods Lean.Macro.Methods.expandMacro? a stx
Equations
- Lean.Macro.hasDecl declName = do let a ← Lean.Macro.getMethods Lean.Macro.Methods.hasDecl a declName
Equations
- Lean.Macro.getCurrNamespace = do let a ← Lean.Macro.getMethods a.getCurrNamespace
Equations
Equations
Equations
- Lean.Macro.trace clsName msg = modify fun s => { macroScope := s.macroScope, traceMsgs := (clsName, msg) :: s.traceMsgs }
@[inline]
Equations
@[inline]
Equations
- Lean.PrettyPrinter.instMonadQuotationUnexpandM = Lean.MonadQuotation.mk (pure 0) (pure `_fakeMod) fun {α} => id