hydra-kernel-0.17.6: src/main/haskell/Hydra/Overlay/Haskell/Lib/Pairs.hs
-- | Haskell implementations of hydra.lib.pairs primitives
module Hydra.Overlay.Haskell.Lib.Pairs where
import qualified Data.Bifunctor as BF
-- | Map over both elements of a pair.
bimap :: (a -> c) -> (b -> d) -> (a, b) -> (c, d)
bimap = BF.bimap
-- | Get the first element of a pair.
first :: (a, b) -> a
first (x, _) = x
-- | Construct a pair from two values.
pair :: a -> b -> (a, b)
pair x y = (x, y)
-- | Get the second element of a pair.
second :: (a, b) -> b
second (_, y) = y