Last active
December 24, 2015 19:28
-
-
Save evancz/6850278 to your computer and use it in GitHub Desktop.
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
module IntSet (empty,singleton,insert) where | |
data IntSet = Empty | Node Int IntSet IntSet | |
empty : IntSet | |
empty = Empty | |
singleton : Int -> IntSet | |
singleton x = Node x Empty Empty | |
insert : Int -> IntSet -> IntSet | |
insert x set = ... | |
rebalance : IntSet -> IntSet | |
rebalance = ... |
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
module IntSet where | |
private | |
data IntSet = Empty | Node Int IntSet IntSet | |
empty : IntSet | |
empty = Empty | |
singleton : Int -> IntSet | |
singleton x = Node x Empty Empty | |
insert : Int -> IntSet -> IntSet | |
insert x set = ... | |
private | |
rebalance : IntSet -> IntSet | |
rebalance = ... |
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
module IntSet where | |
data IntSet = _Empty | _Node Int IntSet IntSet | |
empty : IntSet | |
empty = _Empty | |
singleton : Int -> IntSet | |
singleton x = _Node x _Empty _Empty | |
insert : Int -> IntSet -> IntSet | |
insert x set = ... | |
_rebalance : IntSet -> IntSet | |
_rebalance = ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment