pandora 0.3.3 → 0.3.4
raw patch · 57 files changed
+402/−276 lines, 57 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Pandora.Paradigm.Controlflow.Effect.Interpreted: via :: (Liftable t, Interpreted (t u), Interpreted (t v), Covariant u) => (t u a -> t v b) -> u a -> Primary (t v) b
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant ((Pandora.Paradigm.Primary.Functor.Product.:*:) e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Inventory.Environment: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Pointable.Pointable u) => Pandora.Pattern.Functor.Pointable.Pointable ((->) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Environment: instance Pandora.Pattern.Functor.Applicative.Applicative u => Pandora.Pattern.Functor.Applicative.Applicative ((->) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Environment: instance Pandora.Pattern.Functor.Bindable.Bindable u => Pandora.Pattern.Functor.Bindable.Bindable ((->) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Environment: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant ((->) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant ((Pandora.Paradigm.Primary.Functor.Product.:*:) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Extractable.Extractable u => Pandora.Pattern.Functor.Extractable.Extractable ((Pandora.Paradigm.Primary.Functor.Product.:*:) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Imprint: instance (Pandora.Pattern.Object.Monoid.Monoid e, Pandora.Pattern.Functor.Extractable.Extractable u) => Pandora.Pattern.Functor.Extractable.Extractable ((->) e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Applicative.Applicative u => Pandora.Pattern.Functor.Applicative.Applicative ((->) e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant ((->) e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Alternative.Alternative u => Pandora.Pattern.Functor.Alternative.Alternative (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Avoidable.Avoidable u => Pandora.Pattern.Functor.Avoidable.Avoidable (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Bindable.Bindable u => Pandora.Pattern.Functor.Applicative.Applicative (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Bindable.Bindable u => Pandora.Pattern.Functor.Bindable.Bindable (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Monad.Monad u => Pandora.Pattern.Functor.Monad.Monad (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Pointable.Pointable u => Pandora.Pattern.Functor.Pointable.Pointable (((->) s Pandora.Paradigm.Schemes.TUT.<:<.>:> (Pandora.Paradigm.Primary.Functor.Product.:*:) s) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.State: type Decisive t = (Pointable t, Avoidable t, Alternative t, Applicative t)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic.Comonadic (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Comonad.Comonad (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant (((Pandora.Paradigm.Primary.Functor.Product.:*:) p Pandora.Paradigm.Schemes.TUT.<:<.>:> (->) p) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extendable.Extendable u => Pandora.Pattern.Functor.Extendable.Extendable (((Pandora.Paradigm.Primary.Functor.Product.:*:) p Pandora.Paradigm.Schemes.TUT.<:<.>:> (->) p) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extractable.Extractable (Pandora.Paradigm.Inventory.Store.Store p)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extractable.Extractable u => Pandora.Pattern.Functor.Extractable.Extractable (((Pandora.Paradigm.Primary.Functor.Product.:*:) p Pandora.Paradigm.Schemes.TUT.<:<.>:> (->) p) Pandora.Core.Functor.:= u)
- Pandora.Paradigm.Primary.Functor.Conclusion: instance (Pandora.Pattern.Functor.Pointable.Pointable u, Pandora.Pattern.Functor.Bindable.Bindable u) => Pandora.Pattern.Functor.Bindable.Bindable (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Conclusion: instance Pandora.Pattern.Functor.Applicative.Applicative u => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Conclusion: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Conclusion: instance Pandora.Pattern.Functor.Monad.Monad u => Pandora.Pattern.Functor.Monad.Monad (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Conclusion: instance Pandora.Pattern.Functor.Pointable.Pointable u => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Maybe: instance (Pandora.Pattern.Functor.Pointable.Pointable u, Pandora.Pattern.Functor.Bindable.Bindable u) => Pandora.Pattern.Functor.Bindable.Bindable (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic (Pandora.Paradigm.Primary.Functor.Maybe.Maybe a) a
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic (t a) a => Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic ((Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Core.Functor.:. t) Pandora.Core.Functor.:= a) a
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Pattern.Functor.Applicative.Applicative u => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Pattern.Functor.Covariant.Covariant u => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Pattern.Functor.Monad.Monad u => Pandora.Pattern.Functor.Monad.Monad (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Pattern.Functor.Pointable.Pointable u => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Primary.Object.Boolean: instance Pandora.Pattern.Object.Group.Group Pandora.Paradigm.Primary.Object.Boolean.Boolean
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Applicative.Applicative u, Pandora.Pattern.Functor.Applicative.Applicative t) => Pandora.Pattern.Functor.Applicative.Applicative (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Avoidable.Avoidable u, Pandora.Pattern.Functor.Pointable.Pointable t) => Pandora.Pattern.Functor.Pointable.Pointable (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Alternative.Alternative t) => Pandora.Pattern.Functor.Alternative.Alternative (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Avoidable.Avoidable t) => Pandora.Pattern.Functor.Avoidable.Avoidable (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Covariant.Covariant t) => Pandora.Pattern.Functor.Covariant.Covariant (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Construction: instance (Pandora.Pattern.Functor.Traversable.Traversable u, Pandora.Pattern.Functor.Traversable.Traversable t) => Pandora.Pattern.Functor.Traversable.Traversable (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction u)
- Pandora.Paradigm.Primary.Transformer.Outline: instance (Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Applicative.Applicative t) => Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Primary.Transformer.Outline.Outline t)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a s => Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic (s Pandora.Paradigm.Primary.Functor.Product.:*: a) s
- Pandora.Paradigm.Structure.Binary: data Direction a
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable 'Pandora.Paradigm.Structure.Binary.Up (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
- Pandora.Paradigm.Structure.Splay: maybe_subtree :: Maybe a -> Maybe a -> Wye a
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic ((Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= a) a
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe a) a
- Pandora.Pattern.Functor.Traversable: infixl 5 ->>
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: (<:=<<) :: (Adaptable t u, Bindable u) => (a -> t b) -> u a -> u b
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: (>>=:>) :: (Adaptable t u, Bindable u) => u a -> (a -> t b) -> u b
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: infixl 1 >>=:>
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: infixr 1 <:=<<
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: type Bringable t u = (Transformer Comonad t, Extractable u)
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: type Lifting t u = (Transformer Monad t, Liftable (Schematic Monad t), Covariant u)
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: type Lowering t u = (Transformer Comonad t, Lowerable (Schematic Comonad t), Covariant u)
+ Pandora.Paradigm.Controlflow.Effect.Adaptable: type Wrappable t u = (Transformer Monad t, Pointable u)
+ Pandora.Paradigm.Controlflow.Effect.Interpreted: (-=:) :: (Liftable t, Interpreted (t u), Interpreted (t v), Covariant u) => (t u a -> t v b) -> u a -> Primary (t v) b
+ Pandora.Paradigm.Controlflow.Effect.Interpreted: unite :: Interpreted t => Primary t a -> t a
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic.Comonadic (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Comonad.Comonad (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extractable.Extractable (Pandora.Paradigm.Inventory.Store.Store s)
+ Pandora.Paradigm.Primary.Functor: branches :: Maybe a -> Maybe a -> Wye a
+ Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a (Pandora.Paradigm.Primary.Functor.Maybe.Maybe a)
+ Pandora.Paradigm.Primary.Functor.Maybe: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a (t a) => Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a ((Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Core.Functor.:. t) Pandora.Core.Functor.:= a)
+ Pandora.Paradigm.Primary.Functor.Predicate: not :: Predicate ~> Predicate
+ Pandora.Paradigm.Primary.Transformer.Outline: instance (Pandora.Pattern.Functor.Extractable.Extractable t, Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Applicative.Applicative t) => Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Primary.Transformer.Outline.Outline t)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Applicative.Applicative t, Pandora.Pattern.Functor.Applicative.Applicative u) => Pandora.Pattern.Functor.Applicative.Applicative (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Bindable.Bindable t, Pandora.Pattern.Functor.Distributive.Distributive t, Pandora.Pattern.Functor.Bindable.Bindable u) => Pandora.Pattern.Functor.Bindable.Bindable (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Covariant.Covariant t, Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Covariant.Covariant (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Alternative.Alternative t) => Pandora.Pattern.Functor.Alternative.Alternative (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Covariant.Covariant u, Pandora.Pattern.Functor.Avoidable.Avoidable t) => Pandora.Pattern.Functor.Avoidable.Avoidable (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Extractable.Extractable t, Pandora.Pattern.Functor.Extractable.Extractable u) => Pandora.Pattern.Functor.Extractable.Extractable (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Pointable.Pointable u) => Pandora.Pattern.Functor.Pointable.Pointable (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TU: instance (Pandora.Pattern.Functor.Traversable.Traversable t, Pandora.Pattern.Functor.Traversable.Traversable u) => Pandora.Pattern.Functor.Traversable.Traversable (t Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Adjoint.Adjoint t t', Pandora.Pattern.Functor.Extractable.Extractable u) => Pandora.Pattern.Functor.Extractable.Extractable ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Adjoint.Adjoint t' t, Pandora.Pattern.Functor.Bindable.Bindable u) => Pandora.Pattern.Functor.Applicative.Applicative ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Adjoint.Adjoint t' t, Pandora.Pattern.Functor.Bindable.Bindable u) => Pandora.Pattern.Functor.Bindable.Bindable ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Adjoint.Adjoint t' t, Pandora.Pattern.Functor.Extendable.Extendable u) => Pandora.Pattern.Functor.Extendable.Extendable ((t' Pandora.Paradigm.Schemes.TUT.<:<.>:> t) Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Applicative.Applicative t, Pandora.Pattern.Functor.Covariant.Covariant t', Pandora.Pattern.Functor.Alternative.Alternative u) => Pandora.Pattern.Functor.Alternative.Alternative ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Covariant.Covariant t, Pandora.Pattern.Functor.Covariant.Covariant t', Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Covariant.Covariant ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Applicative.Applicative t, Pandora.Pattern.Functor.Covariant.Covariant t', Pandora.Pattern.Functor.Avoidable.Avoidable u) => Pandora.Pattern.Functor.Avoidable.Avoidable ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.TUT: instance (Pandora.Pattern.Functor.Pointable.Pointable u, Pandora.Pattern.Functor.Adjoint.Adjoint t' t) => Pandora.Pattern.Functor.Pointable.Pointable ((t Pandora.Paradigm.Schemes.TUT.<:<.>:> t') Pandora.Core.Functor.:= u)
+ Pandora.Paradigm.Schemes.UT: instance (Pandora.Pattern.Functor.Applicative.Applicative t, Pandora.Pattern.Functor.Applicative.Applicative u) => Pandora.Pattern.Functor.Applicative.Applicative (t Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Schemes.UT: instance (Pandora.Pattern.Functor.Covariant.Covariant t, Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Covariant.Covariant (t Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Schemes.UT: instance (Pandora.Pattern.Functor.Extractable.Extractable t, Pandora.Pattern.Functor.Extractable.Extractable u) => Pandora.Pattern.Functor.Extractable.Extractable (t Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Schemes.UT: instance (Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Pointable.Pointable u) => Pandora.Pattern.Functor.Pointable.Pointable (t Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Schemes.UT: instance (Pandora.Pattern.Functor.Traversable.Traversable t, Pandora.Pattern.Functor.Bindable.Bindable t, Pandora.Pattern.Functor.Applicative.Applicative u, Pandora.Pattern.Functor.Monad.Monad u) => Pandora.Pattern.Functor.Bindable.Bindable (t Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic s a => Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic s (s Pandora.Paradigm.Primary.Functor.Product.:*: a)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Primary.Functor.Maybe.Maybe
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t)
+ Pandora.Paradigm.Structure.Ability.Comprehension: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Pointable.Pointable t) => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Structure.Ability.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Ability.Comprehension: instance (forall a. Pandora.Pattern.Object.Semigroup.Semigroup ((t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction t) Pandora.Core.Functor.:= a), Pandora.Pattern.Functor.Bindable.Bindable t, Pandora.Pattern.Functor.Pointable.Pointable t, Pandora.Pattern.Functor.Avoidable.Avoidable t) => Pandora.Pattern.Functor.Applicative.Applicative (Pandora.Paradigm.Structure.Ability.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Ability.Comprehension: instance Pandora.Pattern.Functor.Traversable.Traversable (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction t) => Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Structure.Ability.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Ability.Nullable: class Nullable t
+ Pandora.Paradigm.Structure.Ability.Nullable: null :: Nullable t => (Predicate :. t) := a
+ Pandora.Paradigm.Structure.Binary: data Vertical a
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Binary.Binary
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable 'Pandora.Paradigm.Structure.Binary.Up (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:*:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:*:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Rotatable.Rotatable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye Pandora.Paradigm.Schemes.T_U.<:*:> ((Pandora.Paradigm.Structure.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_.T_ Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)))
+ Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Rose.Rose
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a ((Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= a)
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe a)
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Stack.Stack
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Primary.Transformer.Tap.Tap (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Structure.Stack.Stack))
+ Pandora.Pattern: infixr 7 .|....
+ Pandora.Pattern.Functor.Adjoint: ($|-) :: (Adjoint t u, Covariant v) => v (t a) -> (a -> u b) -> v b
+ Pandora.Pattern.Functor.Adjoint: (-|$) :: (Adjoint t u, Covariant v) => v a -> (t a -> b) -> v (u b)
+ Pandora.Pattern.Functor.Applicative: infixl 1 <****>
+ Pandora.Pattern.Functor.Applicative: infixl 2 <***>
+ Pandora.Pattern.Functor.Applicative: infixl 3 <**>
+ Pandora.Pattern.Functor.Covariant: infixl 1 <$$$$>
+ Pandora.Pattern.Functor.Covariant: infixl 2 <$$$>
+ Pandora.Pattern.Functor.Covariant: infixl 3 <$$>
+ Pandora.Pattern.Functor.Traversable: infixl 3 ->>
+ Pandora.Pattern.Object.Chain: infixl 4 >
+ Pandora.Pattern.Object.Group: (-) :: Group a => a -> a -> a
+ Pandora.Pattern.Object.Group: infixl 6 -
- Pandora.Paradigm.Inventory: zoom :: Stateful bg t => Lens bg ls -> State ls a -> t a
+ Pandora.Paradigm.Inventory: zoom :: Stateful bg t => Lens bg ls -> State ls ~> t
- Pandora.Paradigm.Inventory.Store: Store :: (((:*:) p :. (->) p) := a) -> Store p a
+ Pandora.Paradigm.Inventory.Store: Store :: (((:*:) s :. (->) s) := a) -> Store s a
- Pandora.Paradigm.Inventory.Store: newtype Store p a
+ Pandora.Paradigm.Inventory.Store: newtype Store s a
- Pandora.Paradigm.Inventory.Store: retrofit :: (p -> p) -> Store p ~> Store p
+ Pandora.Paradigm.Inventory.Store: retrofit :: (s -> s) -> Store s ~> Store s
- Pandora.Paradigm.Primary.Transformer.Construction: deconstruct :: Construction t a -> (t :. Construction t) a
+ Pandora.Paradigm.Primary.Transformer.Construction: deconstruct :: Construction t a -> (t :. Construction t) := a
- Pandora.Paradigm.Schemes.T_U: type (>:.:<) = T_U Contravariant Contravariant
+ Pandora.Paradigm.Schemes.T_U: type (>:*:<) = T_U Contravariant Contravariant
- Pandora.Paradigm.Structure.Ability.Monotonic: class Monotonic e a
+ Pandora.Paradigm.Structure.Ability.Monotonic: class Monotonic a e
- Pandora.Paradigm.Structure.Ability.Monotonic: find :: (Monotonic e a, Pointable t, Avoidable t) => Predicate a -> e -> t a
+ Pandora.Paradigm.Structure.Ability.Monotonic: find :: (Monotonic a e, Pointable t, Avoidable t) => Predicate a -> e -> t a
- Pandora.Paradigm.Structure.Ability.Monotonic: reduce :: Monotonic e a => (a -> r -> r) -> r -> e -> r
+ Pandora.Paradigm.Structure.Ability.Monotonic: reduce :: Monotonic a e => (a -> r -> r) -> r -> e -> r
- Pandora.Paradigm.Structure.Ability.Monotonic: resolve :: Monotonic e a => (a -> r) -> r -> e -> r
+ Pandora.Paradigm.Structure.Ability.Monotonic: resolve :: Monotonic a e => (a -> r) -> r -> e -> r
- Pandora.Paradigm.Structure.Binary: Down :: a -> Direction a
+ Pandora.Paradigm.Structure.Binary: Down :: a -> Vertical a
- Pandora.Paradigm.Structure.Binary: Up :: a -> Direction a
+ Pandora.Paradigm.Structure.Binary: Up :: a -> Vertical a
- Pandora.Paradigm.Structure.Interface.Set: member :: forall e a. (Setoid a, Monotonic e a) => a -> e -> Boolean
+ Pandora.Paradigm.Structure.Interface.Set: member :: forall e a. (Setoid a, Monotonic a e) => a -> e -> Boolean
- Pandora.Paradigm.Structure.Interface.Set: subset :: (Monotonic (t a) a, Traversable t, Setoid a, Setoid (t a)) => t a -> t a -> Boolean
+ Pandora.Paradigm.Structure.Interface.Set: subset :: (Monotonic a (t a), Traversable t, Setoid a, Setoid (t a)) => t a -> t a -> Boolean
- Pandora.Paradigm.Structure.Stream: repeat :: a -> Stream a
+ Pandora.Paradigm.Structure.Stream: repeat :: a |-> Stream
- Pandora.Pattern.Functor.Bindable: ($>>=) :: (Bindable t, Covariant u) => (a -> t b) -> ((u :. t) := a) -> (u :. t) := b
+ Pandora.Pattern.Functor.Bindable: ($>>=) :: (Bindable t, Covariant u) => ((u :. t) := a) -> (a -> t b) -> (u :. t) := b
- Pandora.Pattern.Functor.Bindable: infixr 1 >=>
+ Pandora.Pattern.Functor.Bindable: infixr 1 =<<
- Pandora.Pattern.Functor.Extendable: ($=>>) :: (Extendable t, Covariant u) => (t a -> b) -> ((u :. t) := a) -> (u :. t) := b
+ Pandora.Pattern.Functor.Extendable: ($=>>) :: (Extendable t, Covariant u) => ((u :. t) := a) -> (t a -> b) -> (u :. t) := b
- Pandora.Pattern.Object.Group: class Quasiring a => Group a
+ Pandora.Pattern.Object.Group: class Monoid a => Group a
Files
- CHANGELOG.md +14/−0
- Pandora/Paradigm/Controlflow/Effect/Adaptable.hs +11/−1
- Pandora/Paradigm/Controlflow/Effect/Interpreted.hs +4/−3
- Pandora/Paradigm/Controlflow/Effect/Transformer/Comonadic.hs +3/−2
- Pandora/Paradigm/Controlflow/Effect/Transformer/Monadic.hs +3/−2
- Pandora/Paradigm/Inventory.hs +3/−2
- Pandora/Paradigm/Inventory/Accumulator.hs +6/−8
- Pandora/Paradigm/Inventory/Environment.hs +4/−15
- Pandora/Paradigm/Inventory/Equipment.hs +4/−9
- Pandora/Paradigm/Inventory/Imprint.hs +4/−13
- Pandora/Paradigm/Inventory/Optics.hs +3/−0
- Pandora/Paradigm/Inventory/State.hs +11/−31
- Pandora/Paradigm/Inventory/Store.hs +26/−24
- Pandora/Paradigm/Primary/Functor.hs +7/−1
- Pandora/Paradigm/Primary/Functor/Conclusion.hs +3/−16
- Pandora/Paradigm/Primary/Functor/Maybe.hs +7/−20
- Pandora/Paradigm/Primary/Functor/Predicate.hs +5/−2
- Pandora/Paradigm/Primary/Object/Boolean.hs +0/−5
- Pandora/Paradigm/Primary/Transformer/Backwards.hs +3/−2
- Pandora/Paradigm/Primary/Transformer/Construction.hs +2/−22
- Pandora/Paradigm/Primary/Transformer/Instruction.hs +1/−1
- Pandora/Paradigm/Primary/Transformer/Jack.hs +1/−1
- Pandora/Paradigm/Primary/Transformer/Jet.hs +1/−1
- Pandora/Paradigm/Primary/Transformer/Kan.hs +3/−1
- Pandora/Paradigm/Primary/Transformer/Outline.hs +3/−2
- Pandora/Paradigm/Primary/Transformer/Reverse.hs +2/−1
- Pandora/Paradigm/Primary/Transformer/Tap.hs +1/−1
- Pandora/Paradigm/Schemes/TU.hs +33/−2
- Pandora/Paradigm/Schemes/TUT.hs +36/−3
- Pandora/Paradigm/Schemes/TUVW.hs +2/−1
- Pandora/Paradigm/Schemes/T_.hs +2/−1
- Pandora/Paradigm/Schemes/T_U.hs +9/−8
- Pandora/Paradigm/Schemes/UT.hs +23/−3
- Pandora/Paradigm/Schemes/UTU.hs +2/−1
- Pandora/Paradigm/Schemes/U_T.hs +2/−1
- Pandora/Paradigm/Structure.hs +16/−2
- Pandora/Paradigm/Structure/Ability.hs +1/−0
- Pandora/Paradigm/Structure/Ability/Comprehension.hs +16/−1
- Pandora/Paradigm/Structure/Ability/Monotonic.hs +2/−2
- Pandora/Paradigm/Structure/Ability/Nullable.hs +7/−0
- Pandora/Paradigm/Structure/Binary.hs +22/−16
- Pandora/Paradigm/Structure/Interface/Set.hs +3/−3
- Pandora/Paradigm/Structure/Rose.hs +7/−1
- Pandora/Paradigm/Structure/Splay.hs +22/−20
- Pandora/Paradigm/Structure/Stack.hs +15/−6
- Pandora/Paradigm/Structure/Stream.hs +2/−2
- Pandora/Pattern.hs +2/−0
- Pandora/Pattern/Functor/Adjoint.hs +8/−2
- Pandora/Pattern/Functor/Applicative.hs +3/−0
- Pandora/Pattern/Functor/Bindable.hs +2/−3
- Pandora/Pattern/Functor/Covariant.hs +8/−0
- Pandora/Pattern/Functor/Extendable.hs +2/−2
- Pandora/Pattern/Functor/Traversable.hs +1/−1
- Pandora/Pattern/Object/Chain.hs +2/−0
- Pandora/Pattern/Object/Group.hs +10/−4
- Pandora/Pattern/Object/Setoid.hs +5/−4
- pandora.cabal +2/−1
CHANGELOG.md view
@@ -296,3 +296,17 @@ * Add `resolve` method of `Monotonic` typeclass * Rename `iterate` method of `Construction` to `.-+` * Define `via` method to use transformer as wrappers++# 0.3.4+* Define `branches` to create `Wye a` from two `Maybe a`+* Rename `<:.:>`,`>:.:>`,`<:.:<`,`>:.:<` to `<:*:>`,`>:*:>`,`<:*:<`,`>:*:<`+* Add `unite` method to `Interpreted` typeclass+* Rename `Direction` to `Vertical`+* Define `Nullable` typeclass for structures which can be null+* Define `>>=:>` and `<:=<<` methods to use `>>=` with `adapt`+* Define `not` method for `Predicate` inversion+* Make `Monoid` a superclass for `Group`+* Define `-` method in `Group` typeclass+* Rename `via` to `-=:` in Interpreted module+* Flip arguments for `Bindable` `$>>=` and `Extendable` `$=>>` methods+* Define experimental methods: `-|$`, `$|-`
Pandora/Paradigm/Controlflow/Effect/Adaptable.hs view
@@ -1,18 +1,22 @@ {-# LANGUAGE UndecidableInstances #-} -module Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (..)) where+module Pandora.Paradigm.Controlflow.Effect.Adaptable where import Pandora.Core.Functor (type (~>)) import Pandora.Pattern.Category (identity, (.)) import Pandora.Pattern.Functor.Covariant (Covariant) import Pandora.Pattern.Functor.Pointable (Pointable) import Pandora.Pattern.Functor.Extractable (Extractable)+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Transformer (Liftable (lift), Lowerable (lower), Hoistable (hoist)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic) import Pandora.Paradigm.Controlflow.Effect.Transformer (Transformer, wrap, bring, (:>), (:<)) +infixl 1 >>=:>+infixr 1 <:=<<+ class Adaptable t u where {-# MINIMAL adapt #-} adapt :: t ~> u@@ -488,3 +492,9 @@ ) => Adaptable (t :> u :> v :> w :> x :> y :> z :> f :> h) (t :> u :> v :> w :> x :> y :> z :> f :> h') where adapt = hoist (hoist (hoist (hoist (hoist (hoist (hoist adapt))))))++(>>=:>) :: (Adaptable t u, Bindable u) => u a -> (a -> t b) -> u b+x >>=:> f = x >>= adapt . f++(<:=<<) :: (Adaptable t u, Bindable u) => (a -> t b) -> u a -> u b+f <:=<< x = x >>= adapt . f
Pandora/Paradigm/Controlflow/Effect/Interpreted.hs view
@@ -7,10 +7,11 @@ type family Schematic (c :: (* -> *) -> k) (t :: * -> *) = (r :: (* -> *) -> * -> *) | r -> t class Interpreted t where- {-# MINIMAL run #-}+ {-# MINIMAL run, unite #-} type Primary t a :: * run :: t a -> Primary t a+ unite :: Primary t a -> t a -via :: (Liftable t, Interpreted (t u), Interpreted (t v), Covariant u)+(-=:) :: (Liftable t, Interpreted (t u), Interpreted (t v), Covariant u) => (t u a -> t v b) -> u a -> Primary (t v) b-via f = run . f . lift+(-=:) f = run . f . lift
Pandora/Paradigm/Controlflow/Effect/Transformer/Comonadic.hs view
@@ -16,7 +16,7 @@ import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) class Interpreted t => Comonadic t where {-# MINIMAL bring #-}@@ -41,7 +41,7 @@ TC x <+> TC y = TC $ x <+> y instance Traversable (Schematic Comonad t u) => Traversable (t :< u) where- TC x ->> f = TC <$> x ->> f+ TC x ->> f = TC <$> (x ->> f) instance Distributive (Schematic Comonad t u) => Distributive (t :< u) where x >>- f = TC $ x >>- tc . f@@ -63,3 +63,4 @@ instance (Interpreted (Schematic Comonad t u)) => Interpreted (t :< u) where type Primary (t :< u) a = Primary (Schematic Comonad t u) a run ~(TC x) = run x+ unite = TC . unite
Pandora/Paradigm/Controlflow/Effect/Transformer/Monadic.hs view
@@ -17,7 +17,7 @@ import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) class Interpreted t => Monadic t where {-# MINIMAL wrap #-}@@ -45,7 +45,7 @@ empty = TM empty instance Traversable (Schematic Monad t u) => Traversable (t :> u) where- TM x ->> f = TM <$> x ->> f+ TM x ->> f = TM <$> (x ->> f) instance Distributive (Schematic Monad t u) => Distributive (t :> u) where x >>- f = TM $ x >>- tm . f@@ -67,3 +67,4 @@ instance (Interpreted (Schematic Monad t u)) => Interpreted (t :> u) where type Primary (t :> u) a = Primary (Schematic Monad t u) a run ~(TM x) = run x+ unite = TM . unite
Pandora/Paradigm/Inventory.hs view
@@ -10,6 +10,7 @@ import Pandora.Paradigm.Inventory.Environment as Exports import Pandora.Paradigm.Inventory.Accumulator as Exports +import Pandora.Core.Functor (type (~>)) import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.), ($), identity) import Pandora.Pattern.Functor (Adjoint ((-|), (|-)), extract, (<->))@@ -31,5 +32,5 @@ x -| f = Environment $ x -| f . Equipment x |- g = run x |- run . g -zoom :: Stateful bg t => Lens bg ls -> State ls a -> t a-zoom lens (State f) = adapt . State $ (\(Store (p :*: g)) -> (g <-> identity) . f $ p) . lens+zoom :: Stateful bg t => Lens bg ls -> State ls ~> t+zoom lens lesser = adapt . State $ (\(Store (p :*: g)) -> (g <-> identity) . run lesser $ p) . lens
Pandora/Paradigm/Inventory/Accumulator.hs view
@@ -3,7 +3,7 @@ module Pandora.Paradigm.Inventory.Accumulator (Accumulator (..), Accumulated, gather) where import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))@@ -11,7 +11,7 @@ import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))@@ -37,23 +37,21 @@ instance Interpreted (Accumulator e) where type Primary (Accumulator e) a = e :*: a run ~(Accumulator x) = x+ unite = Accumulator instance Monoid e => Monadic (Accumulator e) where wrap = TM . UT . point . run type Accumulated e t = Adaptable (Accumulator e) t -instance Covariant u => Covariant ((:*:) e <.:> u) where- f <$> UT x = UT $ f <$$> x--instance (Semigroup e, Applicative u) => Applicative ((:*:) e <.:> u) where+instance {-# OVERLAPS #-} (Semigroup e, Applicative u) => Applicative ((:*:) e <.:> u) where UT f <*> UT x = UT $ k <$> f <*> x where k ~(u :*: g) ~(v :*: y) = u + v :*: g y -instance (Pointable u, Monoid e) => Pointable ((:*:) e <.:> u) where+instance {-# OVERLAPS #-} (Pointable u, Monoid e) => Pointable ((:*:) e <.:> u) where point = UT . point . (zero :*:) -instance (Semigroup e, Pointable u, Bindable u) => Bindable ((:*:) e <.:> u) where+instance {-# OVERLAPS #-} (Semigroup e, Pointable u, Bindable u) => Bindable ((:*:) e <.:> u) where UT x >>= f = UT $ x >>= \(acc :*: v) -> (\(acc' :*: y) -> (acc + acc' :*: y)) <$> run (f v) gather :: Accumulated e t => e -> t ()
Pandora/Paradigm/Inventory/Environment.hs view
@@ -3,14 +3,14 @@ module Pandora.Paradigm.Inventory.Environment (Environment (..), Configured, env) where import Pandora.Pattern.Category (identity, (.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))-import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), (<**>)))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Distributive (Distributive ((>>-))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Core.Morphism ((!), (%))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))@@ -37,6 +37,7 @@ instance Interpreted (Environment e) where type Primary (Environment e) a = (->) e a run ~(Environment x) = x+ unite = Environment type instance Schematic Monad (Environment e) = (<:.>) ((->) e) @@ -44,18 +45,6 @@ wrap x = TM . TU $ point <$> run x type Configured e = Adaptable (Environment e)--instance Covariant u => Covariant ((->) e <:.> u) where- f <$> TU x = TU $ f <$$> x--instance (Covariant u, Pointable u) => Pointable ((->) e <:.> u) where- point = TU . point . point--instance Applicative u => Applicative ((->) e <:.> u) where- TU f <*> TU x = TU $ f <**> x--instance Bindable u => Bindable ((->) e <:.> u) where- TU x >>= f = TU $ \e -> x e >>= ($ e) . run . f env :: Configured e t => t e env = adapt $ Environment identity
Pandora/Paradigm/Inventory/Equipment.hs view
@@ -3,14 +3,14 @@ module Pandora.Paradigm.Inventory.Equipment (Equipment (..), retrieve) where import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (Extractable (extract)) import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>)) newtype Equipment e a = Equipment (e :*: a)@@ -27,6 +27,7 @@ instance Interpreted (Equipment e) where type Primary (Equipment e) a = e :*: a run ~(Equipment x) = x+ unite = Equipment type instance Schematic Comonad (Equipment e) = (<:.>) ((:*:) e) @@ -35,13 +36,7 @@ type Equipped e t = Adaptable t (Equipment e) -instance Covariant u => Covariant ((:*:) e <:.> u) where- f <$> TU x = TU $ f <$$> x--instance Extractable u => Extractable ((:*:) e <:.> u) where- extract (TU x) = extract . extract $ x--instance Extendable u => Extendable ((:*:) e <:.> u) where+instance {-# OVERLAPS #-} Extendable u => Extendable ((:*:) e <:.> u) where TU (e :*: x) =>> f = TU . (:*:) e $ x =>> f . TU . (:*:) e instance Comonad (Equipment e) where
Pandora/Paradigm/Inventory/Imprint.hs view
@@ -3,15 +3,14 @@ module Pandora.Paradigm.Inventory.Imprint (Imprint (..), Traceable) where import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (Extractable (extract))-import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), (<**>))) import Pandora.Pattern.Functor.Distributive (Distributive ((>>-))) import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable) import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))@@ -33,22 +32,14 @@ instance Interpreted (Imprint e) where type Primary (Imprint e) a = (->) e a run ~(Imprint x) = x+ unite = Imprint type instance Schematic Comonad (Imprint e) = (<.:>) ((->) e) instance Monoid e => Comonadic (Imprint e) where bring (TC (UT x)) = Imprint . extract $ x -instance Covariant u => Covariant ((->) e <.:> u) where- f <$> UT x = UT $ f <$$> x--instance Applicative u => Applicative ((->) e <.:> u) where- UT f <*> UT x = UT $ f <**> x--instance (Monoid e, Extractable u) => Extractable ((->) e <.:> u) where- extract (UT x) = extract . extract $ x--instance (Semigroup e, Extendable u) => Extendable ((->) e <.:> u) where+instance {-# OVERLAPS #-} (Semigroup e, Extendable u) => Extendable ((->) e <.:> u) where UT x =>> f = UT $ x =>> (\x' e -> f . UT . (<$>) (. (e +)) $ x') type Traceable e t = Adaptable t (Imprint e)
Pandora/Paradigm/Inventory/Optics.hs view
@@ -15,8 +15,10 @@ infixr 0 :-. type (:-.) src tgt = Lens src tgt +-- Reference to taret within some source type Lens src tgt = src |-> Store tgt +-- Lens as natural transformation type (:~.) t u a = Lens (t a) (u a) -- | Lens composition infix operator@@ -47,5 +49,6 @@ (%~) :: Lens src tgt -> (tgt -> tgt) -> src -> src lens %~ f = over lens f +-- | Representable based lens represent :: (Representable t, Setoid (Representation t)) => Representation t -> t a :-. a represent r x = Store $ (r <#> x) :*: \new -> tabulate (\r' -> r' == r ? new $ r' <#> x)
Pandora/Paradigm/Inventory/State.hs view
@@ -4,23 +4,21 @@ import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Pattern.Category (identity, (.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))-import Pandora.Pattern.Functor.Avoidable (Avoidable (empty))+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.Functor.Bindable (Bindable ((>>=), (>=>)))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Functor.Adjoint ((-|), (|-))+import Pandora.Pattern.Functor.Adjoint ((-|), (|-), ($|-)) import Pandora.Pattern.Functor.Bivariant ((<->))-import Pandora.Pattern.Functor ((<*+>)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run), Schematic)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite), Schematic) import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM)) import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>)) import Pandora.Paradigm.Primary.Functor (Product ((:*:)), type (:*:), delta) +-- | Effectful computation with a variable newtype State s a = State ((->) s :. (:*:) s := a) instance Covariant (State s) where@@ -33,13 +31,14 @@ point = State . (-| identity) instance Bindable (State s) where- x >>= f = State $ (|- run) . (<$>) f . run x+ x >>= f = State $ run x $|- run . f instance Monad (State s) where instance Interpreted (State s) where type Primary (State s) a = (->) s :. (:*:) s := a run ~(State x) = x+ unite = State type instance Schematic Monad (State s) = (->) s <:<.>:> (:*:) s @@ -48,38 +47,19 @@ type Stateful s = Adaptable (State s) -instance Covariant u => Covariant ((->) s <:<.>:> (:*:) s := u) where- f <$> x = TUT $ (<$$>) f . run x--instance Bindable u => Applicative ((->) s <:<.>:> (:*:) s := u) where- f <*> x = TUT $ run f >=> \ ~(new :*: g) -> g <$$> run x new--instance Pointable u => Pointable ((->) s <:<.>:> (:*:) s := u) where- point = TUT . (-| point)--instance Bindable u => Bindable ((->) s <:<.>:> (:*:) s := u) where- x >>= f = TUT $ run x >=> \ ~(new :*: y) -> ($ new) . run . f $ y--instance Monad u => Monad ((->) s <:<.>:> (:*:) s := u) where--instance Alternative u => Alternative ((->) s <:<.>:> (:*:) s := u) where- x <+> y = TUT $ run x <*+> run y--instance Avoidable u => Avoidable ((->) s <:<.>:> (:*:) s := u) where- empty = TUT $ \_ -> empty-+-- | Get current value current :: Stateful s t => t s current = adapt $ State delta +-- | Modify stored value with a function modify :: Stateful s t => (s -> s) -> t () modify f = adapt . State $ (:*: ()) . f +-- | Replace current value with another one replace :: Stateful s t => s -> t () replace s = adapt . State $ \_ -> s :*: () type Memorable s t = (Pointable t, Applicative t, Stateful s t) fold :: (Traversable t, Memorable s u) => (a -> s -> s) -> t a -> u s-fold op struct = struct ->> modify . op *> current--type Decisive t = (Pointable t, Avoidable t, Alternative t, Applicative t)+fold op struct = (struct ->> modify . op) *> current
Pandora/Paradigm/Inventory/Store.hs view
@@ -5,49 +5,51 @@ import Pandora.Core (type (:.), type (:=), type (<-|), type (~>), (%)) import Pandora.Pattern ((.|..)) import Pandora.Pattern.Category (identity, (.), ($))-import Pandora.Pattern.Functor (Covariant ((<$>), (<$$>), (<$$$>)), Extractable (extract), Extendable ((=>>), (<<=$)), Comonad, (-|), (|-))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Pattern.Functor.Adjoint ((-|), (|-)) import Pandora.Paradigm.Primary.Functor (Product ((:*:)), type (:*:), attached)-import Pandora.Paradigm.Controlflow (Adaptable (adapt), Interpreted (Primary, run), Schematic, Comonadic (bring), (:<) (TC))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite), Schematic)+import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC)) import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>)) -newtype Store p a = Store ((:*:) p :. (->) p := a)+-- | Context based computation on value+newtype Store s a = Store ((:*:) s :. (->) s := a) -instance Covariant (Store p) where+instance Covariant (Store s) where f <$> Store x = Store $ f <$$> x -instance Extractable (Store p) where+instance Extractable (Store s) where extract = (|- ($)) . run -instance Extendable (Store p) where+instance Extendable (Store s) where Store x =>> f = Store $ f <$$> (Store .|.. (-| identity)) <$> x -instance Comonad (Store p) where+instance Comonad (Store s) where -instance Interpreted (Store p) where- type Primary (Store p) a = (:*:) p :. (->) p := a+instance Interpreted (Store s) where+ type Primary (Store s) a = (:*:) s :. (->) s := a run ~(Store x) = x+ unite = Store -type instance Schematic Comonad (Store p) = (:*:) p <:<.>:> (->) p+type instance Schematic Comonad (Store s) = (:*:) s <:<.>:> (->) s -instance Comonadic (Store p) where- bring (TC (TUT (p :*: f))) = Store $ p :*: extract f+instance Comonadic (Store s) where+ bring (TC (TUT (s :*: f))) = Store $ s :*: extract f type Storable s x = Adaptable x (Store s) -instance Covariant u => Covariant ((:*:) p <:<.>:> (->) p := u) where- f <$> TUT x = TUT $ f <$$$> x--instance Extractable u => Extractable ((:*:) p <:<.>:> (->) p := u) where- extract = (|- extract) . run--instance Extendable u => Extendable ((:*:) p <:<.>:> (->) p := u) where- TUT x =>> f = TUT $ x <<=$ (\x' -> f . TUT . (x' -| identity))-+-- | Get current index position :: Storable s t => t a -> s position = attached . run @(Store _) . adapt +-- | Given an index return value access :: Storable s t => s -> a <-| t-access p = extract % p . run @(Store _) . adapt+access s = extract % s . run @(Store _) . adapt -retrofit :: (p -> p) -> Store p ~> Store p-retrofit g (Store (p :*: f)) = Store $ g p :*: f+-- | Change index with function+retrofit :: (s -> s) -> Store s ~> Store s+retrofit g (Store (s :*: f)) = Store $ g s :*: f
Pandora/Paradigm/Primary/Functor.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Pandora.Paradigm.Primary.Functor (module Exports, note, hush, left, right, this, that, here, there) where+module Pandora.Paradigm.Primary.Functor (module Exports, note, hush, left, right, this, that, here, there, branches) where import Pandora.Paradigm.Primary.Functor.Fix as Exports import Pandora.Paradigm.Primary.Functor.Equivalence as Exports@@ -69,3 +69,9 @@ there Nowhere = Nothing there (Here _) = Nothing there (There x) = Just x++branches :: Maybe a -> Maybe a -> Wye a+branches (Just x) (Just y) = Both x y+branches Nothing (Just y) = Right y+branches (Just x) Nothing = Left x+branches Nothing Nothing = End
Pandora/Paradigm/Primary/Functor/Conclusion.hs view
@@ -2,7 +2,7 @@ import Pandora.Core.Functor (type (~>)) import Pandora.Pattern.Category (identity, (.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))@@ -15,7 +15,7 @@ import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False)) import Pandora.Paradigm.Primary.Object.Ordering (Ordering (Less, Greater))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))@@ -78,6 +78,7 @@ instance Interpreted (Conclusion e) where type Primary (Conclusion e) a = Conclusion e a run = identity+ unite = identity type instance Schematic Monad (Conclusion e) = (<.:>) (Conclusion e) @@ -85,20 +86,6 @@ wrap = TM . UT . point type Failable e = Adaptable (Conclusion e)--instance Covariant u => Covariant (Conclusion e <.:> u) where- f <$> UT x = UT $ f <$$> x--instance Applicative u => Applicative (Conclusion e <.:> u) where- UT f <*> UT x = UT $ (<*>) <$> f <*> x--instance Pointable u => Pointable (Conclusion e <.:> u) where- point = UT . point . point--instance (Pointable u, Bindable u) => Bindable (Conclusion e <.:> u) where- UT x >>= f = UT $ x >>= conclusion (point . Failure) (run . f)--instance Monad u => Monad (Conclusion e <.:> u) where failure :: Failable e t => e -> t a failure = adapt . Failure
Pandora/Paradigm/Primary/Functor/Maybe.hs view
@@ -2,11 +2,11 @@ import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Pattern.Category (identity, (.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))-import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), apply))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Monad (Monad)@@ -18,11 +18,11 @@ import Pandora.Pattern.Object.Lattice (Lattice) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Object.Ordering (Ordering (Less, Equal, Greater))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))-import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce, resolve))+import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce)) data Maybe a = Nothing | Just a @@ -90,33 +90,20 @@ instance Interpreted Maybe where type Primary Maybe a = Maybe a run = identity+ unite = identity instance Monadic Maybe where wrap = TM . UT . point -instance Monotonic (Maybe a) a where+instance Monotonic a (Maybe a) where reduce f r (Just x) = f x r reduce _ r Nothing = r -instance Monotonic (t a) a => Monotonic (Maybe :. t := a) a where+instance Monotonic a (t a) => Monotonic a (Maybe :. t := a) where reduce f r (Just x) = reduce f r x reduce _ r Nothing = r type Optional = Adaptable Maybe--instance Covariant u => Covariant (Maybe <.:> u) where- f <$> UT x = UT $ f <$$> x--instance Applicative u => Applicative (Maybe <.:> u) where- UT f <*> UT x = UT $ apply <$> f <*> x--instance Pointable u => Pointable (Maybe <.:> u) where- point = UT . point . point--instance (Pointable u, Bindable u) => Bindable (Maybe <.:> u) where- UT x >>= f = UT $ x >>= resolve (run . f) (point Nothing)--instance Monad u => Monad (Maybe <.:> u) where nothing :: Optional t => t a nothing = adapt Nothing
Pandora/Paradigm/Primary/Functor/Predicate.hs view
@@ -1,6 +1,6 @@ module Pandora.Paradigm.Primary.Functor.Predicate where -import Pandora.Core.Functor (type (|->))+import Pandora.Core.Functor (type (~>), type (|->)) import Pandora.Core.Morphism ((!)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))@@ -8,7 +8,7 @@ import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Object.Setoid (Setoid ((==)))-import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True), (?))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False), bool, (?)) newtype Predicate a = Predicate (a -> Boolean) @@ -23,3 +23,6 @@ satisfy :: (Pointable t, Avoidable t) => Predicate a -> a -> t a satisfy (Predicate p) x = p x ? point x $ empty++not :: Predicate ~> Predicate+not (Predicate p) = Predicate $ bool True False . p
Pandora/Paradigm/Primary/Object/Boolean.hs view
@@ -4,7 +4,6 @@ import Pandora.Pattern.Object.Ringoid (Ringoid ((*))) import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Pattern.Object.Quasiring (Quasiring (one))-import Pandora.Pattern.Object.Group (Group (invert)) infixr 1 ? @@ -31,7 +30,3 @@ instance Quasiring Boolean where one = True--instance Group Boolean where- invert False = True- invert True = False
Pandora/Paradigm/Primary/Transformer/Backwards.hs view
@@ -12,7 +12,7 @@ import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype Backwards t a = Backwards (t a) @@ -29,7 +29,7 @@ Backwards f <*> Backwards x = Backwards ((&) <$> x <*> f) instance Traversable t => Traversable (Backwards t) where- Backwards x ->> f = Backwards <$> x ->> f+ Backwards x ->> f = Backwards <$> (x ->> f) instance Distributive t => Distributive (Backwards t) where x >>- f = Backwards $ x >>- run . f@@ -40,6 +40,7 @@ instance Interpreted (Backwards t) where type Primary (Backwards t) a = t a run ~(Backwards x) = x+ unite = Backwards instance Liftable Backwards where lift = Backwards
Pandora/Paradigm/Primary/Transformer/Construction.hs view
@@ -19,8 +19,6 @@ import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Ringoid ((*)) import Pandora.Pattern.Object.Monoid (Monoid (zero))-import Pandora.Paradigm.Controlflow (run)-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>)) infixr 7 .-+ @@ -40,7 +38,7 @@ $ deconstruct f <**> deconstruct x instance Traversable t => Traversable (Construction t) where- x ->> f = Construct <$> f (extract x) <*> deconstruct x ->>> f+ x ->> f = Construct <$> f (extract x) <*> (deconstruct x ->>> f) instance Alternative t => Bindable (Construction t) where x >>= f = Construct (extract . f $ extract x)@@ -68,7 +66,7 @@ instance (Monoid a, forall b . Semigroup b => Monoid (t b), Covariant t) => Monoid (Construction t a) where zero = Construct zero zero -deconstruct :: Construction t a -> (t :. Construction t) a+deconstruct :: Construction t a -> t :. Construction t := a deconstruct ~(Construct _ xs) = xs -- Generate a construction from seed using effectful computation@@ -77,21 +75,3 @@ section :: Comonad t => t ~> Construction t section xs = Construct (extract xs) $ xs =>> section--instance (Covariant u, Covariant t) => Covariant (t <:.> Construction u) where- f <$> g = TU $ f <$$> run g--instance (Avoidable u, Pointable t) => Pointable (t <:.> Construction u) where- point x = TU . point . Construct x $ empty--instance (Applicative u, Applicative t) => Applicative (t <:.> Construction u) where- f <*> x = TU $ run f <**> run x--instance (Covariant u, Alternative t) => Alternative (t <:.> Construction u) where- x <+> y = TU $ run x <+> run y--instance (Covariant u, Avoidable t) => Avoidable (t <:.> Construction u) where- empty = TU empty--instance (Traversable u, Traversable t) => Traversable (t <:.> Construction u) where- g ->> f = TU <$> run g ->>> f
Pandora/Paradigm/Primary/Transformer/Instruction.hs view
@@ -39,7 +39,7 @@ instance Traversable t => Traversable (Instruction t) where Enter x ->> f = Enter <$> f x- Instruct xs ->> f = Instruct <$> xs ->>> f+ Instruct xs ->> f = Instruct <$> (xs ->>> f) instance Liftable Instruction where lift x = Instruct $ Enter <$> x
Pandora/Paradigm/Primary/Transformer/Jack.hs view
@@ -47,7 +47,7 @@ instance Traversable t => Traversable (Jack t) where It x ->> f = It <$> f x- Other y ->> f = Other <$> y ->> f+ Other y ->> f = Other <$> (y ->> f) instance Distributive t => Distributive (Jack t) where x >>- f = distribute $ f <$> x
Pandora/Paradigm/Primary/Transformer/Jet.hs view
@@ -13,7 +13,7 @@ f <$> Jet x xs = Jet (f x) (f <$$> xs) instance Traversable t => Traversable (Jet t) where- Jet x xs ->> f = Jet <$> f x <*> xs ->>> f+ Jet x xs ->> f = Jet <$> f x <*> (xs ->>> f) instance (forall u . Avoidable u) => Pointable (Jet t) where point x = Jet x empty
Pandora/Paradigm/Primary/Transformer/Kan.hs view
@@ -3,7 +3,7 @@ import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<))) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right)) data family Kan (v :: * -> k) (t :: * -> *) (u :: * -> *) b a@@ -16,6 +16,7 @@ instance Interpreted (Kan Left t u b) where type Primary (Kan Left t u b) a = (t b -> a) -> u b run ~(Lan x) = x+ unite = Lan data instance Kan Right t u b a = Ran ((a -> t b) -> u b) @@ -25,3 +26,4 @@ instance Interpreted (Kan Right t u b) where type Primary (Kan Right t u b) a = (a -> t b) -> u b run ~(Ran x) = x+ unite = Ran
Pandora/Paradigm/Primary/Transformer/Outline.hs view
@@ -8,7 +8,7 @@ import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) data Outline t a where Line :: a -> Outline t a@@ -36,7 +36,8 @@ hoist _ (Line x) = Line x hoist f (Outlined x y) = Outlined (f x) (hoist f y) -instance (Pointable t, Applicative t) => Interpreted (Outline t) where+instance (Extractable t, Pointable t, Applicative t) => Interpreted (Outline t) where type Primary (Outline t) a = t a run (Line x) = point x run (Outlined t f) = run f <*> t+ unite = Line . extract
Pandora/Paradigm/Primary/Transformer/Reverse.hs view
@@ -12,7 +12,7 @@ import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist)) import Pandora.Paradigm.Primary.Transformer.Backwards (Backwards (Backwards))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype Reverse t a = Reverse (t a) @@ -40,6 +40,7 @@ instance Interpreted (Reverse t) where type Primary (Reverse t) a = t a run ~(Reverse x) = x+ unite = Reverse instance Liftable Reverse where lift = Reverse
Pandora/Paradigm/Primary/Transformer/Tap.hs view
@@ -29,7 +29,7 @@ Tap f fs <*> Tap x xs = Tap (f x) $ fs <*> xs instance Traversable t => Traversable (Tap t) where- Tap x xs ->> f = Tap <$> f x <*> xs ->> f+ Tap x xs ->> f = Tap <$> f x <*> (xs ->> f) instance (Extractable t, Alternative t, Bindable t) => Bindable (Tap t) where Tap x xs >>= f = case f x of ~(Tap y ys) -> Tap y $ ys <+> (xs >>= lower . f)
Pandora/Paradigm/Schemes/TU.hs view
@@ -2,14 +2,20 @@ import Pandora.Core.Functor (type (:.), type (:=), type (~>)) import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>))) import Pandora.Pattern.Functor.Contravariant (Contravariant)+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), (<**>)))+import Pandora.Pattern.Functor.Alternative (Alternative ((<+>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>), (->>>)))+import Pandora.Pattern.Functor.Distributive (Distributive ((>>-)))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=), join)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype TU ct cu t u a = TU (t :. u := a) @@ -21,6 +27,31 @@ instance Interpreted (TU ct cu t u) where type Primary (TU ct cu t u) a = t :. u := a run ~(TU x) = x+ unite = TU++instance (Covariant t, Covariant u) => Covariant (t <:.> u) where+ f <$> x = TU $ f <$$> run x++instance (Applicative t, Applicative u) => Applicative (t <:.> u) where+ TU f <*> TU x = TU $ f <**> x++instance (Covariant u, Alternative t) => Alternative (t <:.> u) where+ x <+> y = TU $ run x <+> run y++instance (Covariant u, Avoidable t) => Avoidable (t <:.> u) where+ empty = TU empty++instance (Pointable t, Pointable u) => Pointable (t <:.> u) where+ point = TU . point . point++instance (Extractable t, Extractable u) => Extractable (t <:.> u) where+ extract = extract . extract . run++instance (Traversable t, Traversable u) => Traversable (t <:.> u) where+ x ->> f = TU <$> (run x ->>> f)++instance (Bindable t, Distributive t, Bindable u) => Bindable (t <:.> u) where+ TU x >>= f = TU $ x >>= \i -> join <$> i >>- run . f instance Pointable t => Liftable (TU Covariant Covariant t) where lift :: Covariant u => u ~> t <:.> u
Pandora/Paradigm/Schemes/TUT.hs view
@@ -1,14 +1,22 @@ module Pandora.Paradigm.Schemes.TUT where import Pandora.Core.Functor (type (:.), type (:=), type (~>))-import Pandora.Pattern.Category (identity, ($))-import Pandora.Pattern.Functor.Covariant (Covariant)+import Pandora.Pattern.Category (identity, (.), ($))+import Pandora.Pattern.Functor ((<*+>))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$$>))) import Pandora.Pattern.Functor.Contravariant (Contravariant)+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Alternative (Alternative ((<+>)))+import Pandora.Pattern.Functor.Avoidable (Avoidable (empty))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=), ($>>=)))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>), ($=>>))) import Pandora.Pattern.Functor.Distributive (Distributive ((>>-))) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype TUT ct ct' cu t t' u a = TUT (t :. u :. t' := a) @@ -24,6 +32,31 @@ instance Interpreted (TUT ct ct' cu t t' u) where type Primary (TUT ct ct' cu t t' u) a = t :. u :. t' := a run ~(TUT x) = x+ unite = TUT++instance (Covariant t, Covariant t', Covariant u) => Covariant (t <:<.>:> t' := u) where+ f <$> TUT x = TUT $ f <$$$> x++instance (Adjoint t' t, Bindable u) => Applicative (t <:<.>:> t' := u) where+ f <*> x = TUT $ (>>= (|- (<$$$> run x))) <$> run f++instance (Applicative t, Covariant t', Alternative u) => Alternative (t <:<.>:> t' := u) where+ x <+> y = TUT $ run x <*+> run y++instance (Pointable t, Applicative t, Covariant t', Avoidable u) => Avoidable (t <:<.>:> t' := u) where+ empty = TUT $ point empty++instance (Pointable u, Adjoint t' t) => Pointable (t <:<.>:> t' := u) where+ point = unite . (-| point)++instance (Adjoint t' t, Bindable u) => Bindable (t <:<.>:> t' := u) where+ x >>= f = TUT $ run x $>>= (|- run . f)++instance (Adjoint t' t, Extendable u) => Extendable (t' <:<.>:> t := u) where+ x =>> f = TUT $ run x $=>> (-| f . unite)++instance (Adjoint t t', Extractable u) => Extractable (t <:<.>:> t' := u) where+ extract = (|- extract) . run instance (Adjoint t' t, Distributive t) => Liftable (t <:<.>:> t') where lift :: Covariant u => u ~> t <:<.>:> t' := u
Pandora/Paradigm/Schemes/TUVW.hs view
@@ -1,10 +1,11 @@ module Pandora.Paradigm.Schemes.TUVW (TUVW (..)) where import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype TUVW ct cu cv cw t u v w a = TUVW (t :. u :. v :. w := a) instance Interpreted (TUVW ct cu cv cw t u v w) where type Primary (TUVW ct cu cv cw t u v w) a = t :. u :. v :. w := a run ~(TUVW x) = x+ unite = TUVW
Pandora/Paradigm/Schemes/T_.hs view
@@ -1,10 +1,11 @@ module Pandora.Paradigm.Schemes.T_ where import Pandora.Paradigm.Primary.Functor.Product (type (:*:))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype T_ ct t a = T_ (a :*: t a) instance Interpreted (T_ ct t) where type Primary (T_ ct t) a = a :*: t a run ~(T_ x) = x+ unite = T_
Pandora/Paradigm/Schemes/T_U.hs view
@@ -9,27 +9,28 @@ import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype T_U ct cu t u a = T_U (t a :*: u a) -type (<:.:>) = T_U Covariant Covariant-type (>:.:>) = T_U Contravariant Covariant-type (<:.:<) = T_U Covariant Contravariant-type (>:.:<) = T_U Contravariant Contravariant+type (<:*:>) = T_U Covariant Covariant+type (>:*:>) = T_U Contravariant Covariant+type (<:*:<) = T_U Covariant Contravariant+type (>:*:<) = T_U Contravariant Contravariant instance Interpreted (T_U ct cu t u) where type Primary (T_U ct cu t u) a = t a :*: u a run ~(T_U x) = x+ unite = T_U instance Avoidable t => Liftable (T_U Covariant Covariant t) where- lift :: Covariant u => u ~> t <:.:> u+ lift :: Covariant u => u ~> t <:*:> u lift x = T_U $ empty :*: x instance Lowerable (T_U Covariant Covariant t) where- lower :: t <:.:> u ~> u+ lower :: t <:*:> u ~> u lower ~(T_U (_ :*: y)) = y instance Covariant t => Hoistable (T_U Covariant Covariant t) where- hoist :: u ~> v -> (t <:.:> u ~> t <:.:> v)+ hoist :: u ~> v -> (t <:*:> u ~> t <:*:> v) hoist f (T_U (x :*: y)) = T_U $ x :*: f y
Pandora/Paradigm/Schemes/UT.hs view
@@ -1,14 +1,18 @@ module Pandora.Paradigm.Schemes.UT where import Pandora.Core.Functor (type (:.), type (:=), type (~>))-import Pandora.Pattern.Category (($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>))) import Pandora.Pattern.Functor.Contravariant (Contravariant)+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>), (<**>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=), join)) import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype UT ct cu t u a = UT (u :. t := a) @@ -20,6 +24,22 @@ instance Interpreted (UT ct cu t u) where type Primary (UT ct cu t u) a = u :. t := a run ~(UT x) = x+ unite = UT++instance (Covariant t, Covariant u) => Covariant (t <.:> u) where+ f <$> UT x = UT $ f <$$> x++instance (Applicative t, Applicative u) => Applicative (t <.:> u) where+ UT f <*> UT x = UT $ f <**> x++instance (Pointable t, Pointable u) => Pointable (t <.:> u) where+ point = UT . point . point++instance (Traversable t, Bindable t, Applicative u, Monad u) => Bindable (t <.:> u) where+ UT x >>= f = UT $ x >>= \i -> join <$> (i ->> run . f)++instance (Extractable t, Extractable u) => Extractable (t <.:> u) where+ extract = extract . extract . run instance Pointable t => Liftable (UT Covariant Covariant t) where lift :: Covariant u => u ~> t <.:> u
Pandora/Paradigm/Schemes/UTU.hs view
@@ -3,7 +3,7 @@ import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Pattern.Functor.Covariant (Covariant) import Pandora.Pattern.Functor.Contravariant (Contravariant)-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype UTU ct cu t u u' a = UTU (u :. t :. u' := a) @@ -19,3 +19,4 @@ instance Interpreted (UTU ct cu t u u') where type Primary (UTU ct cu t u u') a = u :. t :. u' := a run ~(UTU x) = x+ unite = UTU
Pandora/Paradigm/Schemes/U_T.hs view
@@ -9,7 +9,7 @@ import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype U_T ct cu t u a = U_T (u a :*: t a) @@ -21,6 +21,7 @@ instance Interpreted (U_T ct cu t u) where type Primary (U_T ct cu t u) a = u a :*: t a run ~(U_T x) = x+ unite = U_T instance Avoidable t => Liftable (U_T Covariant Covariant t) where lift :: Covariant u => u ~> t <.:.> u
Pandora/Paradigm/Structure.hs view
@@ -11,18 +11,24 @@ import Pandora.Paradigm.Structure.Stream as Exports import Pandora.Pattern (($), (.), extract)-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, unite) import Pandora.Paradigm.Inventory (Store (Store), (^.), (.~))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Functor.Delta (Delta ((:^:)))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right)) import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap)) import Pandora.Paradigm.Schemes.TU (type (<:.>)) -instance Monotonic a s => Monotonic (s :*: a) s where+instance Monotonic s a => Monotonic s (s :*: a) where reduce f r x = reduce f (f (attached x) r) $ extract x +instance Nullable Maybe where+ null = Predicate $ \case { Just _ -> True ; _ -> False }+ instance Substructure Left (Product s) where type Substructural Left (Product s) a = s substructure (extract -> s :*: x) = Store $ s :*: Tag . (:*: x)@@ -38,6 +44,14 @@ instance Substructure Right Delta where type Substructural Right Delta a = a substructure (extract -> l :^: r) = Store $ r :*: Tag . (l :^:)++instance Substructure Left (Delta <:.> t) where+ type Substructural Left (Delta <:.> t) a = t a+ substructure (run . extract -> l :^: r) = Store $ r :*: Tag . unite . (l :^:)++instance Substructure Right (Delta <:.> t) where+ type Substructural Right (Delta <:.> t) a = t a+ substructure (run . extract -> l :^: r) = Store $ l :*: Tag . unite . (:^: r) instance Substructure Left t => Substructure Left (Tap (t <:.> u)) where type Substructural Left (Tap (t <:.> u)) a = Substructural Left t (u a)
Pandora/Paradigm/Structure/Ability.hs view
@@ -6,5 +6,6 @@ import Pandora.Paradigm.Structure.Ability.Rotatable as Exports import Pandora.Paradigm.Structure.Ability.Insertable as Exports import Pandora.Paradigm.Structure.Ability.Focusable as Exports+import Pandora.Paradigm.Structure.Ability.Nullable as Exports import Pandora.Paradigm.Structure.Ability.Nonempty as Exports import Pandora.Paradigm.Structure.Ability.Comprehension as Exports
Pandora/Paradigm/Structure/Ability/Comprehension.hs view
@@ -3,22 +3,37 @@ module Pandora.Paradigm.Structure.Ability.Comprehension where import Pandora.Core.Functor (type (:=))+import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Avoidable (Avoidable (empty))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite)) newtype Comprehension t a = Comprehension (t <:.> Construction t := a) instance Interpreted (Comprehension t) where type Primary (Comprehension t) a = t <:.> Construction t := a run ~(Comprehension x) = x+ unite = Comprehension instance Covariant (t <:.> Construction t) => Covariant (Comprehension t) where f <$> Comprehension x = Comprehension $ f <$> x++instance (Avoidable t, Pointable t) => Pointable (Comprehension t) where+ point = Comprehension . TU . point . Construct % empty++instance Traversable (t <:.> Construction t) => Traversable (Comprehension t) where+ Comprehension x ->> f = Comprehension <$> (x ->> f)++instance (forall a . Semigroup (t <:.> Construction t := a), Bindable t, Pointable t, Avoidable t) => Applicative (Comprehension t) where+ fs <*> xs = fs >>= \f -> xs >>= Comprehension . TU . point . point . f instance (forall a . Semigroup (t <:.> Construction t := a), Bindable t) => Bindable (Comprehension t) where Comprehension (TU t) >>= f = Comprehension . TU $ t >>= \(Construct x xs) -> run $ run (f x) + run (Comprehension (TU xs) >>= f)
Pandora/Paradigm/Structure/Ability/Monotonic.hs view
@@ -7,7 +7,7 @@ import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate, satisfy) -class Monotonic e a where+class Monotonic a e where {-# MINIMAL reduce #-} reduce :: (a -> r -> r) -> r -> e -> r @@ -18,5 +18,5 @@ instance Monotonic a a where reduce f r x = f x r -find :: (Monotonic e a, Pointable t, Avoidable t) => Predicate a -> e -> t a+find :: (Monotonic a e, Pointable t, Avoidable t) => Predicate a -> e -> t a find p struct = reduce (\x r -> r <+> satisfy p x) empty struct
+ Pandora/Paradigm/Structure/Ability/Nullable.hs view
@@ -0,0 +1,7 @@+module Pandora.Paradigm.Structure.Ability.Nullable where++import Pandora.Core.Functor (type (:.), type (:=))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate)++class Nullable t where+ null :: Predicate :. t := a
Pandora/Paradigm/Structure/Binary.hs view
@@ -10,17 +10,20 @@ import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Object.Chain (Chain ((<=>)))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Object.Ordering (order) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:))) import Pandora.Paradigm.Primary.Functor.Wye (Wye (End, Left, Right, Both)) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)-import Pandora.Paradigm.Schemes (TU (TU), T_ (T_), T_U (T_U), type (<:.>), type (<:.:>))+import Pandora.Paradigm.Schemes (TU (TU), T_ (T_), T_U (T_U), type (<:.>), type (<:*:>)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run) import Pandora.Paradigm.Inventory.Store (Store (Store)) import Pandora.Paradigm.Inventory.Optics (type (:-.), (|>), (%~)) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)+import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Focusable (Focusable (Focusing, focusing), Location (Root)) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve)) import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert))@@ -46,6 +49,9 @@ focusing (run . extract -> Nothing) = Store $ Nothing :*: Tag . TU . comap (Construct % End) focusing (run . extract -> Just x) = Store $ Just (extract x) :*: Tag . lift . resolve (Construct % deconstruct x) (rebalance $ deconstruct x) +instance Nullable Binary where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }+ instance Substructure Left Binary where type Substructural Left Binary a = Binary a substructure empty_tree@(run . extract -> Nothing) = Store $ extract empty_tree :*: (!) empty_tree@@ -71,27 +77,27 @@ instance Substructure Left (Construction Wye) where type Substructural Left (Construction Wye) a = Maybe :. Construction Wye := a- substructure empty_tree@(extract -> Construct _ End) = Store $ Nothing :*: (!) empty_tree- substructure (extract -> Construct x (Left lst)) = Store $ Just lst :*: Tag . Construct x . resolve (Left) End+ substructure empty_tree@(extract -> Construct _ End) = Store $ Nothing :*: (empty_tree !)+ substructure (extract -> Construct x (Left lst)) = Store $ Just lst :*: Tag . Construct x . resolve Left End substructure (extract -> Construct x (Right rst)) = Store $ Nothing :*: Tag . Construct x . resolve (Both % rst) (Right rst) substructure (extract -> Construct x (Both lst rst)) = Store $ Just lst :*: Tag . Construct x . resolve (Both % rst) (Right rst) instance Substructure Right (Construction Wye) where type Substructural Right (Construction Wye) a = Maybe :. Construction Wye := a- substructure emtpy_tree@(extract -> Construct _ End) = Store $ Nothing :*: (!) emtpy_tree+ substructure emtpy_tree@(extract -> Construct _ End) = Store $ Nothing :*: (emtpy_tree !) substructure (extract -> Construct x (Left lst)) = Store $ Nothing :*: Tag . Construct x . resolve (Both lst) (Left lst)- substructure (extract -> Construct x (Right rst)) = Store $ Just rst :*: Tag . Construct x . resolve (Right) End+ substructure (extract -> Construct x (Right rst)) = Store $ Just rst :*: Tag . Construct x . resolve Right End substructure (extract -> Construct x (Both lst rst)) = Store $ Just rst :*: Tag . Construct x . resolve (Both lst) (Left lst) data Biforked a = Top | Leftward a | Rightward a -type instance Zipper (Construction Wye) = Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))+type instance Zipper (Construction Wye) = Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)) -data Direction a = Up a | Down a+data Vertical a = Up a | Down a -instance Rotatable Up (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Rotational Up (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a- = Maybe :. (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a+instance Rotatable Up (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where+ type Rotational Up (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a+ = Maybe :. (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a rotation (run . extract -> focused :*: TU (TU (Leftward (Construct (T_ (parent :*: TU (Just rst))) next)))) = Just . T_U $ Construct parent (Both focused rst) :*: TU (TU next) rotation (run . extract -> focused :*: TU (TU (Leftward (Construct (T_ (parent :*: TU Nothing)) next)))) =@@ -102,17 +108,17 @@ Just . T_U $ Construct parent (Right focused) :*: TU (TU next) rotation (extract -> T_U (_ :*: TU (TU Top))) = Nothing -instance Rotatable (Down Left) (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Rotational (Down Left) (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a- = Maybe :. (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a+instance Rotatable (Down Left) (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where+ type Rotational (Down Left) (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a+ = Maybe :. (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a rotation (run . extract -> Construct x (Left lst) :*: TU (TU next)) = Just . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_ $ x :*: TU Nothing) $ next rotation (run . extract -> Construct x (Both lst rst) :*: TU (TU next)) = Just . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_ $ x :*: TU (Just rst)) $ next rotation (run . extract -> Construct _ (Right _) :*: _) = Nothing rotation (run . extract -> Construct _ End :*: _) = Nothing -instance Rotatable (Down Right) (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Rotational (Down Right) (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a- = Maybe :. (Construction Wye <:.:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a+instance Rotatable (Down Right) (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where+ type Rotational (Down Right) (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) a+ = Maybe :. (Construction Wye <:*:> ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) := a rotation (run . extract -> Construct x (Right rst) :*: TU (TU next)) = Just . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_ $ x :*: TU Nothing) $ next rotation (run . extract -> Construct x (Both lst rst) :*: TU (TU next)) = Just . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_ $ x :*: TU (Just lst)) $ next rotation (run . extract -> Construct _ (Left _) :*: _) = Nothing
Pandora/Paradigm/Structure/Interface/Set.hs view
@@ -15,10 +15,10 @@ import Pandora.Paradigm.Inventory.State (State, modify) import Pandora.Paradigm.Controlflow.Effect (run) -member :: forall e a . (Setoid a, Monotonic e a) => a -> e -> Boolean-member x = reduce @(Maybe a) @a (\_ _ -> True) False . find (equate x)+member :: forall e a . (Setoid a, Monotonic a e) => a -> e -> Boolean+member x = reduce @a @(Maybe a) (\_ _ -> True) False . find (equate x) -subset :: (Monotonic (t a) a, Traversable t, Setoid a, Setoid (t a)) => t a -> t a -> Boolean+subset :: (Monotonic a (t a), Traversable t, Setoid a, Setoid (t a)) => t a -> t a -> Boolean subset ss s = Nothing /= (ss ->> find % s . equate) cardinality :: Traversable t => t a -> Natural
Pandora/Paradigm/Structure/Rose.hs view
@@ -9,7 +9,9 @@ import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Transformer.Liftable (lift)+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:))) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)@@ -19,6 +21,7 @@ import Pandora.Paradigm.Structure.Ability.Focusable (Focusable (Focusing, focusing), Location (Root)) import Pandora.Paradigm.Structure.Ability.Monotonic (resolve) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)+import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure)) import Pandora.Paradigm.Structure.Stack (Stack) @@ -30,6 +33,9 @@ focusing (run . extract -> Just rose) = Store $ Just (extract rose) :*: Tag . resolve (lift . Construct % deconstruct rose) (TU Nothing) +instance Nullable Rose where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }+ instance Substructure Just Rose where type Substructural Just Rose a = Stack :. Construction Stack := a substructure (run . extract -> Nothing) = Store $ TU Nothing :*: (Tag (TU Nothing) !)@@ -43,4 +49,4 @@ instance Substructure Just (Construction Stack) where type Substructural Just (Construction Stack) a = Stack :. Construction Stack := a- substructure (Tag (Construct x xs)) = Store $ xs :*: Tag . Construct x+ substructure (extract -> Construct x xs) = Store $ xs :*: Tag . Construct x
Pandora/Paradigm/Structure/Splay.hs view
@@ -2,15 +2,16 @@ module Pandora.Paradigm.Structure.Splay where +import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))-import Pandora.Paradigm.Primary.Functor (left, right)-import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))-import Pandora.Paradigm.Primary.Functor.Wye (Wye (End, Left, Right, Both))-import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag))+import Pandora.Paradigm.Primary.Functor (left, right, branches)+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))+import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))+import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag), type (:#)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct) import Pandora.Paradigm.Inventory.Optics ((%~)) import Pandora.Paradigm.Structure.Ability.Rotatable (Rotatable (Rotational, rotation), rotate)@@ -21,24 +22,31 @@ instance Rotatable (Left Zig) (Construction Wye) where type Rotational (Left Zig) (Construction Wye) a = Maybe (Construction Wye a)- rotation (Tag (Construct parent st)) = Construct % subtree <$> found where+ rotation :: forall a . Left Zig :# Construction Wye a -> Maybe :. Construction Wye := a+ rotation (extract -> Construct parent st) = Construct % subtree <$> found where - subtree = maybe_subtree a . Just . Construct parent $ maybe_subtree b c+ found :: Maybe a found = extract <$> left st- a = deconstruct <$> left st >>= left- b = deconstruct <$> left st >>= right- c = right st + subtree :: Wye :. Construction Wye := a+ subtree = branches (deconstruct <$> left st >>= left)+ . Just . Construct parent $ branches+ (deconstruct <$> left st >>= right) (right st)+ instance Rotatable (Right Zig) (Construction Wye) where type Rotational (Right Zig) (Construction Wye) a = Maybe (Construction Wye a)- rotation (Tag (Construct parent st)) = Construct % subtree <$> found where+ rotation :: forall a . Right Zig :# Construction Wye a -> Maybe :. Construction Wye := a+ rotation (extract -> Construct parent st) = Construct % subtree <$> found where + found :: Maybe a found = extract <$> right st- subtree = maybe_subtree a . Just . Construct parent $ maybe_subtree b c- a = left st- b = deconstruct <$> right st >>= left- c = deconstruct <$> right st >>= right + subtree :: Wye :. Construction Wye := a+ subtree = branches (left st)+ . Just . Construct parent $ branches+ (deconstruct <$> right st >>= left)+ (deconstruct <$> right st >>= right)+ instance Rotatable (Left (Zig Zig)) (Construction Wye) where type Rotational (Left (Zig Zig)) (Construction Wye) a = Maybe (Construction Wye a) rotation (Tag tree) = rotate @(Left Zig) tree >>= rotate @(Left Zig)@@ -54,9 +62,3 @@ instance Rotatable (Right (Zig Zag)) (Construction Wye) where type Rotational (Right (Zig Zag)) (Construction Wye) a = Maybe (Construction Wye a) rotation (Tag tree) = rotate @(Right Zig) $ sub @Right %~ (>>= rotate @(Left Zig)) $ tree--maybe_subtree :: Maybe a -> Maybe a -> Wye a-maybe_subtree (Just x) (Just y) = Both x y-maybe_subtree Nothing (Just y) = Right y-maybe_subtree (Just x) Nothing = Left x-maybe_subtree Nothing Nothing = End
Pandora/Paradigm/Structure/Stack.hs view
@@ -12,18 +12,19 @@ import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Traversable (Traversable) import Pandora.Pattern.Functor.Bindable ((>>=))+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Monoid (Monoid (zero))-import Pandora.Paradigm.Primary.Object.Boolean ((?))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False), (?)) import Pandora.Paradigm.Primary.Functor.Delta (Delta ((:^:))) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:))) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))-import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)+import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct, (.-+)) import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap)) import Pandora.Paradigm.Inventory.State (State, fold) import Pandora.Paradigm.Inventory.Store (Store (Store))@@ -31,11 +32,12 @@ import Pandora.Paradigm.Controlflow.Effect.Interpreted (run) import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>)) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)+import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Zipper (Zipper) import Pandora.Paradigm.Structure.Ability.Focusable (Focusable (Focusing, focusing), Location (Head), focus) import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert)) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce))-import Pandora.Paradigm.Structure.Ability.Rotatable (Rotatable (Rotational, rotation))+import Pandora.Paradigm.Structure.Ability.Rotatable (Rotatable (Rotational, rotation), rotate) -- | Linear data structure that serves as a collection of elements type Stack = Maybe <:.> Construction Maybe@@ -60,6 +62,9 @@ instance Insertable Stack where insert x (TU stack) = TU $ (Construct x . Just <$> stack) <+> (point . point) x +instance Nullable Stack where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }+ pop :: Stack ~> Stack pop (TU stack) = TU $ stack >>= deconstruct @@ -86,11 +91,15 @@ instance Insertable (Construction Maybe) where insert x = Construct x . Just -instance Monotonic (Construction Maybe a) a where+instance Monotonic a (Construction Maybe a) where reduce f r ~(Construct x xs) = f x $ reduce f r xs type instance Zipper Stack = Tap (Delta <:.> Stack) +instance {-# OVERLAPS #-} Extendable (Tap (Delta <:.> Stack)) where+ z =>> f = let move rtt = TU . deconstruct $ rtt .-+ z+ in f <$> Tap z (TU $ move (rotate @Left) :^: move (rotate @Right))+ instance Rotatable Left (Tap (Delta <:.> Stack)) where type Rotational Left (Tap (Delta <:.> Stack)) a = Maybe :. Zipper Stack := a rotation (extract -> Tap x (TU (bs :^: fs))) = Tap % (TU $ pop bs :^: insert x fs) <$> focus @Head ^. bs@@ -109,5 +118,5 @@ type Rotational Right (Tap (Delta <:.> Construction Maybe)) a = Maybe :. Zipper (Construction Maybe) := a rotation (extract -> Tap x (TU (bs :^: fs))) = Tap (extract fs) . TU . (insert x bs :^:) <$> deconstruct fs -instance Monotonic (Maybe <:.> Construction Maybe := a) a where- reduce f r ~(TU x) = reduce f r x+instance Monotonic a (Maybe <:.> Construction Maybe := a) where+ reduce f r = reduce f r . run
Pandora/Paradigm/Structure/Stream.hs view
@@ -2,6 +2,7 @@ module Pandora.Paradigm.Structure.Stream where +import Pandora.Core.Functor (type (|->)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant ((<$>)) import Pandora.Pattern.Functor.Pointable (point)@@ -31,9 +32,8 @@ $ Construct x (point bs) :^: extract (deconstruct fs) instance {-# OVERLAPS #-} Extendable (Tap (Delta <:.> Stream)) where- -- z =>> f = let move rtt = extract . deconstruct $ iterate (point . rtt) z z =>> f = let move rtt = extract . deconstruct $ point . rtt .-+ z in f <$> Tap z (TU $ move (rotate @Left) :^: move (rotate @Right)) -repeat :: a -> Stream a+repeat :: a |-> Stream repeat x = Construct x . Identity $ repeat x
Pandora/Pattern.hs view
@@ -7,6 +7,8 @@ import Pandora.Core.Functor (type (:.), type (:=)) +infixr 7 .|.., .|..., .|....+ (.|..) :: (Category v, Covariant (v a)) => v c d -> v a :. v b := c -> v a :. v b := d f .|.. g = (f .) <$> g
Pandora/Pattern/Functor/Adjoint.hs view
@@ -2,11 +2,11 @@ import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Pattern.Category (identity)-import Pandora.Pattern.Functor.Covariant (Covariant)+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) type (-|) = Adjoint -infixl 3 -|, |-+infixl 3 -|, |-, -|$, $|- {- | > When providing a new instance, you should ensure it satisfies the four laws:@@ -35,3 +35,9 @@ -- | Also known as 'counit' epsilon :: t :. u := a -> a epsilon = psi identity++ (-|$) :: Covariant v => v a -> (t a -> b) -> v (u b)+ x -|$ f = (-| f) <$> x++ ($|-) :: Covariant v => v (t a) -> (a -> u b) -> v b+ x $|- f = (|- f) <$> x
Pandora/Pattern/Functor/Applicative.hs view
@@ -5,6 +5,9 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$))) infixl 4 <*>, <*, *>+infixl 3 <**>+infixl 2 <***>+infixl 1 <****> {- | > When providing a new instance, you should ensure it satisfies the three laws:
Pandora/Pattern/Functor/Bindable.hs view
@@ -34,9 +34,8 @@ (<=<) :: (b -> t c) -> (a -> t b) -> (a -> t c) (<=<) = (%) (>=>) - -- | Experimental methods- ($>>=) :: Covariant u => (a -> t b) -> u :. t := a -> u :. t := b- f $>>= x = (>>= f) <$> x+ ($>>=) :: Covariant u => u :. t := a -> (a -> t b) -> u :. t := b+ x $>>= f = (>>= f) <$> x (<>>=) :: (t b -> c) -> (a -> t b) -> t a -> c f <>>= g = f <$> (>>= g)
Pandora/Pattern/Functor/Covariant.hs view
@@ -5,6 +5,14 @@ import Pandora.Pattern.Category (Category ((.))) infixl 4 <$>, <$, $>+infixl 3 <$$>+infixl 2 <$$$>+infixl 1 <$$$$>++infixl 1 <&>+infixl 2 <&&>+infixl 3 <&&&>+infixl 4 <&&&&> {- | > When providing a new instance, you should ensure it satisfies the two laws:
Pandora/Pattern/Functor/Extendable.hs view
@@ -36,7 +36,7 @@ f =>= g = g . extend f -- | Experimental methods- ($=>>) :: Covariant u => (t a -> b) -> u :. t := a -> u :. t := b- f $=>> x = (=>> f) <$> x+ ($=>>) :: Covariant u => u :. t := a -> (t a -> b) -> u :. t := b+ x $=>> f = (=>> f) <$> x (<<=$) :: Covariant u => u :. t := a -> (t a -> b) -> u :. t := b x <<=$ f = (=>> f) <$> x
Pandora/Pattern/Functor/Traversable.hs view
@@ -17,7 +17,7 @@ > * Preserving apply: f (x <*> y) ≡ f x <*> f y -} -infixl 5 ->>, ->>>, ->>>>, ->>>>>+infixl 3 ->>, ->>>, ->>>>, ->>>>> class Covariant t => Traversable t where {-# MINIMAL (->>) #-}
Pandora/Pattern/Object/Chain.hs view
@@ -4,6 +4,8 @@ import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Object.Ordering (Ordering, order) +infixl 4 <=>, <, <=, >=, >+ {- | > When providing a new instance, you should ensure it satisfies the three laws: > * Reflexivity: x <= x ≡ True
Pandora/Pattern/Object/Group.hs view
@@ -1,13 +1,19 @@ module Pandora.Pattern.Object.Group (Group (..)) where -import Pandora.Pattern.Object.Quasiring (Quasiring)+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Pattern.Object.Monoid (Monoid) +infixl 6 -+ {- | > When providing a new instance, you should ensure it satisfies the two laws:-> * Right absorption: x * invert x ≡ zero-> * Left absorption: invert x * x ≡ zero+> * Right absorption: x + invert x ≡ zero+> * Left absorption: invert x + x ≡ zero -} -class Quasiring a => Group a where+class Monoid a => Group a where {-# MINIMAL invert #-} invert :: a -> a++ (-) :: a -> a -> a+ x - y = x + invert y
Pandora/Pattern/Object/Setoid.hs view
@@ -1,7 +1,7 @@ module Pandora.Pattern.Object.Setoid (Setoid (..)) where -import Pandora.Pattern.Object.Group (invert)-import Pandora.Paradigm.Primary.Object.Boolean (Boolean)+import Pandora.Pattern.Category (($))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False, True), bool) infix 4 ==, /= @@ -10,7 +10,7 @@ > * Reflexivity: x == x ≡ True > * Symmetry: x == y ≡ y == x > * Transitivity: x == y * y == z ≡ True ===> x == z ≡ True-> * Negation: x /= y ≡ not (x == y)+> * Negation: x /= y ≡ invert (x == y) -} class Setoid a where@@ -18,4 +18,5 @@ (==) :: a -> a -> Boolean (/=) :: a -> a -> Boolean- (/=) x y = invert (x == y)+ -- (/=) x y = (x == y ? False) True+ (/=) x y = bool True False $ x == y
pandora.cabal view
@@ -1,5 +1,5 @@ name: pandora-version: 0.3.3+version: 0.3.4 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@@ -106,6 +106,7 @@ Pandora.Paradigm.Structure.Ability.Rotatable Pandora.Paradigm.Structure.Ability.Substructure Pandora.Paradigm.Structure.Ability.Nonempty+ Pandora.Paradigm.Structure.Ability.Nullable Pandora.Paradigm.Structure.Ability.Zipper Pandora.Paradigm.Structure.Ability.Monotonic Pandora.Paradigm.Structure.Interface