aboutsummaryrefslogtreecommitdiff
path: root/src/client/elm/Utils/Tuple.elm
blob: d9246f6dd684a6bfb19010b30ae732194d5c4a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Utils.Tuple
  ( mapFst
  , mapSnd
  , mapBoth
  ) where

mapFst : (a -> x) -> (a, b) -> (x, b)
mapFst f (a, b) = (f a, b)

mapSnd : (b -> x) -> (a, b) -> (a, x)
mapSnd f (a, b) = (a, f b)

mapBoth : (a -> x) -> (b -> y) -> (a, b) -> (x, y)
mapBoth f g (a, b) = (f a, g b)