blob: dc01b17f710642dcd44629567c79963a05cb82f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
module Utils.Dict
( mapValues
) where
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)
|