chore: move Bootstrap.Dynamic -> Init.Dynamic

This commit is contained in:
Mario Carneiro 2022-08-29 23:06:25 -04:00 committed by Leonardo de Moura
parent 07b1b54d03
commit 158e182b8b
10 changed files with 13 additions and 13 deletions

View file

@ -3,4 +3,4 @@ Copyright (c) 2020 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
import Bootstrap.Dynamic
import Bootstrap.Empty

0
src/Bootstrap/Empty.lean Normal file
View file

View file

@ -15,6 +15,7 @@ import Init.WFTactics
import Init.Data
import Init.System
import Init.Util
import Init.Dynamic
import Init.ShareCommon
import Init.Meta
import Init.NotationExtra

View file

@ -4,8 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner
-/
prelude
import Init.Core
namespace Std
open Lean
-- Implementation detail of TypeName, since classes cannot be opaque

View file

@ -14,13 +14,12 @@ private def deriveTypeNameInstance (declNames : Array Name) : CommandElabM Bool
let cinfo ← getConstInfo declName
unless cinfo.levelParams.isEmpty do
throwError m!"{mkConst declName} has universe level parameters"
let TypeName := mkIdent `TypeName
elabCommand <| ← withFreshMacroScope `(
unsafe def instImpl : $TypeName @$(mkCIdent declName) := .mk _ $(quote declName)
@[implementedBy instImpl] opaque inst : $TypeName @$(mkCIdent declName)
instance : $TypeName @$(mkCIdent declName) := inst
unsafe def instImpl : TypeName @$(mkCIdent declName) := .mk _ $(quote declName)
@[implementedBy instImpl] opaque inst : TypeName @$(mkCIdent declName)
instance : TypeName @$(mkCIdent declName) := inst
)
return true
initialize
registerDerivingHandler `TypeName deriveTypeNameInstance
registerDerivingHandler ``TypeName deriveTypeNameInstance

View file

@ -5,7 +5,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Wojciech Nawrocki
-/
import Lean.Data.Json
import Bootstrap.Dynamic
/-! Allows LSP clients to make Remote Procedure Calls to the server.

View file

@ -18,9 +18,9 @@ functionality is purpose-specific to showing the contents of infoview popups.
structure InfoWithCtx where
ctx : Elab.ContextInfo
info : Elab.Info
deriving Inhabited, Std.TypeName
deriving Inhabited, TypeName
deriving instance Std.TypeName for MessageData
deriving instance TypeName for MessageData
instance : ToJson FVarId := ⟨fun f => toJson f.name⟩
instance : ToJson MVarId := ⟨fun f => toJson f.name⟩

View file

@ -19,7 +19,7 @@ inductive StrictOrLazy (α β : Type) : Type
structure LazyTraceChildren where
indent : Nat
children : Array (WithRpcRef MessageData)
deriving Std.TypeName
deriving TypeName
inductive MsgEmbed where
| expr : CodeWithInfos → MsgEmbed

View file

@ -14,7 +14,7 @@ def test (α : Type) [RpcEncodable α] (a : α) := M.run do
structure FooRef where
a : Array Nat
deriving Inhabited, Std.TypeName
deriving Inhabited, TypeName
#check instTypeNameFooRef
#eval test (WithRpcRef FooRef) default

View file

@ -1,4 +1,4 @@
instTypeNameFooRef : Std.TypeName FooRef
instTypeNameFooRef : TypeName FooRef
ok: {"p": "0"}
instRpcEncodableBar : RpcEncodable Bar
ok: {"fooRef": {"p": "0"}, "fooJson": {"s": ""}}