【Lean4】inductive

inductive

自分で型を作ることができる

Plaintext
inductive Color where
  | red
  | green
  | blue
  
def colorName (c : Color) : String :=
  match c with
  | Color.red => "red"
  | Color.green => "green"
  | Color.blue => "blue"

Lean4の関連記事

タイトルとURLをコピーしました