lean4-htt/tests/lean/run/derivingRpcEncoding.lean
2022-05-12 08:38:09 -07:00

33 lines
677 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean.Server.Rpc.Basic
open Lean Server
structure FooRef where
a : Array Nat
deriving RpcEncoding with { withRef := true }
structure FooJson where
s : String
deriving FromJson, ToJson
structure Bar where
fooRef : WithRpcRef FooRef
fooJson : FooJson
deriving RpcEncoding
structure BarTrans where
bar : Bar
deriving RpcEncoding
structure Baz where
arr : Array String -- non-constant field
deriving RpcEncoding
structure FooGeneric (α : Type) where
a : α
deriving RpcEncoding
inductive FooInductive (α : Type) where
| a : α → Bar → FooInductive α
| b : (n : Nat) → (a : α) → Nat → FooInductive α
deriving RpcEncoding