Skip to content
This repository has been archived by the owner on Jan 5, 2025. It is now read-only.

Commit

Permalink
Merge pull request #16 from lean-ja/feature/improve_bintree_functor
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher authored Mar 16, 2024
2 parents f3f67ca + be0be8d commit 740cefe
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def mapBinTree (f: α → β) : BinTree α → BinTree β
| BinTree.branch l x r => BinTree.branch (mapBinTree f l) (f x) (mapBinTree f r)

instance : Functor BinTree where
map f b := mapBinTree f b
map := mapBinTree

#eval (· + 100) <$> (BinTree.branch (BinTree.branch BinTree.leaf 1 BinTree.leaf) 2 (BinTree.branch BinTree.leaf 3 BinTree.leaf))

0 comments on commit 740cefe

Please sign in to comment.