----------------------------------------------------------------------------- -- | -- Module : Data.Tuple -- Copyright : (c) 2020-2021 EMQ Technologies Co., Ltd. -- License : BSD-style (see the LICENSE file) -- -- Maintainer : Feng Lee, feng@emqx.io -- Yang M, yangm@emqx.io -- Stability : experimental -- Portability : portable -- -- The Tuple dataType. -- ----------------------------------------------------------------------------- module Data.Tuple where fst :: forall a b. (a, b) -> a fst (a, _) = a snd :: forall a b. (a, b) -> b snd (_, b) = b swap :: forall a b. (a, b) -> (b, a) swap (a, b) = (b, a) curry :: forall a b c. ((a, b) -> c) -> a -> b -> c curry f x y = f (x, y) uncurry :: forall a b c. (a -> b -> c) -> ((a, b) -> c) uncurry f (a, b) = f a b