parameterized-utils-2.1.11.0: Classes and data structures for working with data-kind indexed types

Copyright | (c) Galois Inc 2017-2019
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.Parameterized.Pair

Description

This module defines a 2-tuple where both elements are parameterized over the same existentially quantified parameter.

Synopsis

- data Pair (a :: k -> Type) (b :: k -> Type) where
  - Pair :: forall {k} (a :: k -> Type) (tp :: k) (b :: k -> Type). !(a tp) -> !(b tp) -> Pair a b
- fstPair :: forall {k} (a :: k -> Type) (b :: k -> Type). Pair a b -> Some a
- sndPair :: forall {k} (a :: k -> Type) (b :: k -> Type). Pair a b -> Some b
- viewPair :: (forall (tp :: k). a tp -> b tp -> c) -> Pair a b -> c

# Documentation

data Pair (a :: k -> Type) (b :: k -> Type) where Source #

Like a 2-tuple, but with an existentially quantified parameter that both of the elements share.

Constructors

Pair :: forall {k} (a :: k -> Type) (tp :: k) (b :: k -> Type). !(a tp) -> !(b tp) -> Pair a b |

#### Instances

Instances details

FoldableF (Pair a :: (k -> Type) -> Type) Source # |

Instance details

Defined in Data.Parameterized.Pair

Methods

foldMapF :: Monoid m => (forall (s :: k). e s -> m) -> Pair a e -> m Source #

foldrF :: (forall (s :: k). e s -> b -> b) -> b -> Pair a e -> b Source #

foldlF :: (forall (s :: k). b -> e s -> b) -> b -> Pair a e -> b Source #

foldrF' :: (forall (s :: k). e s -> b -> b) -> b -> Pair a e -> b Source #

foldlF' :: (forall (s :: k). b -> e s -> b) -> b -> Pair a e -> b Source #

toListF :: (forall (tp :: k). f tp -> a0) -> Pair a f -> [a0] Source #

FunctorF (Pair a :: (k -> Type) -> Type) Source # |
Instance details Defined in Data.Parameterized.Pair Methods fmapF :: (forall (x :: k). f x -> g x) -> Pair a f -> Pair a g Source #
(TestEquality a, EqF b) => Eq (Pair a b) Source # |
Instance details Defined in Data.Parameterized.Pair Methods (==) :: Pair a b -> Pair a b -> Bool Source # (/=) :: Pair a b -> Pair a b -> Bool Source #
IsBinTree (MapF k2 a) (Pair k2 a) Source # |
Instance details Defined in Data.Parameterized.Map Methods asBin :: MapF k2 a -> TreeApp (Pair k2 a) (MapF k2 a) Source # tip :: MapF k2 a Source # bin :: Pair k2 a -> MapF k2 a -> MapF k2 a -> MapF k2 a Source # size :: MapF k2 a -> Int Source #

fstPair :: forall {k} (a :: k -> Type) (b :: k -> Type). Pair a b -> Some a Source #

Extract the first element of a pair.

sndPair :: forall {k} (a :: k -> Type) (b :: k -> Type). Pair a b -> Some b Source #

Extract the second element of a pair.

viewPair :: (forall (tp :: k). a tp -> b tp -> c) -> Pair a b -> c Source #

Project out of Pair.