-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36faf3a
commit 82a91a6
Showing
2 changed files
with
9 additions
and
13 deletions.
There are no files selected for viewing
12 changes: 5 additions & 7 deletions
12
catculator-core/src/main/scala/pl/writeonly/catculator/core/adt/tree/BinaryTree.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
package pl.writeonly.catculator.core.adt.tree | ||
|
||
object BinaryTree { | ||
|
||
case class Leaf[A](leaf: A) extends BinaryTree[A] | ||
enum BinaryTree[+A]: | ||
case Leaf(leaf: A) | ||
case Node(first: BinaryTree[A], follow: BinaryTree[A]) | ||
|
||
case class Node[A](first: BinaryTree[A], follow: BinaryTree[A]) | ||
extends BinaryTree[A] | ||
object BinaryTree { | ||
} | ||
|
||
sealed trait BinaryTree[+A] | ||
q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters