1
1
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:
Rob Rix 2018-05-11 16:08:44 -04:00
parent 85acb4367a
commit 4a2c2c098d

View File

@ -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