Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype O (s :: *) (a :: *) = O {
- runO :: a
- newtype OrdDict a = OrdDict {}
- withOrd :: (a -> a -> Ordering) -> (forall s. Reifies s (OrdDict a) => O s b) -> b
- extractOrd1 :: f (O s a) -> O s (f a)
- introOrd1 :: f a -> f (O s a)
- liftOrd1 :: (f (O s a) -> f (O s a)) -> f a -> O s (f a)
- extractOrd2 :: f (O s k) v -> O s (f k v)
- introOrd2 :: f k v -> f (O s k) v
Documentation
newtype O (s :: *) (a :: *) Source #
Values of type a
in our dynamically constructed Ord
instance
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) -> f (O s a)) -> f a -> O s (f 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)\)