Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Extensions |
|
Internal module, contains implementation of type aligned real time queues (C.Okasaki 'Purely Functional Data Structures').
Synopsis
- newtype Op (f :: k -> k -> *) (a :: k) (b :: k) = Op {
- runOp :: f b a
- data ListTr :: (k -> k -> *) -> k -> k -> * where
- data Queue (f :: k -> k -> *) (a :: k) (b :: k) where
- emptyQ :: Queue (f :: k -> k -> *) a a
- cons :: forall (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c
- uncons :: Queue f a b -> ViewL f a b
- snoc :: forall (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c
- foldQ :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b -> c a b
- zipWithQ :: forall f g a b a' b'. Arrow f => (forall x y x' y'. f x y -> f x' y' -> f (g x x') (g y y')) -> Queue f a b -> Queue f a' b' -> Queue f (g a a') (g b b')
Documentation
newtype Op (f :: k -> k -> *) (a :: k) (b :: k) Source #
Oposite categoy in which arrows from a
to b
are represented by arrows
from b
to a
in the original category.
data ListTr :: (k -> k -> *) -> k -> k -> * where Source #
Free category encoded as a recursive data type, in a simlar way as
. You can use Free
class instance:FreeAlgebra2
liftFree2 @Cat :: f a b -> Cat f ab
foldNatFree2 @Cat :: Category d => (forall x y. f x y -> d x y) -> Cat f a b -> d a b
The same performance concerns that apply to
apply to this encoding of a free category.Free
Instances
data Queue (f :: k -> k -> *) (a :: k) (b :: k) where Source #