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
{- | |
Simple version of set data structure. | |
Inspired by CSE130 sp18 final. | |
-} | |
data Set a = Set (a -> Bool) | |
showSet :: (Show a) => Set a -> String | |
showSet _ = "Actually you can't show this because it you will never know what contains here" |
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
def diff(fst, sct): | |
sub = [key: sct[key] for key in set(sct) - set(fst)] | |
add = [key: sct[key] for key in set(fst) - set(scd)] | |
print("+:{} \n -:{}".format(add, sub)) | |
return add, sub |