mirror of
https://github.com/github/semantic.git
synced 2025-01-03 21:16:12 +03:00
Define a singleton constructor for monoidal maps.
This commit is contained in:
parent
85acb4367a
commit
4a2c2c098d
@ -3,6 +3,7 @@
|
||||
module Data.Map.Monoidal
|
||||
( Map
|
||||
, lookup
|
||||
, singleton
|
||||
, size
|
||||
, insert
|
||||
, filterWithKey
|
||||
@ -22,6 +23,10 @@ unMap :: Map key value -> Map.Map key value
|
||||
unMap (Map map) = map
|
||||
|
||||
|
||||
singleton :: key -> value -> Map key value
|
||||
singleton k v = Map (Map.singleton k v)
|
||||
|
||||
|
||||
lookup :: Ord key => key -> Map key value -> Maybe value
|
||||
lookup key = Map.lookup key . unMap
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user