generated from ByronBecker/motoko-library-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from canscale/extract-types
Extract BTree types into Types.mo to avoid cyclic dependencies
- Loading branch information
Showing
4 changed files
with
48 additions
and
39 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
module { | ||
public type Node<K, V> = { | ||
#leaf: Leaf<K, V>; | ||
#internal: Internal<K, V>; | ||
}; | ||
|
||
public type Data<K, V> = { | ||
kvs: [var ?(K, V)]; | ||
var count: Nat; | ||
}; | ||
|
||
public type Internal<K, V> = { | ||
data: Data<K, V>; | ||
children: [var ?Node<K, V>] | ||
}; | ||
|
||
public type Leaf<K, V> = { | ||
data: Data<K, V>; | ||
}; | ||
|
||
public type BTree<K, V> = { | ||
var root: Node<K, V>; | ||
order: Nat; | ||
}; | ||
} |
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