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

Copyright(c) Galois Inc 2017
Safe HaskellSafe
LanguageHaskell98

Data.Parameterized.Pair

Description

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

Synopsis

Documentation

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

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

Constructors

Pair :: !(a tp) -> !(b tp) -> Pair a b 

Instances

FoldableF k (Pair k a) Source # 

Methods

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

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

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

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

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

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

FunctorF k (Pair k a) Source # 

Methods

fmapF :: (forall (x :: Pair k a). f x -> g x) -> m f -> m g Source #

(TestEquality k a, EqF k b) => Eq (Pair k a b) Source # 

Methods

(==) :: Pair k a b -> Pair k a b -> Bool #

(/=) :: Pair k a b -> Pair k a b -> Bool #

IsBinTree (MapF k1 k2 a) (Pair k1 k2 a) Source # 

Methods

asBin :: MapF k1 k2 a -> TreeApp (Pair k1 k2 a) (MapF k1 k2 a) Source #

tip :: MapF k1 k2 a Source #

bin :: Pair k1 k2 a -> MapF k1 k2 a -> MapF k1 k2 a -> MapF k1 k2 a Source #

size :: MapF k1 k2 a -> Int Source #

fstPair :: Pair a b -> Some a Source #

Extract the first element of a pair.

sndPair :: Pair a b -> Some b Source #

Extract the second element of a pair.

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

Project out of Pair.