hgeometry-combinatorial
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2021

HGeometry.Ord.Dynamic

Description

 
Synopsis

Documentation

newtype O s a Source #

Values of type 'a' in our dynamically constructed Ord instance

Constructors

O 

Fields

Instances

Instances details
Show a => Show (O s a) Source # 
Instance details

Defined in HGeometry.Ord.Dynamic

Methods

showsPrec :: Int -> O s a -> ShowS #

show :: O s a -> String #

showList :: [O s a] -> ShowS #

Reifies s (OrdDict a) => Eq (O s a) Source # 
Instance details

Defined in HGeometry.Ord.Dynamic

Methods

(==) :: O s a -> O s a -> Bool #

(/=) :: O s a -> O s a -> Bool #

(Eq (O s a), Reifies s (OrdDict a)) => Ord (O s a) Source # 
Instance details

Defined in HGeometry.Ord.Dynamic

Methods

compare :: O s a -> O s a -> Ordering #

(<) :: O s a -> O s a -> Bool #

(<=) :: O s a -> O s a -> Bool #

(>) :: O s a -> O s a -> Bool #

(>=) :: O s a -> O s a -> Bool #

max :: O s a -> O s a -> O s a #

min :: O s a -> O s a -> O s a #

newtype OrdDict a Source #

An Ord Dictionary

Constructors

OrdDict 

Fields

withOrd :: (a -> a -> Ordering) -> (forall s. Reifies s (OrdDict a) => O s b) -> b Source #

Run a computation with a given ordering

Introducing and removing the dynamic order type

extractOrd1 :: f (O s a) -> O s (f a) Source #

Lifts a container f whose values (of type a) depend on 's' into a more general computation in that produces a 'f a' (depending on s).

running time: \(O(1)\)

introOrd1 :: f a -> f (O s a) Source #

Introduce dynamic order in a container 'f'.

running time: \(O(1)\)

liftOrd1 :: (f (O s a) -> g (O s a)) -> f a -> O s (g a) Source #

Lifts a function that works on a container 'f' of orderable-things into one that works on dynamically ordered ones.

extractOrd2 :: forall {k1} f s k2 (v :: k1). f (O s k2) v -> O s (f k2 v) Source #

Lifts a container f whose keys (of type k) depend on 's' into a more general computation in that produces a `f k v` (depending on s).

running time: \(O(1)\)

introOrd2 :: forall {k1} f k2 (v :: k1) s. f k2 v -> f (O s k2) v Source #

Introduce dynamic order in a container 'f' that has keys of type k.

running time: \(O(1)\)