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 HashMap where | |
import Prelude hiding (lookup) | |
-- | HashMap backed by a binary tree. Most operations are O(log(n)) | |
data HashMap k v = EmptyMap | Map (k, v) (HashMap k v) (HashMap k v) deriving (Read, Show) | |
-- | Apply fmap over all values | |
instance (Ord k) => Functor (HashMap k) where |
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
# 6.00 Problem Set 3 | |
# | |
# Hangman game | |
# | |
# ----------------------------------- | |
# Helper code | |
# You don't need to understand this helper code, | |
# but you will have to know how to use the functions | |
# (so be sure to read the docstrings!) |