/
Lens.hs
27 lines (25 loc) · 883 Bytes
/
Lens.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LiberalTypeSynonyms #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.HashMap.Lens
-- Copyright : (C) 2012 Edward Kmett
-- License : BSD-style (see the file LICENSE)
-- Maintainer : Edward Kmett <ekmett@gmail.com>
-- Stability : provisional
-- Portability : Rank2Types
--
----------------------------------------------------------------------------
module Data.HashMap.Lens
( traverseMap
) where
import Control.Lens.Indexed
import Control.Lens.IndexedTraversal
import Data.HashMap.Lazy as HashMap
-- | Traversal of a 'HashMap' indexed by the key.
--
-- @'traverseMap' = 'index' 'traverseWithKey'@
traverseMap :: IndexedTraversal k (HashMap k v) (HashMap k v') v v'
traverseMap = index traverseWithKey
{-# INLINE traverseMap #-}