Skip to content

Instantly share code, notes, and snippets.

@evancz
Last active December 24, 2015 19:28
Show Gist options
  • Save evancz/6850278 to your computer and use it in GitHub Desktop.
Save evancz/6850278 to your computer and use it in GitHub Desktop.
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 = ...
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 = ...
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