Equations
- Function.comp f g x = f (g x)
Equations
- Function.const β a x = a
Auxiliary unsafe constant used by the Compiler to mark unreachable code.
Equations
- False.elim h = False.rec (fun x => C) h
Auxiliary Declaration used to implement the named patterns x@h:p
Equations
- namedPattern x a h = a
- default : α
Instances
- instInhabited
- instInhabitedSort
- instInhabitedForAll_1
- instInhabitedProp
- IO.AsyncList.instInhabitedAsyncList
- Lean.Elab.instInhabitedTacticInfo
- Lean.instInhabitedDeclarationRanges
- Lean.instInhabitedRat
- IO.instInhabitedError
- Nat.SOM.instInhabitedExpr
- 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.Server.Snapshots.instInhabitedSnapshot
- Lean.Meta.Linear.instInhabitedJustification
- Lean.Meta.instInhabitedSimpTheorem
- 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.Meta.instInhabitedKExprMap
- Lean.Parser.Trie.instInhabitedTrie
- Lean.Meta.instInhabitedEqnsExtState
- Lean.SubExpr.Pos.instInhabitedPos
- Lean.instInhabitedStructureFieldInfo
- Lean.Meta.instInhabitedUnificationHints
- Lean.instInhabitedTSyntax
- 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.Meta.instInhabitedSimpCongrTheorems
- Lean.Meta.Linear.instInhabitedCnstr
- Lean.Lsp.instInhabitedCompletionItemKind
- Lean.Elab.Term.instInhabitedNamedArg
- Lean.Elab.Command.instInhabitedInductiveView
- Lean.instInhabitedScopedEnvExtension
- Lean.instInhabitedDefinitionSafety
- Lean.instInhabitedEnumAttributes
- instInhabitedExceptT
- Std.instInhabitedFormat
- Lean.instInhabitedQuotKind
- Lean.Elab.Term.CollectPatternVars.instInhabitedState
- Lean.instInhabitedSourceInfo
- Lean.Elab.instInhabitedPreDefinition
- Lean.SSet.instInhabitedSSet
- Lean.Core.instInhabitedCache
- Lean.Parser.instInhabitedInputContext
- Lean.instInhabitedSubExpr
- 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.Linear.instInhabitedPoly
- 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.IR.instInhabitedVarId
- Lean.Meta.Linear.instInhabitedState
- Lean.Elab.instInhabitedModifiers
- Lean.Widget.instInhabitedSubexprInfo
- 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.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
- Unicode.instInhabitedGeneralCategory
- Lean.instInhabitedBinderInfo
- Lean.Lsp.instInhabitedPosition
- Lean.Macro.instInhabitedMethodsRef
- Lean.instInhabitedDeclaration
- String.instInhabitedRange
- Lean.instInhabitedSyntax
- Lean.Meta.Linear.instInhabitedCnstrKind
- Lean.instInhabitedRecursorRule
- Lean.MapDeclarationExtension.instInhabitedMapDeclarationExtension
- Lean.instInhabitedQuotVal
- Lean.instInhabitedExternAttrData
- Lean.Meta.instInhabitedCustomEliminator
- Lean.Meta.instInhabitedElimInfo
- Lean.Lsp.instInhabitedLeanFileProgressKind
- Lean.Elab.instInhabitedDefViewElabHeader
- instInhabitedUInt64
- Lean.Widget.instInhabitedInteractiveTermGoal
- Lean.Meta.instInhabitedCaseArraySizesSubgoal
- Lean.instInhabitedData_1
- Lean.Widget.instInhabitedInfoPopup
- Lean.Parser.instInhabitedPrattParsingTables
- Nat.Linear.instInhabitedExpr
- 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.Meta.instInhabitedEtaStructMode
- 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.Meta.DSimp.instInhabitedConfig
- Lean.Elab.Tactic.instInhabitedSnapshot
- Lean.IR.instInhabitedIRType
- Lean.Lsp.instInhabitedDiagnosticRelatedInformation
- Lean.Elab.instInhabitedContextInfo
- Lean.instInhabitedReducibilityHints
- Lean.Parser.instInhabitedParserInfo
- Lean.Meta.Linear.instInhabitedVar
- 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.Meta.AC.instInhabitedPreContext
- Lean.instInhabitedNameGenerator
- Lean.instInhabitedLazyInitExtension
- Lean.Elab.Term.StructInst.instInhabitedExplicitSourceInfo
- Lean.Data.AC.instInhabitedExpr
- 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.Elab.Term.instInhabitedLetRecToLift
- 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.Meta.Match.instInhabitedDiscrInfo
- Lean.Compiler.instInhabitedSpecEntry
- Lean.Lsp.instInhabitedDiagnosticWith
- instInhabitedReaderT
- Lean.Server.instInhabitedRequestM
- Lean.Meta.SynthInstance.instInhabitedSynthM
- Lean.Core.instInhabitedCoreM
- Lean.Elab.Term.instInhabitedTermElabM
- Lean.Meta.Simp.instInhabitedM
- Lean.PrettyPrinter.Delaborator.instInhabitedDelabM
- Lean.Elab.Command.instInhabitedCommandElabM
- Lean.Meta.instInhabitedMetaM
- Lean.Widget.TaggedText.instInhabitedTaggedState
- Lean.instInhabitedOccurrences
- Lean.Parser.TokenMap.instInhabitedTokenMap
- Lean.Meta.instInhabitedSimpCongrTheorem
- Sum.inhabitedLeft
- Sum.inhabitedRight
- EStateM.instInhabitedEStateM
- Lean.Lsp.instInhabitedPublishDiagnosticsParams
- Std.instInhabitedAssocList
- Lean.Server.instInhabitedRpcProcedure
- 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.Meta.instInhabitedCongrArgKind
- Lean.JsonRpc.instInhabitedRequestID
- instInhabitedEST
- Lean.instInhabitedStructureState
- Lean.Meta.instInhabitedSimpTheorems
- Lean.instInhabitedTraceState
- Lean.ScopedEnvExtension.instInhabitedDescr
- Lean.instInhabitedStructureDescr
- Lean.instInhabitedAttributeImpl
- Lean.Macro.instInhabitedState
- Lean.Lsp.instInhabitedRange
- Lean.Elab.Command.instInhabitedStructFieldInfo
- Lean.instFVarIdHashSetInhabited
- Lean.instInhabitedModuleData
- Lean.IR.instInhabitedArg
- Lean.Meta.instInhabitedState
- Lean.Parser.ParserExtension.instInhabitedEntry
- Lean.instInhabitedConstantVal
- Lean.Widget.instInhabitedInteractiveHypothesisBundle
- instInhabitedPNonScalar
- Lean.instInhabitedLocalDecl
- Lean.Elab.instInhabitedCustomInfo
- 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.Meta.Linear.instInhabitedAssumptionId
- 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.Meta.instInhabitedElimAltInfo
- Lean.instInhabitedMVarId
- Lean.Compiler.CSimp.instInhabitedEntry
- Lean.Meta.instInhabitedAbstractMVarsResult
- Lean.Meta.instInhabitedFVarSubst
- instInhabitedProd
- Lean.FuzzyMatching.instInhabitedCharRole
- Lean.instInhabitedReducibilityStatus
- Lean.instInhabitedDeclarationRange
- Lean.instInhabitedMVarIdMap
- System.instInhabitedFilePath
- Lean.Widget.instInhabitedMsgEmbed
- Lean.Widget.instInhabitedGetInteractiveDiagnosticsParams
- Lean.Elab.instInhabitedCommandInfo
- Lean.instInhabitedInductiveVal
- Lean.Elab.Tactic.instInhabitedCache
- Lean.Meta.instInhabitedSimpEntry
- Lean.KeyedDeclsAttribute.instInhabitedDef
- Lean.Lsp.instInhabitedLocation
- Lean.Widget.instInhabitedInfoWithCtx
- Lean.Meta.instInhabitedCustomEliminators
- Lean.Meta.SimpAll.instInhabitedEntry
- Std.HashSet.instInhabitedHashSet
- Lean.instInhabitedOptionDecls
- Std.PersistentHashSet.instInhabitedPersistentHashSet
- Lean.instInhabitedAttributeKind
- Lean.instInhabitedOptions
- Lean.Meta.Linear.instInhabitedAssignment
- instInhabitedBool
- Lean.Compiler.CSimp.instInhabitedState
- Lean.instInhabitedConstructor
- FloatArray.instInhabitedFloatArray
- Lean.Elab.Tactic.instInhabitedSimpKind
- Lean.instInhabitedMacroScopesView
- Lean.instInhabitedException
- Lean.Elab.Term.instInhabitedDiscr
- Lean.Elab.instInhabitedFieldInfo
- Lean.Elab.Term.StructInst.instInhabitedStruct
- Lean.Elab.Tactic.instInhabitedCacheKey
- 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.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
- instInhabitedPos
- 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.Server.RpcEncoding.instInhabitedCtorState
- 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 α)
Equations
- instInhabitedSort = { default := PUnit }
Equations
- instInhabitedForAll α = { default := fun x => default }
Equations
- instInhabitedForAll_1 α = { default := fun x => default }
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
- Lean.Meta.Linear.instDecidableLtVarInstLTVar
- List.hasDecidableLt
- floatDecLt
- Nat.decLt
- Lean.JsonRpc.instDecidableLtRequestIDInstLTRequestID
- prodHasDecidableLt
- instDecidableLtPosInstLTPos
- Lean.Name.instDecidableRelNameLtHasLtQuick
- Lean.instDecidableLtLiteralInstLTLiteral
- String.decLt
- instDecidableLtUSizeInstLTUSize
- Char.instDecidableLtCharInstLTChar
- Fin.decLt
- Int.decLt
- instDecidableEqProp
- Lean.instDecidableEqRat
- instDecidableEqQuotient
- Lean.Meta.Linear.instDecidableEqJustification
- instDecidableEqUInt32
- Lean.instDecidableEqPosition
- instDecidableEqUInt8
- Lean.SubExpr.Pos.instDecidableEqPos
- Lean.Meta.Linear.instDecidableEqCnstr
- Lean.instDecidableEqJsonNumber
- Lean.Lsp.instDecidableEqCompletionItemKind
- Lean.Meta.Linear.instDecidableEqPoly
- Subtype.instDecidableEqSubtype
- instDecidableEqPUnit
- instDecidableEqOption
- Unicode.instDecidableEqGeneralCategory
- Lean.Meta.Linear.instDecidableEqCnstrKind
- instDecidableEqUInt64
- instDecidableEqUInt16
- Lean.Elab.Command.instDecidableEqStructFieldKind
- Lean.Meta.Linear.instDecidableEqVar
- String.instDecidableEqIterator
- instDecidableEqList
- instDecidableEqSum
- instDecidableEqNat
- Lean.Meta.Linear.instDecidableEqAssumptionId
- Array.instDecidableEqArray
- instDecidableEqProd
- Lean.instDecidableEqDeclarationRange
- System.instDecidableEqFilePath
- instDecidableEqBool
- instDecidableEqPos
- instDecidableEqString
- instDecidableEqUSize
- instDecidableEqChar
- instDecidableEqFin
- Int.instDecidableEqInt
- List.instDecidableMemListInstMembershipList
- instDecidableTrue
- instDecidableNot
- instDecidableFalse
- instDecidableRelLeLeOfOrd
- Lean.Rat.instDecidableLeRatInstLERat
- instDecidableLeUInt32InstLEUInt32
- instDecidableLeUInt8InstLEUInt8
- instDecidableLeUInt64InstLEUInt64
- instDecidableLeUInt16InstLEUInt16
- List.instForAllListDecidableLeInstLEList
- floatDecLe
- Nat.decLe
- instDecidableLePosInstLEPos
- instDecidableLeUSizeInstLEUSize
- Char.instDecidableLeCharInstLEChar
- Fin.decLe
- Int.decLe
- Option.instDecidableRelOptionLt
- instDecidableAnd
- instDecidableOr
- instDecidableForAll
Equations
- decide p = Decidable.casesOn h (fun x => false) fun x => true
Equations
- DecidablePred r = ((a : α) → Decidable (r a))
Equations
- DecidableRel r = ((a b : α) → Decidable (r a b))
Equations
- DecidableEq α = ((a b : α) → Decidable (a = b))
Equations
- One or more equations did not get rendered due to their size.
- beq : α → α → Bool
Instances
- instBEq
- Lean.Lsp.instBEqRpcRef
- Lean.instBEqRat
- Lean.instBEqDataValue
- Lean.ExprStructEq.instBEqExprStructEq
- Lean.Lsp.instBEqCancelParams
- Lean.Meta.Linear.instBEqJustification
- Lean.Meta.instBEqSimpTheorem
- Lean.Meta.Simp.instBEqConfig
- Lean.instBEqFVarId
- Lean.JsonRpc.instBEqResponseError
- Lean.Json.instBEqJson
- Substring.hasBeq
- Lean.Parser.instBEqLeadingIdentBehavior
- IO.FS.instBEqFileType
- Lean.Syntax.instBEqTSyntax
- Lean.instBEqInternalExceptionId
- Lean.Meta.DiscrTree.instBEqKey
- Lean.Parser.instBEqError
- Lean.Meta.Linear.instBEqCnstr
- 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
- String.instBEqRange
- Lean.Syntax.instBEqSyntax
- Lean.Meta.Linear.instBEqCnstrKind
- Lean.Lsp.instBEqLeanFileProgressKind
- Lean.instBEqData_1
- Lean.Expr.instBEqExpr
- Lean.Meta.instBEqEtaStructMode
- Lean.Compiler.instBEqSpecializeAttributeKind
- Std.Format.instBEqFlattenBehavior
- Lean.Lsp.instBEqDiagnosticCode
- Lean.Meta.DSimp.instBEqConfig
- Lean.IR.IRType.instBEqIRType
- Lean.Lsp.instBEqDiagnosticRelatedInformation
- Lean.Lsp.instBEqDiagnosticTag
- Lean.Data.AC.instBEqExpr
- Lean.Server.instBEqGoToKind
- List.instBEqList
- Lean.Widget.instBEqTaggedText
- Lean.instBEqLOption
- Lean.Lsp.instBEqDiagnosticWith
- Lean.instBEqOccurrences
- Lean.Lsp.instBEqPublishDiagnosticsParams
- Lean.JsonRpc.instBEqNotification
- Nat.Linear.instBEqPolyCnstr
- instBEqFloat
- instBEqNat
- Lean.Meta.instBEqTransparencyMode
- Lean.instBEqLBool
- Lean.JsonRpc.instBEqRequestID
- Lean.Lsp.instBEqRange
- Lean.IR.instBEqArg
- 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.Elab.Tactic.instBEqSimpKind
- Lean.Elab.Tactic.instBEqCacheKey
- 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
Equations
- (if c then t else e) = Decidable.casesOn h (fun x => e) fun x => t
- ofNat : α
Instances
- Lean.Rat.instOfNatRat
- instOfNatUInt32
- instOfNatUInt8
- Lean.Json.instOfNatJson
- Lean.JsonNumber.instOfNatJsonNumber
- Id.instOfNatId
- instOfNatUInt64
- instOfNatUInt16
- instOfNatFloat
- instOfNatNat
- Lean.JsonRpc.instOfNatRequestID
- String.instOfNatPos
- instOfNatUSize
- Fin.instOfNatFinHAddNatInstHAddInstAddNatOfNat
- instOfNatInt
- Int.instOfNatInt
Equations
- instOfNatNat n = { ofNat := n }
- lt : α → α → Prop
Instances
- Lean.Rat.instLTRat
- instLTUInt32
- instLTUInt8
- Lean.Meta.DiscrTree.instLTKey
- Lean.JsonNumber.instLTJsonNumber
- IO.FS.instLTSystemTime
- instLTOption
- Lean.Lsp.instLTPosition
- instLTUInt64
- instLTUInt16
- Lean.Meta.Linear.instLTVar
- List.instLTList
- instLTFloat
- instLTNat
- Lean.JsonRpc.instLTRequestID
- Lean.Lsp.instLTRange
- instLTProd
- instLTPos
- 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 }
- hAdd : α → β → γ
- hSub : α → β → γ
Instances
- hDiv : α → β → γ
- hMod : α → β → γ
- hPow : α → β → γ
Instances
- hAppend : α → β → γ
- hOrElse : α → (Unit → β) → γ
Instances
- hAndThen : α → (Unit → β) → γ
Instances
- hShiftLeft : α → β → γ
Instances
- hShiftRight : α → β → γ
Instances
- add : α → α → α
- sub : α → α → α
- mul : α → α → α
- neg : α → α
- 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 : α → α → α
Equations
- instHAppend = { hAppend := fun a b => Append.append a b }
Equations
- instHOrElse = { hOrElse := fun a b => OrElse.orElse a b }
Equations
- instHAndThen = { hAndThen := fun a b => AndThen.andThen a b }
Equations
- instHShiftLeft = { hShiftLeft := fun a b => ShiftLeft.shiftLeft a b }
Equations
- instHShiftRight = { hShiftRight := fun a b => ShiftRight.shiftRight a b }
- mem : α → γ → Prop
Equations
Equations
- UInt8.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
- instInhabitedUInt8 = { default := UInt8.ofNatCore 0 instInhabitedUInt8.proof_1 }
Equations
- UInt16.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUInt16 = { default := UInt16.ofNatCore 0 instInhabitedUInt16.proof_1 }
Equations
- UInt32.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
- UInt32.toNat n = n.val.val
Equations
Equations
- instInhabitedUInt32 = { default := UInt32.ofNatCore 0 instInhabitedUInt32.proof_1 }
Equations
- UInt32.decLt a b = match a, b with | { val := n }, { val := m } => inferInstanceAs (Decidable (n < m))
Equations
- UInt32.decLe a b = match a, b with | { val := n }, { val := m } => inferInstanceAs (Decidable (n ≤ m))
Equations
Equations
Equations
- UInt64.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
Equations
- instInhabitedUInt64 = { default := UInt64.ofNatCore 0 instInhabitedUInt64.proof_1 }
Equations
- USize.ofNatCore n h = { val := { val := n, isLt := h } }
Equations
- instInhabitedUSize = { default := USize.ofNatCore 0 instInhabitedUSize.proof_1 }
Equations
- USize.ofNat32 n h = { val := { val := n, isLt := (_ : n < USize.size) } }
Equations
- val : UInt32
- valid : UInt32.isValidChar val
The Char
Type represents an unicode scalar value.
See http://www.unicode.org/glossary/#unicode_scalar_value).
Equations
- Char.ofNatAux n h = { val := { val := { val := n, isLt := (_ : n < UInt32.size) } }, valid := h }
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
- One or more equations did not get rendered due to their size.
Equations
- instInhabitedOption = { default := none }
Equations
- Option.getD _fun_discr _fun_discr = match _fun_discr, _fun_discr with | some x, x_1 => x | none, e => e
Equations
- Option.map f _fun_discr = match _fun_discr with | some x => some (f x) | none => none
Equations
- instInhabitedList = { default := [] }
Equations
- One or more equations did not get rendered due to their size.
- List.hasDecEq [] [] = isTrue (_ : [] = [])
- List.hasDecEq (head :: tail) [] = isFalse (_ : head :: tail = [] → List.noConfusionType False (head :: tail) [])
- List.hasDecEq [] (head :: tail) = isFalse (_ : [] = head :: tail → List.noConfusionType False [] (head :: tail))
Equations
- instDecidableEqList = List.hasDecEq
Equations
- List.foldl f _fun_discr [] = _fun_discr
- List.foldl f _fun_discr (b :: l) = List.foldl f (f _fun_discr b) l
Equations
- List.length [] = 0
- List.length (head :: as) = List.length as + 1
Equations
- List.lengthTRAux [] _fun_discr = _fun_discr
- List.lengthTRAux (head :: as) _fun_discr = List.lengthTRAux as (Nat.succ _fun_discr)
Equations
- List.lengthTR as = List.lengthTRAux as 0
Equations
- List.concat [] _fun_discr = [_fun_discr]
- List.concat (a :: as) _fun_discr = a :: List.concat as _fun_discr
Equations
- byteIdx : Nat
A byte position in a String
. Internally, String
s are UTF-8 encoded.
Codepoint positions (counting the Unicode codepoints rather than bytes)
are represented by plain Nat
s instead.
Indexing a String
by a byte position is constant-time, while codepoint
positions need to be translated internally to byte positions in linear-time.
Equations
- instInhabitedPos = { default := { byteIdx := 0 } }
Equations
- One or more equations did not get rendered due to their size.
Equations
- instInhabitedSubstring = { default := { str := "", startPos := { byteIdx := 0 }, stopPos := { byteIdx := 0 } } }
Equations
- Substring.bsize _fun_discr = match _fun_discr with | { str := str, startPos := b, stopPos := e } => Nat.sub e.byteIdx b.byteIdx
Equations
- String.utf8ByteSize _fun_discr = match _fun_discr with | { data := s } => String.utf8ByteSize.go s
Equations
- String.utf8ByteSize.go [] = 0
- String.utf8ByteSize.go (c :: cs) = String.utf8ByteSize.go cs + String.csize c
Equations
- instHAddPos = { hAdd := fun p₁ p₂ => { byteIdx := p₁.byteIdx + p₂.byteIdx } }
Equations
- instHSubPos = { hSub := fun p₁ p₂ => { byteIdx := p₁.byteIdx - p₂.byteIdx } }
Equations
- instHAddPosChar = { hAdd := fun p c => { byteIdx := p.byteIdx + String.csize c } }
Equations
- instHAddPosString = { hAdd := fun p s => { byteIdx := p.byteIdx + String.utf8ByteSize s } }
Equations
- instDecidableLePosInstLEPos p₁ p₂ = inferInstanceAs (Decidable (p₁.byteIdx ≤ p₂.byteIdx))
Equations
- instDecidableLtPosInstLTPos p₁ p₂ = inferInstanceAs (Decidable (p₁.byteIdx < p₂.byteIdx))
Equations
- String.endPos s = { byteIdx := String.utf8ByteSize s }
Equations
- String.toSubstring s = { str := s, startPos := { byteIdx := 0 }, stopPos := String.endPos s }
Equations
- Array.mkEmpty c = { data := [] }
Equations
- Array.size a = List.length a.data
Equations
- Array.getD a i v₀ = if h : i < Array.size a then Array.get a { val := i, isLt := h } else v₀
Equations
- Array.get! a i = Array.getD a i default
Equations
- Array.getOp self idx = Array.get! self idx
Equations
- Array.push a v = { data := List.concat a.data v }
Equations
- Array.setD a i v = if h : i < Array.size a then Array.set a { val := i, isLt := h } v else a
Equations
- Array.set! a i v = Array.setD a i v
Equations
- Array.appendCore as bs = Array.appendCore.loop bs (Array.size bs) 0 as
Equations
- List.toArrayAux [] _fun_discr = _fun_discr
- List.toArrayAux (a :: as) _fun_discr = List.toArrayAux as (Array.push _fun_discr a)
Equations
- List.redLength [] = 0
- List.redLength (head :: as) = Nat.succ (List.redLength as)
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
- instMonadOption
- 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
Equations
- instInhabitedForAll_2 = { default := pure }
Equations
- Array.sequenceMap as f = Array.sequenceMap.loop as f (Array.size as) 0 (Array.mkEmpty (Array.size as))
- monadLift : {α : Type u} → m α → n α
A Function for lifting a computation from an inner Monad to an outer Monad.
Like MonadTrans,
but n
does not have to be a monad transformer.
Alternatively, an implementation of MonadLayer without layerInvmap
(so far).
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 α
The reflexive-transitive closure of MonadLift
.
monadLift
is used to transitively lift monadic computations such as StateT.get
or StateT.put s
.
Corresponds to MonadLift.
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 α
A functor in the category of monads. Can be used to lift monad-transforming functions. Based on pipes' MFunctor, but not restricted to monad transformers. Alternatively, an implementation of MonadTransFunctor.
- monadMap : {α : Type u} → ({β : Type u} → m β → m β) → n α → n α
The reflexive-transitive closure of MonadFunctor
.
monadMap
is used to transitively lift Monad morphisms
Instances
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 α
An implementation of MonadError
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
- instMonadExceptOfUnitOption
- OptionT.instMonadExceptOfUnitOptionT
- Lean.MonadError.toMonadExceptOf
Equations
- throwThe ε e = MonadExceptOf.throw e
Equations
- tryCatchThe ε x handle = MonadExceptOf.tryCatch x handle
- throw : {α : Type v} → ε → m α
- tryCatch : {α : Type v} → m α → (ε → m α) → m α
Similar to MonadExceptOf
, but ε
is an outParam for convenience
Equations
- instMonadExcept ε m = { throw := fun {α} => throwThe ε, tryCatch := fun {α} => tryCatchThe ε }
Equations
- MonadExcept.orElse t₁ t₂ = tryCatch t₁ fun x => t₂ ()
Equations
- MonadExcept.instOrElse = { orElse := MonadExcept.orElse }
Equations
- instInhabitedReaderT ρ m α = { default := fun x => default }
Equations
- ReaderT.run x r = x r
Equations
- ReaderT.instMonadLiftReaderT = { monadLift := fun {α} x x_1 => x }
Equations
- ReaderT.instMonadExceptOfReaderT ε = { throw := fun {α} e => liftM (throw e), tryCatch := fun {α} x c r => tryCatchThe ε (x r) fun e => c e r }
Equations
- ReaderT.read = pure
Equations
- ReaderT.pure a x = pure a
Equations
- ReaderT.bind x f r = do let a ← x r f a r
Equations
- ReaderT.map f x r = f <$> x r
Equations
- ReaderT.instMonadFunctorReaderT ρ m = { monadMap := fun {α} f x ctx => f α (x ctx) }
Equations
- ReaderT.adapt f x r = x (f r)
- read : m ρ
An implementation of MonadReader.
It does not contain local
because this Function cannot be lifted using monadLift
.
Instead, the MonadReaderAdapter
class provides the more general adaptReader
Function.
Note: This class can be seen as a simplification of the more "principled" definition
```
class MonadReader (ρ : outParam (Type u)) (n : Type u → Type u) where
lift {α : Type u} : ({m : Type u → Type u} → [Monad m] → ReaderT ρ m α) → n α
```
Equations
- instMonadReader ρ m = { read := readThe ρ }
Equations
- instMonadReaderOfReaderT = { read := ReaderT.read }
- withReader : {α : Type u} → (ρ → ρ) → m α → m α
Equations
- withTheReader ρ f x = MonadWithReaderOf.withReader f x
- withReader : {α : Type u} → (ρ → ρ) → m α → m α
Instances
Equations
- instMonadWithReader ρ m = { withReader := fun {α} => withTheReader ρ }
Equations
- instMonadWithReaderOf = { withReader := fun {α} f => monadMap fun {β} => withTheReader ρ f }
Equations
- instMonadWithReaderOfReaderT = { withReader := fun {α} f x ctx => x (f ctx) }
An implementation of MonadState.
In contrast to the Haskell implementation, we use overlapping instances to derive instances
automatically from monadLift
.
Equations
- modifyThe σ f = MonadStateOf.modifyGet fun s => (PUnit.unit, f s)
Equations
Similar to MonadStateOf
, but σ
is an outParam for convenience
Instances
Equations
- instMonadState σ m = { get := getThe σ, set := set, modifyGet := fun {α} f => MonadStateOf.modifyGet f }
Equations
- modify f = modifyGet fun s => (PUnit.unit, f s)
- ok: {ε σ α : Type u} → α → σ → EStateM.Result ε σ α
- error: {ε σ α : Type u} → ε → σ → 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 }
Equations
- EStateM.pure a s = EStateM.Result.ok a s
Equations
Equations
- EStateM.get s = EStateM.Result.ok s s
Equations
- EStateM.modifyGet f s = match f s with | (a, s) => EStateM.Result.ok a s
Equations
- EStateM.throw e s = EStateM.Result.error e s
- save : σ → δ
- restore : σ → δ → σ
Auxiliary instance for saving/restoring the "backtrackable" part of the state.
Instances
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
Equations
- EStateM.orElse x₁ x₂ s = let d := EStateM.Backtrackable.save s; match x₁ s with | EStateM.Result.error a s => x₂ () (EStateM.Backtrackable.restore s d) | ok => ok
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
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
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
Equations
- EStateM.seqRight x y s = match x s with | EStateM.Result.ok a s => y () s | EStateM.Result.error e s => EStateM.Result.error e s
Equations
- EStateM.instMonadEStateM = Monad.mk
Equations
- EStateM.instOrElseEStateM = { orElse := EStateM.orElse }
Equations
- EStateM.instMonadStateOfEStateM = { get := EStateM.get, set := EStateM.set, modifyGet := fun {α} => EStateM.modifyGet }
Equations
- EStateM.instMonadExceptOfEStateM = { throw := fun {α} => EStateM.throw, tryCatch := fun {α} => EStateM.tryCatch }
Equations
- EStateM.run x s = x s
Equations
- EStateM.run' x s = match EStateM.run x s with | EStateM.Result.ok v a => some v | EStateM.Result.error a a_1 => none
Equations
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
- String.instHashableRange
- instHashableUInt64
- Lean.Expr.instHashableExpr
- instHashableUInt16
- instHashableList
- instHashableNat
- Lean.Meta.TransparencyMode.instHashableTransparencyMode
- Lean.Lsp.instHashableRange
- Lean.Lsp.instHashableRefIdent
- instHashableArray
- Lean.instHashableMVarId
- instHashableProd
- Lean.IR.Borrow.OwnedSet.instHashableKey
- System.instHashableFilePath
- Lean.IR.Borrow.ParamMap.instHashableKey
- instHashableBool
- Lean.Elab.Tactic.instHashableCacheKey
- Lean.HeadIndex.instHashableHeadIndex
- instHashablePos
- Lean.instHashableName
- Lean.instHashableLiteral
- instHashableString
- instHashableUSize
- Lean.IR.instHashableJoinPointId
- Unicode.instHashableChar
- instHashableFin
- Lean.Level.instHashableLevel
- instHashableInt
Equations
- instHashableString = { hash := String.hash }
Equations
- Lean.instInhabitedName = { default := Lean.Name.anonymous }
Equations
- Lean.Name.hash _fun_discr = match _fun_discr with | Lean.Name.anonymous => UInt64.ofNatCore 1723 Lean.Name.hash.proof_1 | Lean.Name.str a a_1 h => h | Lean.Name.num a a_1 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
Equations
- Lean.Name.beq Lean.Name.anonymous Lean.Name.anonymous = true
- Lean.Name.beq (Lean.Name.str p₁ s₁ a) (Lean.Name.str p₂ s₂ a_1) = (s₁ == s₂ && Lean.Name.beq p₁ p₂)
- Lean.Name.beq (Lean.Name.num p₁ n₁ a) (Lean.Name.num p₂ n₂ a_1) = (n₁ == n₂ && Lean.Name.beq p₁ p₂)
- Lean.Name.beq _fun_discr _fun_discr = false
Equations
- Lean.Name.instBEqName = { beq := Lean.Name.beq }
Equations
- Lean.Name.append _fun_discr Lean.Name.anonymous = _fun_discr
- Lean.Name.append _fun_discr (Lean.Name.str p s a) = Lean.Name.mkStr (Lean.Name.append _fun_discr p) s
- Lean.Name.append _fun_discr (Lean.Name.num p d a) = Lean.Name.mkNum (Lean.Name.append _fun_discr 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
Source information of tokens.
Equations
- Lean.instInhabitedSourceInfo = { default := Lean.SourceInfo.none }
Equations
- One or more equations did not get rendered due to their size.
- 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
Syntax objects used by the parser, macro expander, delaborator, etc.
- raw : Lean.Syntax
A Syntax
value of one of the given syntax kinds.
Note that while syntax quotations produce/expect TSyntax
values of the correct kinds,
this is not otherwise enforced and can easily be circumvented by direct use of the constructor.
The namespace TSyntax.Compat
can be opened to expose a general coercion from Syntax
to any
TSyntax ks
for porting older code.
Equations
- Lean.instInhabitedSyntax = { default := Lean.Syntax.missing }
Equations
- Lean.instInhabitedTSyntax = { default := { raw := default } }
Equations
- Lean.scientificLitKind = `scientific
Equations
- Lean.interpolatedStrLitKind = `interpolatedStrLitKind
Equations
- Lean.interpolatedStrKind = `interpolatedStrKind
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Syntax.setKind stx k = match stx with | Lean.Syntax.node info kind 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 info kind args => Array.getD args i Lean.Syntax.missing | x => Lean.Syntax.missing
Equations
- Lean.Syntax.getOp self idx = Lean.Syntax.getArg self idx
Equations
- Lean.Syntax.getArgs stx = match stx with | Lean.Syntax.node info kind args => args | x => Array.empty
Equations
- Lean.Syntax.getNumArgs stx = match stx with | Lean.Syntax.node info kind args => Array.size args | x => 0
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Syntax.isMissing _fun_discr = match _fun_discr 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 _fun_discr = match _fun_discr with | Lean.Syntax.ident info rawVal val preresolved => true | x => false
Equations
- Lean.Syntax.getId _fun_discr = match _fun_discr with | Lean.Syntax.ident info rawVal val preresolved => val | x => Lean.Name.anonymous
Equations
- Lean.Syntax.setArgs stx args = match stx with | Lean.Syntax.node info k args => 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
Retrieve the left-most node or leaf's info in the Syntax tree.
Retrieve the left-most leaf's info in the Syntax tree, or none
if there is no token.
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
- elemsAndSeps : Array Lean.Syntax
An array of syntax elements interspersed with separators. Can be coerced to/from Array Syntax
to automatically
remove/insert the separators.
- elemsAndSeps : Array Lean.Syntax
A typed version of SepArray
.
Equations
- Lean.TSyntaxArray ks = Array (Lean.TSyntax ks)
Equations
- Lean.TSyntaxArray.rawImpl = unsafeCast
Equations
- Lean.TSyntaxArray.mkImpl = unsafeCast
Equations
- One or more equations did not get rendered due to their size.
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 "" }
Equations
Macro scope used internally. It is not available for our frontend.
Equations
First macro scope available for our frontend
Equations
- getRef : m Lean.Syntax
- withRef : {α : Type} → Lean.Syntax → m α → m α
Instances
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 val => ref | x => oldRef
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 α
A monad that supports syntax quotations. Syntax quotations (in term
position) are monadic values that when executed retrieve the current "macro
scope" from the monad and apply it to every identifier they introduce
(independent of whether this identifier turns out to be a reference to an
existing declaration, or an actually fresh binding during further
elaboration). We also apply the position of the result of getRef
to each
introduced symbol, which results in better error positions than not applying
any position.
Instances
- Lean.instMonadQuotation
- Lean.Unhygienic.instMonadQuotationUnhygienic
- Lean.Core.instMonadQuotationCoreM
- Lean.PrettyPrinter.instMonadQuotationUnexpandM
- 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)
Equations
- Lean.instMonadQuotation = Lean.MonadQuotation.mk (liftM Lean.getCurrMacroScope) (liftM Lean.getMainModule) fun {α} => monadMap fun {β} => Lean.withFreshMacroScope
Equations
- Lean.Name.hasMacroScopes (Lean.Name.str a s a_1) = (s == "_hyg")
- Lean.Name.hasMacroScopes (Lean.Name.num p a a_1) = Lean.Name.hasMacroScopes p
- Lean.Name.hasMacroScopes _fun_discr = 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
- One or more equations did not get rendered due to their size.
Revert all addMacroScope
calls. v = extractMacroScopes n → n = v.review
.
This operation is useful for analyzing/transforming the original identifiers, then adding back
the scopes (via MacroScopesView.review
).
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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 <num>` to increase limit)"
Equations
- Lean.Syntax.matchesNull stx n = Lean.Syntax.isNodeOf stx Lean.nullKind n
Function used for determining whether a syntax pattern `(id)
is matched.
There are various conceivable notions of when two syntactic identifiers should be regarded as identical,
but semantic definitions like whether they refer to the same global name cannot be implemented without
context information (i.e. MonadResolveName
). Thus in patterns we default to the structural solution
of comparing the identifiers' Name
values, though we at least do so modulo macro scopes so that
identifiers that "look" the same match. This is particularly useful when dealing with identifiers that
do not actually refer to Lean bindings, e.g. in the stx
pattern `(many($p))
.
Equations
Equations
- One or more equations did not get rendered due to their size.
- 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
Equations
- Lean.Macro.instInhabitedState = { default := { macroScope := default, traceMsgs := default } }
Equations
- One or more equations did not get rendered due to their size.
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)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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 (List Lean.Name)
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Macro.mkMethodsImp methods = unsafeCast methods
Equations
- Lean.Macro.instInhabitedMethodsRef = { default := Lean.Macro.mkMethods default }
Equations
- Lean.Macro.getMethodsImp = do let ctx ← read pure (unsafeCast ctx.methods)
expandMacro? stx
return some stxNew
if stx
is a macro, and stxNew
is its expansion.
Equations
- Lean.expandMacro? stx = do let a ← Lean.Macro.getMethods Lean.Macro.Methods.expandMacro? a stx
Return true
if the environment contains a declaration with name declName
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 }
Equations
Function that tries to reverse macro expansions as a post-processing step of delaboration.
While less general than an arbitrary delaborator, it can be declared without importing Lean
.
Used by the [appUnexpander]
attribute.
Equations
- Lean.PrettyPrinter.instMonadQuotationUnexpandM = Lean.MonadQuotation.mk (pure 0) (pure `_fakeMod) fun {α} => id