Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Dict a b = a -> Maybe b
- empty :: Dict a b
- empty _ = Nothing
- add :: (Eq a) => Dict a b -> a -> b -> Dict a b
- add dict key value = \key' -> if key' == key then Just value else dict key'
- find :: Dict a b -> a -> Maybe b
- find dict key = dict key
Advertisement
Add Comment
Please, Sign In to add comment