Created
October 7, 2014 20:33
-
-
Save ulfbert-inc/b43ada99c05043196b01 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
object funsets { | |
type Set = Int => Boolean | |
def contains(s: Set, elem: Int): Boolean = s(elem) | |
//> contains: (s: Int => Boolean, elem: Int)Boolean | |
def singletonSet(elem: Int): Set = Set(elem) //> singletonSet: (elem: Int)Int => Boolean | |
def union(s: Set, t: Set): Set = i => s(i) || t(i) | |
//> union: (s: Int => Boolean, t: Int => Boolean)Int => Boolean | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment