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

Safe HaskellSafe
LanguageHaskell98

Data.Parameterized.Pair

Description

nDescription : A 2-tuple with identically parameterized elements Copyright : (c) Galois, Inc 2017-2019

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 (Pair a :: (k -> Type) -> Type) Source # 
Instance details

Defined in Data.Parameterized.Pair

Methods

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

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

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

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

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

toListF :: (forall (tp :: k0). 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 :: k0). 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 #

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

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 :: 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.