Skip to content

Commit

Permalink
Missing Data.Map file / implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
spockz committed Jan 5, 2012
1 parent 1db0892 commit f12f281
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions resources/static/hjs/Data/Map.hs
@@ -0,0 +1,16 @@
module Data.Map where

type Map k v = [(k,v)]

empty :: Map k v
empty = []

lookup :: Eq k => k -> Map k v -> Maybe v
lookup _ [] = Nothing
lookup k ((k', v):xs) | k == k' = Just v
| otherwise = lookup k xs

insert :: k -> v -> Map k v -> Map k v
insert k v = (:) (k,v)

assocs = id

0 comments on commit f12f281

Please sign in to comment.