aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Utils/Dict.elm
blob: 7d708e2ab742a55850b40a82f03b28ba50d9c20b (plain)
1
2
3
4
5
6
7
8
9
10
11
module Utils.Dict exposing
  ( mapValues
  )

import Dict as Dict exposing (..)

mapValues : (a -> b) -> Dict comparable a -> Dict comparable b
mapValues f = Dict.fromList << List.map (onSecond f) << Dict.toList

onSecond : (a -> b) -> (comparable, a) -> (comparable, b)
onSecond f tuple = case tuple of (x, y) -> (x, f y)