Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | Trustworthy |
- class Profunctor p => Bizarre p w | w -> p where
- bazaar :: Applicative f => p a (f b) -> w a b t -> f t
- newtype Bazaar p a b t = Bazaar {
- runBazaar :: forall f. Applicative f => p a (f b) -> f t
- type Bazaar' p a = Bazaar p a a
- newtype BazaarT p g a b t = BazaarT {
- runBazaarT :: forall f. Applicative f => p a (f b) -> f t
- type BazaarT' p g a = BazaarT p g a a
Documentation
class Profunctor p => Bizarre p w | w -> p whereSource
This class is used to run the various Bazaar
variants used in this
library.
Profunctor p => Bizarre p (Bazaar p) | |
Profunctor p => Bizarre p (BazaarT p g) | |
Corepresentable p => Bizarre p (TakingWhile p g) | |
Bizarre (Indexed Int) Mafic | |
Bizarre (Indexed i) (Molten i) |
This is used to characterize a Traversal
.
a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList
.
http://twanvl.nl/blog/haskell/non-regular1
A Bazaar
is like a Traversal
that has already been applied to some structure.
Where a
holds an Context
a b ta
and a function from b
to
t
, a
holds Bazaar
a b tN
a
s and a function from N
b
s to t
, (where N
might be infinite).
Mnemonically, a Bazaar
holds many stores and you can easily add more.
This is a final encoding of Bazaar
.
Corepresentable p => Sellable p (Bazaar p) | |
Profunctor p => Bizarre p (Bazaar p) | |
Conjoined p => IndexedComonad (Bazaar p) | |
IndexedFunctor (Bazaar p) | |
Functor (Bazaar p a b) | |
Applicative (Bazaar p a b) | |
(~ * a b, Conjoined p) => Comonad (Bazaar p a b) | |
(~ * a b, Conjoined p) => ComonadApply (Bazaar p a b) | |
Apply (Bazaar p a b) |
newtype BazaarT p g a b t Source
BazaarT
is like Bazaar
, except that it provides a questionable Contravariant
instance
To protect this instance it relies on the soundness of another Contravariant
type, and usage conventions.
For example. This lets us write a suitably polymorphic and lazy taking
, but there
must be a better way!
BazaarT | |
|
Corepresentable p => Sellable p (BazaarT p g) | |
Profunctor p => Bizarre p (BazaarT p g) | |
Conjoined p => IndexedComonad (BazaarT p g) | |
IndexedFunctor (BazaarT p g) | |
Functor (BazaarT p g a b) | |
Applicative (BazaarT p g a b) | |
(~ * a b, Conjoined p) => Comonad (BazaarT p g a b) | |
(~ * a b, Conjoined p) => ComonadApply (BazaarT p g a b) | |
(Profunctor p, Contravariant g) => Contravariant (BazaarT p g a b) | |
Apply (BazaarT p g a b) |