hgeometry-combinatorial-0.12.0.1: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.DynamicOrd

Description

 
Synopsis

Documentation

newtype O (s :: *) (a :: *) Source #

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

Constructors

O 

Fields

Instances

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

Defined in Data.DynamicOrd

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 Data.DynamicOrd

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 #

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

Defined in Data.DynamicOrd

Methods

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

show :: O s a -> String #

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

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 :: f (O s k) v -> O s (f k 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 :: f k v -> f (O s k) v Source #

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

running time: \(O(1)\)