Skip to content

Commit

Permalink
deriving は def に対しても使える
Browse files Browse the repository at this point in the history
Fixes #515
  • Loading branch information
Seasawher committed Sep 29, 2024
1 parent 39315f0 commit 02bd8ab
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Examples/Declarative/Deriving.lean
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ deriving instance Repr for Color
-- `eval` できるようになった
#eval Color.red

/- 対象の型の直後であれば、省略して `deriving C` だけ書けば十分です。また複数の型クラスに対してインスタンスを生成するには、クラス名をカンマで続けます。-/
/- ## 利用できる構文
対象の型の直後であれば、省略して `deriving C` だけ書けば十分です。-/

def StrList := List String deriving Inhabited

#check (default : StrList)

/- また複数の型クラスに対してインスタンスを生成するには、クラス名をカンマで続けます。 -/

structure People where
name : String
Expand Down

0 comments on commit 02bd8ab

Please sign in to comment.