Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | GHC2021 |
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) -> g (O s a)) -> f a -> O s (g a)
- extractOrd2 :: forall {k1} f s k2 (v :: k1). f (O s k2) v -> O s (f k2 v)
- introOrd2 :: forall {k1} f k2 (v :: k1) s. f k2 v -> f (O s k2) v
Documentation
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) -> 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)\)