packages feed

pandora 0.1.4 → 0.1.5

raw patch · 26 files changed

+307/−120 lines, 26 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Pandora.Paradigm.Basis.Cofree: (:<) :: a -> (t :.: Cofree t) a -> Cofree t a
- Pandora.Paradigm.Basis.Cofree: coiterate :: Covariant t => (a -> t a) -> a -> Cofree t a
- Pandora.Paradigm.Basis.Cofree: data Cofree t a
- Pandora.Paradigm.Basis.Cofree: instance (Pandora.Pattern.Functor.Exclusive.Exclusive t, Pandora.Pattern.Functor.Alternative.Alternative t) => Pandora.Pattern.Functor.Monad.Monad (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance (Pandora.Pattern.Object.Monoid.Monoid a, forall b. Pandora.Pattern.Object.Semigroup.Semigroup b => Pandora.Pattern.Object.Monoid.Monoid (t b)) => Pandora.Pattern.Object.Monoid.Monoid (Pandora.Paradigm.Basis.Cofree.Cofree t a)
- Pandora.Paradigm.Basis.Cofree: instance (Pandora.Pattern.Object.Semigroup.Semigroup a, forall b. Pandora.Pattern.Object.Semigroup.Semigroup b => Pandora.Pattern.Object.Semigroup.Semigroup (t b)) => Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Basis.Cofree.Cofree t a)
- Pandora.Paradigm.Basis.Cofree: instance (Pandora.Pattern.Object.Setoid.Setoid a, forall b. Pandora.Pattern.Object.Setoid.Setoid b => Pandora.Pattern.Object.Setoid.Setoid (t b)) => Pandora.Pattern.Object.Setoid.Setoid (Pandora.Paradigm.Basis.Cofree.Cofree t a)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Alternative.Alternative t => Pandora.Pattern.Functor.Bindable.Bindable (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Applicative.Applicative t => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Comonad.Comonad (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Extractable.Extractable (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Exclusive.Exclusive t => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: instance Pandora.Pattern.Functor.Traversable.Traversable t => Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Basis.Cofree.Cofree t)
- Pandora.Paradigm.Basis.Cofree: section :: Comonad t => t ~> Cofree t
- Pandora.Paradigm.Basis.Cofree: unwrap :: Cofree t a -> (t :.: Cofree t) a
- Pandora.Paradigm.Basis.Free: instance Pandora.Pattern.Functor.Exclusive.Exclusive t => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Basis.Free.Free t)
- Pandora.Paradigm.Basis.Jack: instance Pandora.Pattern.Functor.Exclusive.Exclusive t => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Basis.Jack.Jack t)
- Pandora.Paradigm.Basis.Jet: instance (forall (t1 :: * -> *). Pandora.Pattern.Functor.Exclusive.Exclusive t1) => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Jet.Jet t)
- Pandora.Paradigm.Basis.Maybe: instance Pandora.Pattern.Functor.Exclusive.Exclusive Pandora.Paradigm.Basis.Maybe.Maybe
- Pandora.Paradigm.Basis.Yoneda: instance Pandora.Pattern.Functor.Exclusive.Exclusive t => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Basis.Yoneda.Yoneda t)
- Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Exclusive.Exclusive t, Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Junction.Composition.U 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u)
- Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Exclusive.Exclusive t, Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Covariant.Covariant v) => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Junction.Composition.UU 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u v)
- Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Exclusive.Exclusive t, Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Covariant.Covariant v, Pandora.Pattern.Functor.Covariant.Covariant w) => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Junction.Composition.UUU 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u v w)
- Pandora.Paradigm.Junction.Transformer: instance (Pandora.Pattern.Functor.Covariant.Covariant (t u), Pandora.Pattern.Functor.Exclusive.Exclusive u) => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Junction.Transformer.Y t u)
- Pandora.Paradigm.Junction.Transformer: instance (Pandora.Pattern.Functor.Covariant.Covariant t, Pandora.Pattern.Functor.Exclusive.Exclusive u) => Pandora.Pattern.Functor.Exclusive.Exclusive (Pandora.Paradigm.Junction.Transformer.T t u)
- Pandora.Pattern.Functor.Exclusive: class Alternative t => Exclusive t
- Pandora.Pattern.Functor.Exclusive: exclusive :: Exclusive t => t a
+ Pandora.Paradigm.Basis.Free: instance Pandora.Pattern.Functor.Avoidable.Avoidable t => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Basis.Free.Free t)
+ Pandora.Paradigm.Basis.Jack: instance Pandora.Pattern.Functor.Avoidable.Avoidable t => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Basis.Jack.Jack t)
+ Pandora.Paradigm.Basis.Jet: infixr 5 :-
+ Pandora.Paradigm.Basis.Jet: instance (forall (t' :: * -> *). Pandora.Pattern.Functor.Avoidable.Avoidable t') => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Jet.Jet t)
+ Pandora.Paradigm.Basis.Maybe: instance Pandora.Pattern.Functor.Avoidable.Avoidable Pandora.Paradigm.Basis.Maybe.Maybe
+ Pandora.Paradigm.Basis.Product: instance Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Basis.Product.Product a)
+ Pandora.Paradigm.Basis.Proxy: Proxy :: Proxy a
+ Pandora.Paradigm.Basis.Proxy: data Proxy a
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Alternative.Alternative Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Applicative.Applicative Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Bindable.Bindable Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Contravariant.Contravariant Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Covariant.Covariant Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Distributive.Distributive Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Extendable.Extendable Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Monad.Monad Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Proxy: instance Pandora.Pattern.Functor.Pointable.Pointable Pandora.Paradigm.Basis.Proxy.Proxy
+ Pandora.Paradigm.Basis.Tagged: Tagged :: a -> Tagged tag a
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Bindable.Bindable (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Comonad.Comonad (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Distributive.Distributive (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Extractable.Extractable (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Monad.Monad (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k (tag :: k). Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Basis.Tagged.Tagged tag)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Chain.Chain a => Pandora.Pattern.Object.Chain.Chain (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Group.Group a => Pandora.Pattern.Object.Group.Group (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Lattice.Lattice a => Pandora.Pattern.Object.Lattice.Lattice (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Monoid.Monoid a => Pandora.Pattern.Object.Monoid.Monoid (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Ringoid.Ringoid a => Pandora.Pattern.Object.Ringoid.Ringoid (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Semigroup.Semigroup a => Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Semilattice.Infimum a => Pandora.Pattern.Object.Semilattice.Infimum (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Semilattice.Supremum a => Pandora.Pattern.Object.Semilattice.Supremum (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: instance forall k a (tag :: k). Pandora.Pattern.Object.Setoid.Setoid a => Pandora.Pattern.Object.Setoid.Setoid (Pandora.Paradigm.Basis.Tagged.Tagged tag a)
+ Pandora.Paradigm.Basis.Tagged: newtype Tagged tag a
+ Pandora.Paradigm.Basis.Tagged: retag :: Tagged old a -> Tagged new a
+ Pandora.Paradigm.Basis.Tagged: tagself :: a -> Tagged a a
+ Pandora.Paradigm.Basis.Tagged: untag :: Tagged tag a -> a
+ Pandora.Paradigm.Basis.Twister: (:<) :: a -> (t :.: Twister t) a -> Twister t a
+ Pandora.Paradigm.Basis.Twister: coiterate :: Covariant t => (a -> t a) -> a -> Twister t a
+ Pandora.Paradigm.Basis.Twister: data Twister t a
+ Pandora.Paradigm.Basis.Twister: infixr 5 :<
+ Pandora.Paradigm.Basis.Twister: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Alternative.Alternative t) => Pandora.Pattern.Functor.Monad.Monad (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance (Pandora.Pattern.Object.Monoid.Monoid a, forall b. Pandora.Pattern.Object.Semigroup.Semigroup b => Pandora.Pattern.Object.Monoid.Monoid (t b)) => Pandora.Pattern.Object.Monoid.Monoid (Pandora.Paradigm.Basis.Twister.Twister t a)
+ Pandora.Paradigm.Basis.Twister: instance (Pandora.Pattern.Object.Semigroup.Semigroup a, forall b. Pandora.Pattern.Object.Semigroup.Semigroup b => Pandora.Pattern.Object.Semigroup.Semigroup (t b)) => Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Basis.Twister.Twister t a)
+ Pandora.Paradigm.Basis.Twister: instance (Pandora.Pattern.Object.Setoid.Setoid a, forall b. Pandora.Pattern.Object.Setoid.Setoid b => Pandora.Pattern.Object.Setoid.Setoid (t b)) => Pandora.Pattern.Object.Setoid.Setoid (Pandora.Paradigm.Basis.Twister.Twister t a)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Alternative.Alternative t => Pandora.Pattern.Functor.Bindable.Bindable (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Applicative.Applicative t => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Avoidable.Avoidable t => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Comonad.Comonad (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Extractable.Extractable (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: instance Pandora.Pattern.Functor.Traversable.Traversable t => Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Basis.Twister.Twister t)
+ Pandora.Paradigm.Basis.Twister: section :: Comonad t => t ~> Twister t
+ Pandora.Paradigm.Basis.Twister: unwrap :: Twister t a -> (t :.: Twister t) a
+ Pandora.Paradigm.Basis.Validation: Flaws :: e -> Validation e a
+ Pandora.Paradigm.Basis.Validation: Validated :: a -> Validation e a
+ Pandora.Paradigm.Basis.Validation: data Validation e a
+ Pandora.Paradigm.Basis.Validation: instance Pandora.Pattern.Functor.Alternative.Alternative (Pandora.Paradigm.Basis.Validation.Validation e)
+ Pandora.Paradigm.Basis.Validation: instance Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Basis.Validation.Validation e)
+ Pandora.Paradigm.Basis.Validation: instance Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Basis.Validation.Validation e)
+ Pandora.Paradigm.Basis.Validation: instance Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Basis.Validation.Validation e)
+ Pandora.Paradigm.Basis.Validation: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Basis.Validation.Validation e)
+ Pandora.Paradigm.Basis.Yoneda: instance Pandora.Pattern.Functor.Avoidable.Avoidable t => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Basis.Yoneda.Yoneda t)
+ Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Junction.Composition.U 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u)
+ Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Covariant.Covariant v) => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Junction.Composition.UU 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u v)
+ Pandora.Paradigm.Junction.Composition: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Covariant.Covariant v, Pandora.Pattern.Functor.Covariant.Covariant w) => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Junction.Composition.UUU 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co 'Pandora.Core.Functor.Co t u v w)
+ Pandora.Paradigm.Junction.Transformer: instance (Pandora.Pattern.Functor.Covariant.Covariant (t u), Pandora.Pattern.Functor.Avoidable.Avoidable u) => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Junction.Transformer.Y t u)
+ Pandora.Paradigm.Junction.Transformer: instance (Pandora.Pattern.Functor.Covariant.Covariant t, Pandora.Pattern.Functor.Avoidable.Avoidable u) => Pandora.Pattern.Functor.Avoidable.Avoidable (Pandora.Paradigm.Junction.Transformer.T t u)
+ Pandora.Pattern.Functor.Avoidable: class Alternative t => Avoidable t
+ Pandora.Pattern.Functor.Avoidable: idle :: Avoidable t => t a
+ Pandora.Pattern.Functor.Contravariant: (>&<) :: Contravariant t => t b -> (a -> b) -> t a
+ Pandora.Pattern.Functor.Covariant: (<&>) :: Covariant t => t a -> (a -> b) -> t b
- Pandora.Paradigm.Inventory.Stateful: find :: (Pointable u, Exclusive u, Alternative u, Traversable t) => Predicate a -> t a -> u a
+ Pandora.Paradigm.Inventory.Stateful: find :: (Pointable u, Avoidable u, Alternative u, Traversable t) => Predicate a -> t a -> u a
- Pandora.Paradigm.Structure.Binary: type Binary = Cofree Wye
+ Pandora.Paradigm.Structure.Binary: type Binary = Twister Wye
- Pandora.Paradigm.Structure.Graph: type Graph a = (Cofree :>: Edges) a
+ Pandora.Paradigm.Structure.Graph: type Graph a = (Twister :>: Edges) a
- Pandora.Paradigm.Structure.Stack: type Stack = (Cofree :>: Maybe)
+ Pandora.Paradigm.Structure.Stack: type Stack = (Twister :>: Maybe)

Files

CHANGELOG.md view
@@ -39,3 +39,13 @@ * Define infix versions of `contramap` with various nesting levels * Rename `Product` constructor from `:*` to `:*:` * Define `Has` and `Injective` type families for `Product` proofs++# 0.1.5+* Add `<&>` and `>&<` methods for `Covariant` and `Contravariant` functors accordingly+* Define `Traversable` instance for `Product` datatype+* Rename `Cofree` to `Twister` datatype (we will use the first name later)+* Define fixity for `Jet`'s and `Twister`'s constructors+* Rename `Exclusive` to `Avoidable` typeclass and `exclusive` to `idle` method+* Define `Tagged` datatype for attaching type information to the value+* Define `Proxy` datatype for holding no data, but having a phantom parameter+* Define `Validation` datatype (similar to `Conclusion`, but can collect errors)
Pandora/Paradigm/Basis.hs view
@@ -1,12 +1,13 @@ module Pandora.Paradigm.Basis (module Exports, note, hush) where -import Pandora.Paradigm.Basis.Cofree as Exports+import Pandora.Paradigm.Basis.Twister as Exports import Pandora.Paradigm.Basis.Free as Exports import Pandora.Paradigm.Basis.Fix as Exports import Pandora.Paradigm.Basis.Yoneda as Exports import Pandora.Paradigm.Basis.Continuation as Exports import Pandora.Paradigm.Basis.Predicate as Exports import Pandora.Paradigm.Basis.Variation as Exports+import Pandora.Paradigm.Basis.Validation as Exports import Pandora.Paradigm.Basis.Wye as Exports import Pandora.Paradigm.Basis.Edges as Exports import Pandora.Paradigm.Basis.Conclusion as Exports@@ -14,6 +15,8 @@ import Pandora.Paradigm.Basis.Endo as Exports import Pandora.Paradigm.Basis.Jet as Exports import Pandora.Paradigm.Basis.Jack as Exports+import Pandora.Paradigm.Basis.Proxy as Exports+import Pandora.Paradigm.Basis.Tagged as Exports import Pandora.Paradigm.Basis.Product as Exports import Pandora.Paradigm.Basis.Constant as Exports import Pandora.Paradigm.Basis.Identity as Exports
− Pandora/Paradigm/Basis/Cofree.hs
@@ -1,64 +0,0 @@-module Pandora.Paradigm.Basis.Cofree (Cofree (..), unwrap, coiterate, section) where--import Pandora.Core.Functor (type (:.:), type (~>))-import Pandora.Core.Morphism ((.))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))-import Pandora.Pattern.Functor.Pointable (Pointable (point))-import Pandora.Pattern.Functor.Extractable (Extractable (extract))-import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))-import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))-import Pandora.Pattern.Functor.Traversable (Traversable ((->>), traverse))-import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))-import Pandora.Pattern.Functor.Extendable (Extendable ((=>>), extend))-import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Pattern.Object.Setoid (Setoid ((==)), (&&))-import Pandora.Pattern.Object.Semigroup (Semigroup ((<>)))-import Pandora.Pattern.Object.Monoid (Monoid (unit))--data Cofree t a = a :< (t :.: Cofree t) a--instance Covariant t => Covariant (Cofree t) where-	f <$> (x :< xs) = f x :< ((comap . comap) f xs)--instance Exclusive t => Pointable (Cofree t) where-	point x = x :< exclusive--instance Covariant t => Extractable (Cofree t) where-	extract (x :< _) = x--instance Applicative t => Applicative (Cofree t) where-	(f :< fs) <*> (x :< xs) = f x :< ((<*>) <$> fs <*> xs)--instance Traversable t => Traversable (Cofree t) where-	(x :< xs) ->> f = (:<) <$> f x <*> (traverse . traverse) f xs--instance Alternative t => Bindable (Cofree t) where-	(x :< xs) >>= f = case f x of-		y :< ys -> y :< (ys <+> comap (>>= f) xs)--instance Covariant t => Extendable (Cofree t) where-	x =>> f = f x :< comap (extend f) (unwrap x)--instance (Exclusive t, Alternative t) => Monad (Cofree t) where--instance Covariant t => Comonad (Cofree t) where--instance (Setoid a, forall b . Setoid b => Setoid (t b)) => Setoid (Cofree t a) where-	(x :< xs) == (y :< ys) = x == y && xs == ys--instance (Semigroup a, forall b . Semigroup b => Semigroup (t b)) => Semigroup (Cofree t a) where-	(x :< xs) <> (y :< ys) = (x <> y) :< (xs <> ys)--instance (Monoid a, forall b . Semigroup b => Monoid (t b)) => Monoid (Cofree t a) where-	unit = unit :< unit--unwrap :: Cofree t a -> (t :.: Cofree t) a-unwrap (_ :< xs) = xs--coiterate :: Covariant t => (a -> t a) -> a -> Cofree t a-coiterate coalgebra x = x :< (coiterate coalgebra <$> coalgebra x)--section :: Comonad t => t ~> Cofree t-section as = extract as :< extend section as
Pandora/Paradigm/Basis/Free.hs view
@@ -3,7 +3,7 @@ import Pandora.Core.Functor (type (:.:)) import Pandora.Core.Morphism ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))@@ -24,8 +24,8 @@ 	_ <+> Pure y = Pure y 	Impure xs <+> Impure ys = Impure $ xs <+> ys -instance Exclusive t => Exclusive (Free t) where-	exclusive = Impure exclusive+instance Avoidable t => Avoidable (Free t) where+	idle = Impure idle  instance Covariant t => Applicative (Free t) where 	Pure f <*> Pure y = Pure $ f y
Pandora/Paradigm/Basis/Jack.hs view
@@ -5,7 +5,7 @@ import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Extractable (Extractable (extract)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Traversable (Traversable ((->>), traverse)) import Pandora.Pattern.Functor.Distributive (Distributive ((>>-), distribute))@@ -27,8 +27,8 @@ 	Other _ <+> It y = It y 	Other x <+> Other y = Other (x <+> y) -instance Exclusive t => Exclusive (Jack t) where-	exclusive = Other exclusive+instance Avoidable t => Avoidable (Jack t) where+	idle = Other idle  instance Extractable t => Extractable (Jack t) where 	extract (It x) = x
Pandora/Paradigm/Basis/Jet.hs view
@@ -2,22 +2,24 @@  import Pandora.Core.Morphism ((.)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)), comap)-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Extractable (Extractable (extract)) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Traversable (Traversable ((->>), traverse)) +infixr 5 :-+ data Jet t a = a :- Jet t (t a)  instance Covariant t => Covariant (Jet t) where 	f <$> a :- as = f a :- (comap . comap) f as  instance Traversable t => Traversable (Jet t) where-	a :- as ->> f = (:-) <$> f a <*> (traverse . traverse) f as+	(a :- as) ->> f = (:-) <$> f a <*> (traverse . traverse) f as -instance (forall t . Exclusive t) => Pointable (Jet t) where-	point x = x :- exclusive+instance (forall t' . Avoidable t') => Pointable (Jet t) where+	point x = x :- idle  instance Covariant t => Extractable (Jet t) where 	extract (x :- _) = x
Pandora/Paradigm/Basis/Maybe.hs view
@@ -3,7 +3,7 @@ import Pandora.Core.Morphism ((.), ($)) import Pandora.Paradigm.Junction.Transformer (T (T, t), type (:!:)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))@@ -26,8 +26,8 @@ instance Pointable Maybe where 	point = Just -instance Exclusive Maybe where-	exclusive = Nothing+instance Avoidable Maybe where+	idle = Nothing  instance Applicative Maybe where 	Just f <*> x = f <$> x
Pandora/Paradigm/Basis/Product.hs view
@@ -4,6 +4,7 @@ import Pandora.Core.Morphism (($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Functor.Adjoint (Adjoint (phi, psi))@@ -26,6 +27,9 @@  instance Extractable (Product a) where 	extract (_ :*: y) = y++instance Traversable (Product a) where+	(x :*: y) ->> f = (:*:) x <$> f y  instance Extendable (Product a) where 	(x :*: y) =>> f = (:*:) x $ f (x :*: y)
+ Pandora/Paradigm/Basis/Proxy.hs view
@@ -0,0 +1,39 @@+module Pandora.Paradigm.Basis.Proxy where++import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))+import Pandora.Pattern.Functor.Distributive (Distributive ((>>-)))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))+import Pandora.Pattern.Functor.Monad (Monad)++data Proxy a = Proxy++instance Covariant Proxy where+	_ <$> Proxy = Proxy++instance Contravariant Proxy where+	_ >$< _ = Proxy++instance Pointable Proxy where+	point _ = Proxy++instance Applicative Proxy where+	_ <*> _ = Proxy++instance Alternative Proxy where+	_ <+> _ = Proxy++instance Distributive Proxy where+	_ >>- _ = Proxy++instance Bindable Proxy where+	_ >>= _ = Proxy++instance Monad Proxy++instance Extendable Proxy where+	_ =>> _ = Proxy
+ Pandora/Paradigm/Basis/Tagged.hs view
@@ -0,0 +1,86 @@+module Pandora.Paradigm.Basis.Tagged (Tagged (..), untag, retag, tagself) where++import Pandora.Core.Morphism ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Pattern.Functor.Distributive (Distributive ((>>-)))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))+import Pandora.Pattern.Functor.Monad (Monad)+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Pattern.Object.Setoid (Setoid ((==)))+import Pandora.Pattern.Object.Chain (Chain ((<=>)))+import Pandora.Pattern.Object.Semigroup (Semigroup ((<>)))+import Pandora.Pattern.Object.Monoid (Monoid (unit))+import Pandora.Pattern.Object.Ringoid (Ringoid ((><)))+import Pandora.Pattern.Object.Semilattice (Infimum ((/\)), Supremum ((\/)))+import Pandora.Pattern.Object.Lattice (Lattice)+import Pandora.Pattern.Object.Group (Group (inverse))++newtype Tagged tag a = Tagged a++instance Covariant (Tagged tag) where+	f <$> Tagged x = Tagged $ f x++instance Pointable (Tagged tag) where+	point = Tagged++instance Extractable (Tagged tag) where+	extract (Tagged x) = x++instance Applicative (Tagged tag) where+	Tagged f <*> Tagged x = Tagged $ f x++instance Traversable (Tagged tag) where+	Tagged x ->> f = Tagged <$> f x++instance Distributive (Tagged tag) where+	x >>- f = Tagged $ extract . f <$> x++instance Bindable (Tagged tag) where+	Tagged x >>= f = f x++instance Monad (Tagged tag)++instance Extendable (Tagged tag) where+	x =>> f = Tagged . f $ x++instance Comonad (Tagged tag)++instance Setoid a => Setoid (Tagged tag a) where+	Tagged x == Tagged y = x == y++instance Chain a => Chain (Tagged tag a) where+	Tagged x <=> Tagged y = x <=> y++instance Semigroup a => Semigroup (Tagged tag a) where+	Tagged x <> Tagged y = Tagged $ x <> y++instance Monoid a => Monoid (Tagged tag a) where+	 unit = Tagged unit++instance Ringoid a => Ringoid (Tagged tag a) where+	Tagged x >< Tagged y = Tagged $ x >< y++instance Infimum a => Infimum (Tagged tag a) where+	Tagged x /\ Tagged y = Tagged $ x /\ y++instance Supremum a => Supremum (Tagged tag a) where+	Tagged x \/ Tagged y = Tagged $ x \/ y++instance Lattice a => Lattice (Tagged tag a) where++instance Group a => Group (Tagged tag a) where+	inverse (Tagged x) = Tagged $ inverse x++untag :: Tagged tag a -> a+untag (Tagged x) = x++retag :: Tagged old a -> Tagged new a+retag (Tagged x) = Tagged x++tagself :: a -> Tagged a a+tagself = Tagged
+ Pandora/Paradigm/Basis/Twister.hs view
@@ -0,0 +1,66 @@+module Pandora.Paradigm.Basis.Twister (Twister (..), unwrap, coiterate, section) where++import Pandora.Core.Functor (type (:.:), type (~>))+import Pandora.Core.Morphism ((.))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>), traverse))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>), extend))+import Pandora.Pattern.Functor.Monad (Monad)+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Pattern.Object.Setoid (Setoid ((==)), (&&))+import Pandora.Pattern.Object.Semigroup (Semigroup ((<>)))+import Pandora.Pattern.Object.Monoid (Monoid (unit))++infixr 5 :<++data Twister t a = a :< (t :.: Twister t) a++instance Covariant t => Covariant (Twister t) where+	f <$> (x :< xs) = f x :< ((comap . comap) f xs)++instance Avoidable t => Pointable (Twister t) where+	point x = x :< idle++instance Covariant t => Extractable (Twister t) where+	extract (x :< _) = x++instance Applicative t => Applicative (Twister t) where+	(f :< fs) <*> (x :< xs) = f x :< ((<*>) <$> fs <*> xs)++instance Traversable t => Traversable (Twister t) where+	(x :< xs) ->> f = (:<) <$> f x <*> (traverse . traverse) f xs++instance Alternative t => Bindable (Twister t) where+	(x :< xs) >>= f = case f x of+		y :< ys -> y :< (ys <+> comap (>>= f) xs)++instance Covariant t => Extendable (Twister t) where+	x =>> f = f x :< comap (extend f) (unwrap x)++instance (Avoidable t, Alternative t) => Monad (Twister t) where++instance Covariant t => Comonad (Twister t) where++instance (Setoid a, forall b . Setoid b => Setoid (t b)) => Setoid (Twister t a) where+	(x :< xs) == (y :< ys) = x == y && xs == ys++instance (Semigroup a, forall b . Semigroup b => Semigroup (t b)) => Semigroup (Twister t a) where+	(x :< xs) <> (y :< ys) = (x <> y) :< (xs <> ys)++instance (Monoid a, forall b . Semigroup b => Monoid (t b)) => Monoid (Twister t a) where+	unit = unit :< unit++unwrap :: Twister t a -> (t :.: Twister t) a+unwrap (_ :< xs) = xs++coiterate :: Covariant t => (a -> t a) -> a -> Twister t a+coiterate coalgebra x = x :< (coiterate coalgebra <$> coalgebra x)++section :: Comonad t => t ~> Twister t+section as = extract as :< extend section as
+ Pandora/Paradigm/Basis/Validation.hs view
@@ -0,0 +1,32 @@+module Pandora.Paradigm.Basis.Validation (Validation (..)) where++import Pandora.Core.Morphism (($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Pattern.Object.Semigroup (Semigroup ((<>)))++data Validation e a = Flaws e | Validated a++instance Covariant (Validation e) where+	_ <$> Flaws e = Flaws e+	f <$> Validated x = Validated $ f x++instance Pointable (Validation e) where+	point = Validated++instance Semigroup e => Applicative (Validation e) where+	Flaws e <*> Flaws e' = Flaws $ e <> e'+	Flaws e <*> Validated _ = Flaws e+	Validated _ <*> Flaws e2 = Flaws e2+	Validated f <*> Validated x = Validated $ f x++instance Alternative (Validation e) where+	Flaws _ <+> x = x+	Validated x <+> _ = Validated x++instance Traversable (Validation e) where+	Validated x ->> f = Validated <$> f x+	Flaws e ->> _ = point $ Flaws e
Pandora/Paradigm/Basis/Yoneda.hs view
@@ -4,7 +4,7 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Extractable (Extractable (extract)) import Pandora.Pattern.Functor.Adjoint (Adjoint (phi, psi))@@ -21,8 +21,8 @@ instance Applicative t => Applicative (Yoneda t) where 	Yoneda f <*> Yoneda x = Yoneda (\g -> f (g .) <*> x identity) -instance Exclusive t => Exclusive (Yoneda t) where-	exclusive = Yoneda (exclusive !)+instance Avoidable t => Avoidable (Yoneda t) where+	idle = Yoneda (idle !)  instance Pointable t => Pointable (Yoneda t) where 	point x = Yoneda (\f -> point $ f x)
Pandora/Paradigm/Inventory/Stateful.hs view
@@ -7,7 +7,7 @@ import Pandora.Paradigm.Basis.Product (Product ((:*:)), type (:*:), delta) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), ($>), comap)) import Pandora.Pattern.Functor.Extractable (Extractable (extract))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), (*>))) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))@@ -53,5 +53,5 @@ fold start op struct = extract . extract @Identity $ 	statefully (struct ->> (modify . op) $> () *> get) start -find :: (Pointable u, Exclusive u, Alternative u, Traversable t) => Predicate a -> t a -> u a-find p struct = fold exclusive (\x s -> (<+>) s . bool exclusive (point x) . predicate p $ x) struct+find :: (Pointable u, Avoidable u, Alternative u, Traversable t) => Predicate a -> t a -> u a+find p struct = fold idle (\x s -> (<+>) s . bool idle (point x) . predicate p $ x) struct
Pandora/Paradigm/Junction/Composition.hs view
@@ -5,7 +5,7 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap)) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<), contramap)) import Pandora.Pattern.Functor.Extractable (Extractable (extract))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), apply))@@ -36,8 +36,8 @@ instance (Extractable t, Extractable u) => Extractable (U Co Co t u) where 	extract = extract . extract . u -instance (Exclusive t, Covariant u) => Exclusive (U Co Co t u) where-	exclusive = U exclusive+instance (Avoidable t, Covariant u) => Avoidable (U Co Co t u) where+	idle = U idle  instance (Applicative t, Applicative u) => Applicative (U Co Co t u) where 	U f <*> U x = U $ apply <$> f <*> x@@ -88,8 +88,8 @@ instance (Extractable t, Extractable u, Extractable v) => Extractable (UU Co Co Co t u v) where 	extract = extract . extract . extract . uu -instance (Exclusive t, Covariant u, Covariant v) => Exclusive (UU Co Co Co t u v) where-	exclusive = UU exclusive+instance (Avoidable t, Covariant u, Covariant v) => Avoidable (UU Co Co Co t u v) where+	idle = UU idle  instance (Applicative t, Applicative u, Applicative v) => Applicative (UU Co Co Co t u v) where 	UU f <*> UU x = UU $ (comap apply . (comap . comap) apply $ f) <*> x@@ -164,8 +164,8 @@ instance (Extractable t, Extractable u, Extractable v, Extractable w) => Extractable (UUU Co Co Co Co t u v w) where 	extract = extract . extract . extract . extract . uuu -instance (Exclusive t, Covariant u, Covariant v, Covariant w) => Exclusive (UUU Co Co Co Co t u v w) where-	exclusive = UUU exclusive+instance (Avoidable t, Covariant u, Covariant v, Covariant w) => Avoidable (UUU Co Co Co Co t u v w) where+	idle = UUU idle  instance (Applicative t, Applicative u, Applicative v, Applicative w) => Applicative (UUU Co Co Co Co t u v w) where 	UUU f <*> UUU x = UUU $ (comap apply . (comap . comap) apply . (comap . comap . comap) apply $ f) <*> x
Pandora/Paradigm/Junction/Transformer.hs view
@@ -5,7 +5,7 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Extractable (Extractable (extract))-import Pandora.Pattern.Functor.Exclusive (Exclusive (exclusive))+import Pandora.Pattern.Functor.Avoidable (Avoidable (idle)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), apply)) import Pandora.Pattern.Functor.Traversable (Traversable ((->>), traverse))@@ -33,8 +33,8 @@ instance (Extractable t, Extractable u) => Extractable (T t u) where 	extract = extract . extract . t -instance (Covariant t, Exclusive u) => Exclusive (T t u) where-	exclusive = T exclusive+instance (Covariant t, Avoidable u) => Avoidable (T t u) where+	idle = T idle  instance (Covariant t, Alternative u) => Alternative (T t u) where 	T x <+> T y = T $ x <+> y@@ -81,8 +81,8 @@ instance (Extractable (t u), Extractable u) => Extractable (Y t u) where 	extract = extract . extract . y -instance (Covariant (t u), Exclusive u) => Exclusive (Y t u) where-	exclusive = Y exclusive+instance (Covariant (t u), Avoidable u) => Avoidable (Y t u) where+	idle = Y idle  instance (Covariant (t u), Alternative u) => Alternative (Y t u) where 	Y x <+> Y y = Y $ x <+> y
Pandora/Paradigm/Structure.hs view
@@ -4,9 +4,9 @@ import Pandora.Paradigm.Structure.Graph as Exports import Pandora.Paradigm.Structure.Stack as Exports -import Pandora.Paradigm.Basis.Cofree (Cofree)+import Pandora.Paradigm.Basis.Twister (Twister) import Pandora.Paradigm.Junction.Transformer (type (:>:))  -- | Type synonymous for at least one element data structure type family Nonempty structure a :: * where-	Nonempty (Cofree :>: t) a = Cofree t a+	Nonempty (Twister :>: t) a = Twister t a
Pandora/Paradigm/Structure/Binary.hs view
@@ -2,10 +2,10 @@  import Pandora.Core.Morphism ((&)) import Pandora.Paradigm.Basis.Wye (Wye (End, Left, Right, Both))-import Pandora.Paradigm.Basis.Cofree (Cofree ((:<)))+import Pandora.Paradigm.Basis.Twister (Twister ((:<))) import Pandora.Pattern.Object.Chain (Chain ((<=>)), order) -type Binary = Cofree Wye+type Binary = Twister Wye  insert :: Chain a => a -> Binary a -> Binary a insert x (y :< End) = x <=> y & order (y :< Right (x :< End)) (y :< Right (x :< End)) (y :< Left (x :< End))
Pandora/Paradigm/Structure/Graph.hs view
@@ -2,13 +2,13 @@  import Pandora.Core.Morphism ((.)) import Pandora.Paradigm.Basis.Edges (Edges (Empty, Overlay))-import Pandora.Paradigm.Basis.Cofree (Cofree ((:<)))+import Pandora.Paradigm.Basis.Twister (Twister ((:<))) import Pandora.Paradigm.Junction.Transformer (Y (Y), type (:>:)) import Pandora.Paradigm.Inventory.Stateful (fold) import Pandora.Pattern.Functor.Traversable (Traversable)  -- | Acyclic graph structure without loops-type Graph a = (Cofree :>: Edges) a+type Graph a = (Twister :>: Edges) a  -- | Transform any traversable structure into all loose edges graph loose :: Traversable t => t a -> Graph a
Pandora/Paradigm/Structure/Stack.hs view
@@ -1,7 +1,7 @@ module Pandora.Paradigm.Structure.Stack (Stack, push, top, pop, filter, linearize) where  import Pandora.Core.Morphism ((.), ($))-import Pandora.Paradigm.Basis.Cofree (Cofree ((:<)), unwrap)+import Pandora.Paradigm.Basis.Twister (Twister ((:<)), unwrap) import Pandora.Paradigm.Basis.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Basis.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Junction.Transformer (Y (Y), type (:>:))@@ -15,7 +15,7 @@ import Pandora.Pattern.Object.Setoid (bool)  -- | Linear data structure that serves as a collection of elements-type Stack = (Cofree :>: Maybe)+type Stack = (Twister :>: Maybe)  push :: a -> Stack a -> Stack a push x (Y struct) = (Y $ (:<) x . Just <$> struct) <+> point x
Pandora/Pattern/Functor.hs view
@@ -11,7 +11,7 @@ import Pandora.Pattern.Functor.Traversable as Exports import Pandora.Pattern.Functor.Extractable as Exports import Pandora.Pattern.Functor.Pointable as Exports-import Pandora.Pattern.Functor.Exclusive as Exports+import Pandora.Pattern.Functor.Avoidable as Exports import Pandora.Pattern.Functor.Applicative as Exports import Pandora.Pattern.Functor.Alternative as Exports import Pandora.Pattern.Functor.Invariant as Exports
+ Pandora/Pattern/Functor/Avoidable.hs view
@@ -0,0 +1,12 @@+module Pandora.Pattern.Functor.Avoidable (Avoidable (..)) where++import Pandora.Pattern.Functor.Alternative (Alternative)++{- |+> When providing a new instance, you should ensure it satisfies the two laws:+> * Left absorption: x <+> idle ≡ x+> * Right absorption: idle <+> x ≡ x+-}++class Alternative t => Avoidable t where+	idle :: t a
Pandora/Pattern/Functor/Contravariant.hs view
@@ -30,3 +30,6 @@ 	-- | Infix versions of `contramap` with various nesting levels 	(>$$$<) :: (Contravariant u, Contravariant v) => (a -> b) -> t (u (v b)) -> t (u (v a)) 	(>$$$<) = (>$<) . (>$<) . (>$<)+	-- | Flipped infix version of 'contramap'+	(>&<) :: t b -> (a -> b) -> t a+	x >&< f = f >$< x
Pandora/Pattern/Functor/Covariant.hs view
@@ -37,6 +37,9 @@ 	(<$$$>) = (<$>) . (<$>) . (<$>) 	(<$$$$>) :: (Covariant u, Covariant v, Covariant w) => (a -> b) -> t (u (v ( w a))) -> t (u (v (w b))) 	(<$$$$>) = (<$>) . (<$>) . (<$>) . (<$>)+	-- | Flipped infix version of 'comap'+	(<&>) :: t a -> (a -> b) -> t b+	x <&> f = f <$> x  instance Covariant ((->) a) where 	(<$>) = (.)
− Pandora/Pattern/Functor/Exclusive.hs
@@ -1,12 +0,0 @@-module Pandora.Pattern.Functor.Exclusive (Exclusive (..)) where--import Pandora.Pattern.Functor.Alternative (Alternative)--{- |-> When providing a new instance, you should ensure it satisfies the two laws:-> * Left absorption: x <+> exclusive ≡ x-> * Right absorption: exclusive <+> x ≡ x--}--class Alternative t => Exclusive t where-	exclusive :: t a
pandora.cabal view
@@ -1,5 +1,5 @@ name:                pandora-version:             0.1.4+version:             0.1.5 synopsis:            A box of patterns and paradigms description:         Humble attempt to define a library for problem solving based on math abstractions. homepage:            https://github.com/iokasimov/pandora@@ -24,7 +24,6 @@     Pandora.Core.Morphism     -- Basic constructions     Pandora.Paradigm.Basis-    Pandora.Paradigm.Basis.Cofree     Pandora.Paradigm.Basis.Conclusion     Pandora.Paradigm.Basis.Constant     Pandora.Paradigm.Basis.Continuation@@ -38,6 +37,10 @@     Pandora.Paradigm.Basis.Maybe     Pandora.Paradigm.Basis.Predicate     Pandora.Paradigm.Basis.Product+    Pandora.Paradigm.Basis.Proxy+    Pandora.Paradigm.Basis.Tagged+    Pandora.Paradigm.Basis.Twister+    Pandora.Paradigm.Basis.Validation     Pandora.Paradigm.Basis.Variation     Pandora.Paradigm.Basis.Wye     Pandora.Paradigm.Basis.Yoneda@@ -71,7 +74,7 @@     Pandora.Pattern.Functor.Contravariant     Pandora.Pattern.Functor.Covariant     Pandora.Pattern.Functor.Distributive-    Pandora.Pattern.Functor.Exclusive+    Pandora.Pattern.Functor.Avoidable     Pandora.Pattern.Functor.Extendable     Pandora.Pattern.Functor.Extractable     Pandora.Pattern.Functor.Invariant