Agda-2.6.0.1: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Utils.Tuple

Contents

- Triple (stolen from Data.Tuple.HT)

Synopsis

- (-*-) :: (a -> c) -> (b -> d) -> (a, b) -> (c, d)
- mapFst :: (a -> c) -> (a, b) -> (c, b)
- mapSnd :: (b -> d) -> (a, b) -> (a, d)
- (/\) :: (a -> b) -> (a -> c) -> a -> (b, c)
- swap :: (a, b) -> (b, a)
- fst3 :: (a, b, c) -> a
- snd3 :: (a, b, c) -> b
- thd3 :: (a, b, c) -> c
- uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d
- uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
- mapPairM :: Applicative m => (a -> m c) -> (b -> m d) -> (a, b) -> m (c, d)
- mapFstM :: Applicative m => (a -> m c) -> (a, b) -> m (c, b)
- mapSndM :: Applicative m => (b -> m d) -> (a, b) -> m (a, d)
- newtype List2 a = List2 {
  - list2 :: (a, a)
  }

# Documentation

(-*-) :: (a -> c) -> (b -> d) -> (a, b) -> (c, d) infix 2 Source #

Bifunctoriality for pairs.

mapFst :: (a -> c) -> (a, b) -> (c, b) Source #

    mapFst f = f -*- id

mapSnd :: (b -> d) -> (a, b) -> (a, d) Source #

    mapSnd g = id -*- g

(/\) :: (a -> b) -> (a -> c) -> a -> (b, c) infix 3 Source #

Lifted pairing.

swap :: (a, b) -> (b, a) Source #

Swap. (Only in Data.Tuple from base-4.3)

# Triple (stolen from Data.Tuple.HT)

fst3 :: (a, b, c) -> a Source #

snd3 :: (a, b, c) -> b Source #

thd3 :: (a, b, c) -> c Source #

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e Source #

mapPairM :: Applicative m => (a -> m c) -> (b -> m d) -> (a, b) -> m (c, d) Source #

Monadic version of `-*-`.

mapFstM :: Applicative m => (a -> m c) -> (a, b) -> m (c, b) Source #

Monadic `mapFst`.

mapSndM :: Applicative m => (b -> m d) -> (a, b) -> m (a, d) Source #

Monadic `mapSnd`.

newtype List2 a Source #

Constructors

List2 |

Fields

- list2 :: (a, a)

Instances

Functor List2 Source # |
Instance details Defined in Agda.Utils.Tuple Methods fmap :: (a -> b) -> List2 a -> List2 b Source # (<$) :: a -> List2 b -> List2 a Source #
Applicative List2 Source # |
Instance details Defined in Agda.Utils.Tuple Methods pure :: a -> List2 a Source # (<*>) :: List2 (a -> b) -> List2 a -> List2 b Source # liftA2 :: (a -> b -> c) -> List2 a -> List2 b -> List2 c Source # (*>) :: List2 a -> List2 b -> List2 b Source # (<*) :: List2 a -> List2 b -> List2 a Source #
Foldable List2 Source # |

Instance details

Defined in Agda.Utils.Tuple

Methods

fold :: Monoid m => List2 m -> m Source #

foldMap :: Monoid m => (a -> m) -> List2 a -> m Source #

foldr :: (a -> b -> b) -> b -> List2 a -> b Source #

foldr' :: (a -> b -> b) -> b -> List2 a -> b Source #

foldl :: (b -> a -> b) -> b -> List2 a -> b Source #

foldl' :: (b -> a -> b) -> b -> List2 a -> b Source #

foldr1 :: (a -> a -> a) -> List2 a -> a Source #

foldl1 :: (a -> a -> a) -> List2 a -> a Source #

toList :: List2 a -> [a] Source #

null :: List2 a -> Bool Source #

length :: List2 a -> Int Source #

elem :: Eq a => a -> List2 a -> Bool Source #

maximum :: Ord a => List2 a -> a Source #

minimum :: Ord a => List2 a -> a Source #

sum :: Num a => List2 a -> a Source #

product :: Num a => List2 a -> a Source #

Traversable List2 Source # |
Instance details Defined in Agda.Utils.Tuple Methods traverse :: Applicative f => (a -> f b) -> List2 a -> f (List2 b) Source # sequenceA :: Applicative f => List2 (f a) -> f (List2 a) Source # mapM :: Monad m => (a -> m b) -> List2 a -> m (List2 b) Source # sequence :: Monad m => List2 (m a) -> m (List2 a) Source #
Eq a => Eq (List2 a) Source # |
Instance details Defined in Agda.Utils.Tuple Methods (==) :: List2 a -> List2 a -> Bool Source # (/=) :: List2 a -> List2 a -> Bool Source #