pandora 0.3.6 → 0.3.7
raw patch · 40 files changed
+781/−631 lines, 40 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Pandora.Paradigm.Primary.Functor: here :: Wedge e a -> Maybe e
- Pandora.Paradigm.Primary.Functor: hush :: Conclusion e ~> Maybe
- Pandora.Paradigm.Primary.Functor: left :: Wye ~> Maybe
- Pandora.Paradigm.Primary.Functor: note :: e -> Maybe ~> Conclusion e
- Pandora.Paradigm.Primary.Functor: right :: Wye ~> Maybe
- Pandora.Paradigm.Primary.Functor: that :: These e a -> Maybe e
- Pandora.Paradigm.Primary.Functor: there :: Wedge e ~> Maybe
- Pandora.Paradigm.Primary.Functor: this :: These e ~> Maybe
- Pandora.Paradigm.Schemes.T_: T_ :: (a :*: t a) -> T_ ct t a
- Pandora.Paradigm.Schemes.T_: instance forall k (ct :: k) (t :: * -> *). Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Schemes.T_.T_ ct t)
- Pandora.Paradigm.Schemes.T_: newtype T_ ct t a
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable 'Pandora.Paradigm.Structure.Ability.Morphable.Inorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable 'Pandora.Paradigm.Structure.Ability.Morphable.Postorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable 'Pandora.Paradigm.Structure.Ability.Morphable.Preorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure: instance forall k (o :: k). Pandora.Paradigm.Structure.Ability.Morphable.Morphable o (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) => Pandora.Paradigm.Structure.Ability.Morphable.Morphable o Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Ability.Comprehension: Comprehension :: ((t <:.> Construction t) := a) -> Comprehension t a
- 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.Bindable.Bindable (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.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Structure.Ability.Comprehension.Comprehension t)
- Pandora.Paradigm.Structure.Ability.Comprehension: instance Pandora.Pattern.Functor.Covariant.Covariant (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction t) => Pandora.Pattern.Functor.Covariant.Covariant (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.Comprehension: newtype Comprehension t a
- Pandora.Paradigm.Structure.Ability.Deletable: delete :: (Deletable t, Setoid a) => a -> t a -> t a
- Pandora.Paradigm.Structure.Ability.Insertable: insert :: Insertable t => a -> t a -> t a
- Pandora.Paradigm.Structure.Binary: Down :: a -> Vertical a
- Pandora.Paradigm.Structure.Binary: Leftward :: a -> Biforked a
- Pandora.Paradigm.Structure.Binary: Rightward :: a -> Biforked a
- Pandora.Paradigm.Structure.Binary: Top :: Biforked a
- Pandora.Paradigm.Structure.Binary: Up :: a -> Vertical a
- Pandora.Paradigm.Structure.Binary: binary :: forall t a. (Traversable t, Chain a) => t a -> Binary a
- Pandora.Paradigm.Structure.Binary: data Biforked a
- Pandora.Paradigm.Structure.Binary: data Vertical a
- Pandora.Paradigm.Structure.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Insertable.Insertable (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Insertable.Insertable Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable 'Pandora.Paradigm.Structure.Binary.Up (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((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.Morphable.Morphable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((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.Morphable.Morphable ('Pandora.Paradigm.Structure.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((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.Nullable.Nullable Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: rebalance :: Chain a => ((Wye :. Construction Wye) := a) -> Nonempty Binary a
- Pandora.Paradigm.Structure.Binary: type Binary = Maybe <:.> Construction Wye
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Stack.Stack)
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root Pandora.Paradigm.Structure.Rose.Rose
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Rose.Rose
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Stack.Stack)
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just Pandora.Paradigm.Structure.Rose.Rose
- Pandora.Paradigm.Structure.Rose: type Rose = Maybe <:.> Construction Stack
- Pandora.Paradigm.Structure.Splay: Zag :: a -> Splay a
- Pandora.Paradigm.Structure.Splay: Zig :: a -> Splay a
- Pandora.Paradigm.Structure.Splay: data Splay a
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Left 'Pandora.Paradigm.Structure.Splay.Zig) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Left ('Pandora.Paradigm.Structure.Splay.Zig 'Pandora.Paradigm.Structure.Splay.Zag)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Left ('Pandora.Paradigm.Structure.Splay.Zig 'Pandora.Paradigm.Structure.Splay.Zig)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Right 'Pandora.Paradigm.Structure.Splay.Zig) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Right ('Pandora.Paradigm.Structure.Splay.Zig 'Pandora.Paradigm.Structure.Splay.Zag)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Primary.Functor.Wye.Right ('Pandora.Paradigm.Structure.Splay.Zig 'Pandora.Paradigm.Structure.Splay.Zig)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Stack: filter :: forall a. Predicate a -> Stack a -> Stack a
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Deletable.Deletable Pandora.Paradigm.Structure.Stack.Stack
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Head (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Head Pandora.Paradigm.Structure.Stack.Stack
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Insertable.Insertable (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Insertable.Insertable Pandora.Paradigm.Structure.Stack.Stack
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length Pandora.Paradigm.Structure.Stack.Stack
- 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.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stack.Stack))
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stack.Stack))
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable Pandora.Paradigm.Structure.Stack.Stack (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Stack.Stack
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail 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.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stack.Stack))
- Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Monoid.Monoid (Pandora.Paradigm.Structure.Stack.Stack a)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe a)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Structure.Stack.Stack a)
- Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Setoid.Setoid a => Pandora.Pattern.Object.Setoid.Setoid (Pandora.Paradigm.Structure.Stack.Stack a)
- Pandora.Paradigm.Structure.Stack: linearize :: forall t a. Traversable t => t a -> Stack a
- Pandora.Paradigm.Structure.Stack: type Stack = Maybe <:.> Construction Maybe
- Pandora.Paradigm.Structure.Stream: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stream.Stream))
- Pandora.Paradigm.Structure.Stream: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stream.Stream))
- Pandora.Paradigm.Structure.Stream: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Stream.Stream))
- Pandora.Paradigm.Structure.Stream: repeat :: a :=> Stream
- Pandora.Paradigm.Structure.Stream: type Stream = Construction Identity
- Pandora.Pattern.Object.Setoid: (/=) :: Setoid a => a -> a -> Boolean
+ Pandora.Core.Functor: type t ~~> u = forall a b. t a b -> u a b
+ Pandora.Paradigm.Controlflow.Effect.Interpreted: (=||) :: Interpreted t => (t a -> t b) -> Primary t a -> Primary t b
+ Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Inventory.Equipment.Equipment e)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.These.That Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Transformer.Flip.Flip Pandora.Paradigm.Primary.Functor.These.These a2)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.These.This Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Functor.These.These e2)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.Wedge.Here Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Transformer.Flip.Flip Pandora.Paradigm.Primary.Functor.Wedge.Wedge a2)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.Wedge.There Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Functor.Wedge.Wedge e2)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) Pandora.Paradigm.Primary.Functor.Wye.Wye
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) Pandora.Paradigm.Primary.Functor.Wye.Wye
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e)) Pandora.Paradigm.Primary.Functor.Maybe.Maybe
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Primary.Functor.Maybe.Maybe) (Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion e)
+ Pandora.Paradigm.Primary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Primary.Functor.Wye.Wye) ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Primary: instance Pandora.Pattern.Functor.Contravariant.Contravariant (Pandora.Paradigm.Primary.Transformer.Flip.Flip (->) r)
+ Pandora.Paradigm.Primary.Functor.Wye: instance Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic a (Pandora.Paradigm.Primary.Functor.Wye.Wye a)
+ Pandora.Paradigm.Primary.Transformer.Flip: Flip :: v e a -> Flip (v :: * -> * -> *) a e
+ Pandora.Paradigm.Primary.Transformer.Flip: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Primary.Transformer.Flip.Flip v a)
+ Pandora.Paradigm.Primary.Transformer.Flip: instance Pandora.Pattern.Functor.Bivariant.Bivariant v => Pandora.Pattern.Functor.Bivariant.Bivariant (Pandora.Paradigm.Primary.Transformer.Flip.Flip v)
+ Pandora.Paradigm.Primary.Transformer.Flip: newtype Flip (v :: * -> * -> *) a e
+ Pandora.Paradigm.Schemes.T_U: instance (Pandora.Pattern.Functor.Divariant.Divariant p, Pandora.Pattern.Functor.Contravariant.Contravariant t, Pandora.Pattern.Functor.Covariant.Covariant u) => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Contravariant.Contravariant Pandora.Pattern.Functor.Covariant.Covariant t p u)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Structure.Ability.Morphable.Inorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Structure.Ability.Morphable.Postorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ('Pandora.Paradigm.Structure.Ability.Morphable.Preorder (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure: instance forall k a (o :: k -> a) (ds :: k). Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (o ds)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) => Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (o ds)) Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Ability.Deletable: (-=) :: (Deletable t, Setoid a) => a -> t a -> t a
+ Pandora.Paradigm.Structure.Ability.Deletable: infixr 3 -=
+ Pandora.Paradigm.Structure.Ability.Insertable: (+=) :: Insertable t => a -> t a -> t a
+ Pandora.Paradigm.Structure.Ability.Insertable: infixr 2 +=
+ Pandora.Paradigm.Structure.Ability.Morphable: Into :: a -> Morph a
+ Pandora.Paradigm.Structure.Ability.Morphable: into :: forall f t. Morphable (Into f) t => t ~> Morphing (Into f) t
+ Pandora.Paradigm.Structure.Ability.Morphable: rotate :: forall f t. Morphable (Rotate f) t => t ~> Morphing (Rotate f) t
+ Pandora.Paradigm.Structure.Interface.Dictionary: (?=) :: Dictionary a k t => k -> t a -> Maybe a
+ Pandora.Paradigm.Structure.Interface.Dictionary: class Dictionary a k t
+ Pandora.Paradigm.Structure.Modification.Comprehension: Comprehension :: ((t <:.> Construction t) := a) -> Comprehension t a
+ Pandora.Paradigm.Structure.Modification.Comprehension: instance (Pandora.Pattern.Functor.Avoidable.Avoidable t, Pandora.Pattern.Functor.Pointable.Pointable t) => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.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.Bindable.Bindable (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.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.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.Comprehension: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.Comprehension: instance Pandora.Pattern.Functor.Covariant.Covariant (t Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction t) => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.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.Modification.Comprehension.Comprehension t)
+ Pandora.Paradigm.Structure.Modification.Comprehension: newtype Comprehension t a
+ Pandora.Paradigm.Structure.Modification.Prefixed: Prefixed :: ((t <:.> Keyed k) := a) -> Prefixed t k a
+ Pandora.Paradigm.Structure.Modification.Prefixed: instance (Pandora.Paradigm.Structure.Ability.Monotonic.Monotonic (Pandora.Paradigm.Structure.Modification.Prefixed.Keyed k a) (t (Pandora.Paradigm.Structure.Modification.Prefixed.Keyed k a)), Pandora.Pattern.Object.Setoid.Setoid k) => Pandora.Paradigm.Structure.Interface.Dictionary.Dictionary a k (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed t k)
+ Pandora.Paradigm.Structure.Modification.Prefixed: instance (Pandora.Pattern.Object.Monoid.Monoid k, Pandora.Pattern.Functor.Pointable.Pointable t) => Pandora.Pattern.Functor.Pointable.Pointable (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed t k)
+ Pandora.Paradigm.Structure.Modification.Prefixed: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed t k)
+ Pandora.Paradigm.Structure.Modification.Prefixed: instance Pandora.Pattern.Functor.Covariant.Covariant t => Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed t k)
+ Pandora.Paradigm.Structure.Modification.Prefixed: instance Pandora.Pattern.Functor.Traversable.Traversable t => Pandora.Pattern.Functor.Traversable.Traversable (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed t k)
+ Pandora.Paradigm.Structure.Modification.Prefixed: newtype Prefixed t k a
+ Pandora.Paradigm.Structure.Modification.Prefixed: type Keyed k = Product k <:.> Maybe
+ Pandora.Paradigm.Structure.Some.Binary: Down :: a -> Vertical a
+ Pandora.Paradigm.Structure.Some.Binary: Leftward :: a -> Biforked a
+ Pandora.Paradigm.Structure.Some.Binary: Rightward :: a -> Biforked a
+ Pandora.Paradigm.Structure.Some.Binary: Top :: Biforked a
+ Pandora.Paradigm.Structure.Some.Binary: Up :: a -> Vertical a
+ Pandora.Paradigm.Structure.Some.Binary: binary :: forall t a. (Traversable t, Chain a) => t a -> Binary a
+ Pandora.Paradigm.Structure.Some.Binary: data Biforked a
+ Pandora.Paradigm.Structure.Some.Binary: data Vertical a
+ Pandora.Paradigm.Structure.Some.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Insertable.Insertable (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance (forall a. Pandora.Pattern.Object.Chain.Chain a) => Pandora.Paradigm.Structure.Ability.Insertable.Insertable Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.Binary.Binary) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Structure.Some.Binary.Up) (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((Pandora.Paradigm.Structure.Some.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Some.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant Pandora.Paradigm.Primary.Functor.Identity.Identity (Pandora.Paradigm.Primary.Functor.Product.:*:) (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.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Structure.Some.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Left)) (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((Pandora.Paradigm.Structure.Some.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Some.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant Pandora.Paradigm.Primary.Functor.Identity.Identity (Pandora.Paradigm.Primary.Functor.Product.:*:) (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.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Structure.Some.Binary.Down 'Pandora.Paradigm.Primary.Functor.Wye.Right)) (Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) (Pandora.Paradigm.Primary.Functor.Product.:*:) ((Pandora.Paradigm.Structure.Some.Binary.Biforked Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Some.Binary.Biforked) Pandora.Paradigm.Schemes.TU.<:.> Pandora.Paradigm.Schemes.T_U.T_U Pandora.Pattern.Functor.Covariant.Covariant Pandora.Pattern.Functor.Covariant.Covariant Pandora.Paradigm.Primary.Functor.Identity.Identity (Pandora.Paradigm.Primary.Functor.Product.:*:) (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.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Structure.Some.Binary.Binary
+ Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Pattern.Functor.Covariant.Covariant Pandora.Paradigm.Structure.Some.Binary.Biforked
+ Pandora.Paradigm.Structure.Some.Binary: rebalance :: Chain a => ((Wye :. Construction Wye) := a) -> Nonempty Binary a
+ Pandora.Paradigm.Structure.Some.Binary: type Binary = Maybe <:.> Construction Wye
+ Pandora.Paradigm.Structure.Some.Rose: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Some.Stack.Stack)
+ Pandora.Paradigm.Structure.Some.Rose: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Root Pandora.Paradigm.Structure.Some.Rose.Rose
+ Pandora.Paradigm.Structure.Some.Rose: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Some.Rose.Rose
+ Pandora.Paradigm.Structure.Some.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Some.Stack.Stack)
+ Pandora.Paradigm.Structure.Some.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just Pandora.Paradigm.Structure.Some.Rose.Rose
+ Pandora.Paradigm.Structure.Some.Rose: type Rose = Maybe <:.> Construction Stack
+ Pandora.Paradigm.Structure.Some.Splay: Zag :: a -> Splay a
+ Pandora.Paradigm.Structure.Some.Splay: Zig :: a -> Splay a
+ Pandora.Paradigm.Structure.Some.Splay: branch :: forall b. Morphable (Into (b Maybe)) Wye => Wye ~> Morphing (Into (b Maybe)) Wye
+ Pandora.Paradigm.Structure.Some.Splay: data Splay a
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Left 'Pandora.Paradigm.Structure.Some.Splay.Zig)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Left ('Pandora.Paradigm.Structure.Some.Splay.Zig 'Pandora.Paradigm.Structure.Some.Splay.Zag))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Left ('Pandora.Paradigm.Structure.Some.Splay.Zig 'Pandora.Paradigm.Structure.Some.Splay.Zig))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Right 'Pandora.Paradigm.Structure.Some.Splay.Zig)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Right ('Pandora.Paradigm.Structure.Some.Splay.Zig 'Pandora.Paradigm.Structure.Some.Splay.Zag))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Splay: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate ('Pandora.Paradigm.Primary.Functor.Wye.Right ('Pandora.Paradigm.Structure.Some.Splay.Zig 'Pandora.Paradigm.Structure.Some.Splay.Zig))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Some.Stack: filter :: forall a. Predicate a -> Stack a -> Stack a
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Deletable.Deletable Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Head (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Focusable.Focusable 'Pandora.Paradigm.Structure.Ability.Focusable.Head Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Insertable.Insertable (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Insertable.Insertable Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.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.Some.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.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.Stack.Stack) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stack.Stack))
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stack.Stack))
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Nullable.Nullable Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail Pandora.Paradigm.Structure.Some.Stack.Stack
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stack.Stack))
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Pattern.Object.Monoid.Monoid (Pandora.Paradigm.Structure.Some.Stack.Stack a)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe a)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Pattern.Object.Semigroup.Semigroup (Pandora.Paradigm.Structure.Some.Stack.Stack a)
+ Pandora.Paradigm.Structure.Some.Stack: instance Pandora.Pattern.Object.Setoid.Setoid a => Pandora.Pattern.Object.Setoid.Setoid (Pandora.Paradigm.Structure.Some.Stack.Stack a)
+ Pandora.Paradigm.Structure.Some.Stack: linearize :: forall t a. Traversable t => t a -> Stack a
+ Pandora.Paradigm.Structure.Some.Stack: type Stack = Maybe <:.> Construction Maybe
+ Pandora.Paradigm.Structure.Some.Stream: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream))
+ Pandora.Paradigm.Structure.Some.Stream: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream))
+ Pandora.Paradigm.Structure.Some.Stream: instance Pandora.Pattern.Functor.Extendable.Extendable (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((Pandora.Paradigm.Primary.Functor.Product.:*:) Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream))
+ Pandora.Paradigm.Structure.Some.Stream: repeat :: a :=> Stream
+ Pandora.Paradigm.Structure.Some.Stream: type Stream = Construction Identity
+ Pandora.Pattern.Object.Setoid: (!=) :: Setoid a => a -> a -> Boolean
- Pandora.Paradigm.Inventory.Optics: (|>) :: Lens src old -> Lens old new -> Lens src new
+ Pandora.Paradigm.Inventory.Optics: (|>) :: Lens src tgt -> Lens tgt new -> Lens src new
- Pandora.Pattern.Category: ($) :: Category m => m a b -> m a b
+ Pandora.Pattern.Category: ($) :: Category m => m ~~> m
- Pandora.Pattern.Functor.Divariant: (>->) :: Divariant v => v a b -> v c d -> v b c -> v a d
+ Pandora.Pattern.Functor.Divariant: (>->) :: Divariant v => (a -> b) -> (c -> d) -> v b c -> v a d
- Pandora.Pattern.Functor.Divariant: dimap :: Divariant v => v a b -> v c d -> v b c -> v a d
+ Pandora.Pattern.Functor.Divariant: dimap :: Divariant v => (a -> b) -> (c -> d) -> v b c -> v a d
- Pandora.Pattern.Object.Setoid: infix 4 /=
+ Pandora.Pattern.Object.Setoid: infix 4 !=
Files
- CHANGELOG.md +16/−0
- Pandora/Core/Functor.hs +4/−2
- Pandora/Paradigm/Controlflow/Effect/Interpreted.hs +3/−0
- Pandora/Paradigm/Inventory/Equipment.hs +4/−0
- Pandora/Paradigm/Inventory/Optics.hs +2/−4
- Pandora/Paradigm/Primary.hs +68/−0
- Pandora/Paradigm/Primary/Functor.hs +1/−41
- Pandora/Paradigm/Primary/Functor/Wye.hs +7/−0
- Pandora/Paradigm/Primary/Transformer.hs +1/−0
- Pandora/Paradigm/Primary/Transformer/Flip.hs +15/−0
- Pandora/Paradigm/Schemes.hs +0/−1
- Pandora/Paradigm/Schemes/T_.hs +0/−11
- Pandora/Paradigm/Schemes/T_U.hs +8/−4
- Pandora/Paradigm/Structure.hs +29/−44
- Pandora/Paradigm/Structure/Ability.hs +0/−1
- Pandora/Paradigm/Structure/Ability/Comprehension.hs +0/−39
- Pandora/Paradigm/Structure/Ability/Deletable.hs +3/−1
- Pandora/Paradigm/Structure/Ability/Insertable.hs +3/−1
- Pandora/Paradigm/Structure/Ability/Morphable.hs +7/−1
- Pandora/Paradigm/Structure/Binary.hs +0/−162
- Pandora/Paradigm/Structure/Interface.hs +1/−0
- Pandora/Paradigm/Structure/Interface/Dictionary.hs +6/−0
- Pandora/Paradigm/Structure/Interface/Set.hs +2/−2
- Pandora/Paradigm/Structure/Modification.hs +4/−0
- Pandora/Paradigm/Structure/Modification/Comprehension.hs +39/−0
- Pandora/Paradigm/Structure/Modification/Prefixed.hs +43/−0
- Pandora/Paradigm/Structure/Rose.hs +0/−53
- Pandora/Paradigm/Structure/Some.hs +7/−0
- Pandora/Paradigm/Structure/Some/Binary.hs +167/−0
- Pandora/Paradigm/Structure/Some/Rose.hs +53/−0
- Pandora/Paradigm/Structure/Some/Splay.hs +70/−0
- Pandora/Paradigm/Structure/Some/Stack.hs +156/−0
- Pandora/Paradigm/Structure/Some/Stream.hs +40/−0
- Pandora/Paradigm/Structure/Splay.hs +0/−51
- Pandora/Paradigm/Structure/Stack.hs +0/−156
- Pandora/Paradigm/Structure/Stream.hs +0/−40
- Pandora/Pattern/Category.hs +3/−1
- Pandora/Pattern/Functor/Divariant.hs +2/−2
- Pandora/Pattern/Object/Setoid.hs +5/−6
- pandora.cabal +12/−8
CHANGELOG.md view
@@ -345,3 +345,19 @@ * Delete `Delta` datatype in favor of `(:*:) <:.:> t` # 0.3.7+* Rename `insert` method to `+=` in `Insertable` typeclass+* Rename `delete` method to `-=` in `Deletable` typeclass+* Create `Some` umbrella module for certain data structures+* Define experimental `~~>` type synonyms+* Rename `/=` method of `Setoid` typeclass to `!=`+* Define `rotate` and `into` method of `Morphable` typeclass+* Remove `T_` joint scheme in favor of `T_U`+* Define `Prefixed` wrapper for data structures whose values can be prefixed+* Move `Comprehension` and `Prefixed` modules from `Ability` to `Modification`+* Define experimental `Dictionary` typeclass+* Add `=||` method to `Interpreted` typeclass+* Remove `hush`, `left`, `right`, `this`, `there`, `here`, `note` methods in favor of `Morphable` instance+* Define `Flip` transformer for flipping type arguments+* Replace two parementers in `>->` method of `Divariant` with usual functions++# 0.3.8
Pandora/Core/Functor.hs view
@@ -19,8 +19,10 @@ -- | Algebra's type operator type (<:=) a t = t a -> a --- | Numerator transformation-type (~>) t u = forall a . t a -> u a+-- | Natural transformation+type t ~> u = forall a . t a -> u a++type t ~~> u = forall a b . t a b -> u a b type (::|:.) p a b = p (p a b) b type (::|.:) p a b = p a (p a b)
Pandora/Paradigm/Controlflow/Effect/Interpreted.hs view
@@ -15,6 +15,9 @@ (||=) :: (Primary t a -> Primary t b) -> t a -> t b (||=) f = unite . f . run + (=||) :: (t a -> t b) -> Primary t a -> Primary t b+ (=||) f = run . f . unite+ (-=:) :: (Liftable t, Interpreted (t u), Interpreted (t v), Covariant u) => (t u a -> t v b) -> u a -> Primary (t v) b (-=:) f = run . f . lift
Pandora/Paradigm/Inventory/Equipment.hs view
@@ -5,6 +5,7 @@ import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached)@@ -20,6 +21,9 @@ instance Extractable (Equipment e) where extract = extract . run++instance Traversable (Equipment e) where+ Equipment x ->> f = Equipment <$> (x ->> f) instance Extendable (Equipment e) where Equipment (e :*: x) =>> f = Equipment . (:*:) e . f . Equipment $ e :*: x
Pandora/Paradigm/Inventory/Optics.hs view
@@ -1,5 +1,3 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Inventory.Optics where import Pandora.Core.Functor (type (:=>))@@ -24,8 +22,8 @@ type (:~.) src tgt = forall a . Lens (src a) (tgt a) -- | Lens composition infix operator-(|>) :: Lens src old -> Lens old new -> Lens src new-from |> to = \x -> ((<$) x . to) . position . from $ x+(|>) :: Lens src tgt -> Lens tgt new -> Lens src new+(|>) from to src = src <$ (to . position $ from src) -- | Get the target of a lens view :: Lens src tgt -> src -> tgt
Pandora/Paradigm/Primary.hs view
@@ -1,5 +1,73 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Pandora.Paradigm.Primary (module Exports) where import Pandora.Paradigm.Primary.Transformer as Exports import Pandora.Paradigm.Primary.Functor as Exports import Pandora.Paradigm.Primary.Object as Exports++import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))+import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (||=))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))+import Pandora.Paradigm.Schemes.T_U (type (<:.:>))+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Into))++instance Contravariant (Flip (->) r) where+ f >$< g = (<$> f) ||= g++instance Morphable (Into Maybe) (Conclusion e) where+ type Morphing (Into Maybe) (Conclusion e) = Maybe+ morphing = conclusion (Nothing !) Just . extract . run++instance Morphable (Into (Conclusion e)) Maybe where+ type Morphing (Into (Conclusion e)) Maybe = (->) e <:.> Conclusion e+ morphing (extract . run -> Just x) = TU $ \_ -> Success x+ morphing (extract . run -> Nothing) = TU $ \e -> Failure e++instance Morphable (Into (Left Maybe)) Wye where+ type Morphing (Into (Left Maybe)) Wye = Maybe+ morphing (extract . run -> Both ls _) = Just ls+ morphing (extract . run -> Left ls) = Just ls+ morphing (extract . run -> Right _) = Nothing+ morphing (extract . run -> End) = Nothing++instance Morphable (Into (Right Maybe)) Wye where+ type Morphing (Into (Right Maybe)) Wye = Maybe+ morphing (extract . run -> Both _ rs) = Just rs+ morphing (extract . run -> Left _) = Nothing+ morphing (extract . run -> Right rs) = Just rs+ morphing (extract . run -> End) = Nothing++instance Morphable (Into (This Maybe)) (These e) where+ type Morphing (Into (This Maybe)) (These e) = Maybe+ morphing (extract . run -> This x) = Just x+ morphing (extract . run -> That _) = Nothing+ morphing (extract . run -> These _ x) = Just x++instance Morphable (Into (That Maybe)) (Flip These a) where+ type Morphing (Into (That Maybe)) (Flip These a) = Maybe+ morphing (run . extract . run -> This _) = Nothing+ morphing (run . extract . run -> That x) = Just x+ morphing (run . extract . run -> These y _) = Just y++instance Morphable (Into (Here Maybe)) (Flip Wedge a) where+ type Morphing (Into (Here Maybe)) (Flip Wedge a) = Maybe+ morphing (run . extract . run -> Nowhere) = Nothing+ morphing (run . extract . run -> Here x) = Just x+ morphing (run . extract . run -> There _) = Nothing++instance Morphable (Into (There Maybe)) (Wedge e) where+ type Morphing (Into (There Maybe)) (Wedge e) = Maybe+ morphing (extract . run -> Nowhere) = Nothing+ morphing (extract . run -> Here _) = Nothing+ morphing (extract . run -> There x) = Just x++instance Morphable (Into Wye) ((<:.:>) (:*:) Maybe) where+ type Morphing (Into Wye) ((<:.:>) (:*:) Maybe) = Wye+ morphing (run . extract . run -> Just x :*: Just y) = Both x y+ morphing (run . extract . run -> Nothing :*: Just y) = Right y+ morphing (run . extract . run -> Just x :*: Nothing) = Left x+ morphing (run . extract . run -> Nothing :*: Nothing) = End
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, branches, match) where+module Pandora.Paradigm.Primary.Functor (module Exports, branches, match) where import Pandora.Paradigm.Primary.Functor.Fix as Exports import Pandora.Paradigm.Primary.Functor.Equivalence as Exports@@ -20,55 +20,15 @@ import Pandora.Paradigm.Primary.Functor.Identity as Exports import Pandora.Paradigm.Primary.Functor.Function as Exports -import Pandora.Core.Functor (type (~>)) import Pandora.Pattern.Category (($)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Paradigm.Primary.Object.Boolean ((?))-import Pandora.Paradigm.Structure.Ability.Monotonic (reduce) instance Adjoint (Product s) ((->) s) where (-|) :: a -> ((s :*: a) -> b) -> (s -> b) x -| f = \s -> f $ s :*: x (|-) :: (s :*: a) -> (a -> s -> b) -> b ~(s :*: x) |- f = f x s--note :: e -> Maybe ~> Conclusion e-note x = reduce (\y _ -> Success y) (Failure x)--hush :: Conclusion e ~> Maybe-hush = conclusion (Nothing !) Just--left :: Wye ~> Maybe-left (Both ls _) = Just ls-left (Left ls) = Just ls-left (Right _) = Nothing-left End = Nothing--right :: Wye ~> Maybe-right (Both _ rs) = Just rs-right (Left _) = Nothing-right (Right rs) = Just rs-right End = Nothing--this :: These e ~> Maybe-this (This x) = Just x-this (That _) = Nothing-this (These _ x) = Just x--that :: These e a -> Maybe e-that (This _) = Nothing-that (That x) = Just x-that (These y _) = Just y--here :: Wedge e a -> Maybe e-here Nowhere = Nothing-here (Here x) = Just x-here (There _) = Nothing--there :: Wedge e ~> Maybe-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
Pandora/Paradigm/Primary/Functor/Wye.hs view
@@ -6,6 +6,7 @@ import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Applicative (Applicative ((<*>))) import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce)) data Wye a = End | Left a | Right a | Both a a @@ -20,6 +21,12 @@ Left x ->> f = Left <$> f x Right y ->> f = Right <$> f y Both x y ->> f = Both <$> f x <*> f y++instance Monotonic a (Wye a) where+ reduce f r (Left x) = f x r+ reduce f r (Right x) = f x r+ reduce f r (Both x y) = f y (f x r)+ reduce _ r End = r wye :: r -> (a -> r) -> (a -> r) -> (a -> a -> r) -> Wye a -> r wye r _ _ _ End = r
Pandora/Paradigm/Primary/Transformer.hs view
@@ -12,3 +12,4 @@ import Pandora.Paradigm.Primary.Transformer.Construction as Exports import Pandora.Paradigm.Primary.Transformer.Reverse as Exports import Pandora.Paradigm.Primary.Transformer.Backwards as Exports+import Pandora.Paradigm.Primary.Transformer.Flip as Exports
+ Pandora/Paradigm/Primary/Transformer/Flip.hs view
@@ -0,0 +1,15 @@+module Pandora.Paradigm.Primary.Transformer.Flip where++import Pandora.Pattern.Category (($))+import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->)))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))++newtype Flip (v :: * -> * -> *) a e = Flip (v e a)++instance Interpreted (Flip v a) where+ type Primary (Flip v a) e = v e a+ run ~(Flip x) = x+ unite = Flip++instance Bivariant v => Bivariant (Flip v) where+ f <-> g = \x -> unite $ g <-> f $ run x
Pandora/Paradigm/Schemes.hs view
@@ -4,7 +4,6 @@ import Pandora.Paradigm.Schemes.U_T as Exports import Pandora.Paradigm.Schemes.T_U as Exports-import Pandora.Paradigm.Schemes.T_ as Exports import Pandora.Paradigm.Schemes.UTU as Exports import Pandora.Paradigm.Schemes.UT as Exports import Pandora.Paradigm.Schemes.TUVW as Exports
− Pandora/Paradigm/Schemes/T_.hs
@@ -1,11 +0,0 @@-module Pandora.Paradigm.Schemes.T_ where--import Pandora.Paradigm.Primary.Functor.Product (type (:*:))-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
@@ -1,10 +1,10 @@ module Pandora.Paradigm.Schemes.T_U where -import Pandora.Pattern.Category (($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))-import Pandora.Pattern.Functor.Contravariant (Contravariant)+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<))) import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))+import Pandora.Pattern.Functor.Divariant (Divariant ((>->)))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=))) newtype T_U ct cu t p u a = T_U (p (t a) (u a)) @@ -20,4 +20,8 @@ instance (Bivariant p, Covariant t, Covariant u) => Covariant (T_U Covariant Covariant t p u) where- f <$> (T_U x) = T_U $ (f <$>) <-> (f <$>) $ x+ f <$> x = ((f <$>) <-> (f <$>)) ||= x++instance (Divariant p, Contravariant t, Covariant u)+ => Covariant (T_U Contravariant Covariant t p u) where+ f <$> x = ((f >$<) >-> (f <$>)) ||= x
Pandora/Paradigm/Structure.hs view
@@ -4,11 +4,8 @@ import Pandora.Paradigm.Structure.Ability as Exports import Pandora.Paradigm.Structure.Interface as Exports-import Pandora.Paradigm.Structure.Rose as Exports-import Pandora.Paradigm.Structure.Splay as Exports-import Pandora.Paradigm.Structure.Binary as Exports-import Pandora.Paradigm.Structure.Stack as Exports-import Pandora.Paradigm.Structure.Stream as Exports+import Pandora.Paradigm.Structure.Modification as Exports+import Pandora.Paradigm.Structure.Some as Exports import Pandora.Pattern.Category (($), (.)) import Pandora.Pattern.Functor.Covariant (Covariant (comap))@@ -20,7 +17,6 @@ import Pandora.Paradigm.Inventory.Optics ((|>)) import Pandora.Paradigm.Inventory.Store (Store (Store)) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))--- import Pandora.Paradigm.Primary.Functor.Delta (Delta ((:^:))) import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag))@@ -42,55 +38,44 @@ substructure (extract . run -> s :*: x) = Store $ Identity x :*: lift . (s :*:) . extract --- instance Substructure Left Delta where--- type Substructural Left Delta = Identity--- substructure (extract . run -> l :^: r) =--- Store $ Identity l :*: lift . (:^: r) . extract------ instance Substructure Right Delta where--- type Substructural Right Delta = Identity--- substructure (extract . run -> l :^: r) =--- Store $ Identity r :*: lift . (l :^:) . extract------ instance Covariant t => Substructure Left (Delta <:.> t) where--- type Substructural Left (Delta <:.> t) = t--- substructure (run . extract . run -> l :^: r) =--- Store $ r :*: lift . unite . (l :^:)------ instance Covariant t => Substructure Right (Delta <:.> t) where--- type Substructural Right (Delta <:.> t) = t--- substructure (run . extract . run -> l :^: r) =--- Store $ l :*: lift . unite . (:^: r)- instance Covariant t => Substructure Tail (Tap t) where type Substructural Tail (Tap t) = t substructure (extract . run -> Tap x xs) = Store $ xs :*: lift . Tap x -instance Morphable Preorder (Construction Wye) where- type Morphing Preorder (Construction Wye) = Construction Maybe+instance Morphable (Into (Preorder (Construction Maybe))) (Construction Wye) where+ type Morphing (Into (Preorder (Construction Maybe))) (Construction Wye) = Construction Maybe morphing (extract . run -> Construct x End) = Construct x Nothing- morphing (extract . run -> Construct x (Left lst)) = Construct x . Just $ morph @Preorder lst- morphing (extract . run -> Construct x (Right rst)) = Construct x . Just $ morph @Preorder rst- morphing (extract . run -> Construct x (Both lst rst)) = Construct x . Just $ morph @Preorder lst + morph @Preorder rst+ morphing (extract . run -> Construct x (Left lst)) = Construct x . Just $ into @(Preorder (Nonempty Stack)) lst+ morphing (extract . run -> Construct x (Right rst)) = Construct x . Just $ into @(Preorder (Nonempty Stack)) rst+ morphing (extract . run -> Construct x (Both lst rst)) = Construct x . Just $ into @(Preorder (Nonempty Stack)) lst + into @(Preorder (Nonempty Stack)) rst -instance Morphable Inorder (Construction Wye) where- type Morphing Inorder (Construction Wye) = Construction Maybe+instance Morphable (Into (Inorder (Construction Maybe))) (Construction Wye) where+ type Morphing (Into (Inorder (Construction Maybe))) (Construction Wye) = Construction Maybe morphing (extract . run -> Construct x End) = point x- morphing (extract . run -> Construct x (Left lst)) = morph @Inorder lst + point x- morphing (extract . run -> Construct x (Right rst)) = point x + morph @Inorder rst- morphing (extract . run -> Construct x (Both lst rst)) = morph @Inorder lst + point x + morph @Inorder rst+ morphing (extract . run -> Construct x (Left lst)) = into @(Inorder (Nonempty Stack)) lst + point x+ morphing (extract . run -> Construct x (Right rst)) = point x + into @(Inorder (Nonempty Stack)) rst+ morphing (extract . run -> Construct x (Both lst rst)) = into @(Inorder (Nonempty Stack)) lst + point x + into @(Inorder (Nonempty Stack)) rst -instance Morphable Postorder (Construction Wye) where- type Morphing Postorder (Construction Wye) = Construction Maybe+instance Morphable (Into (Postorder (Construction Maybe))) (Construction Wye) where+ type Morphing (Into (Postorder (Construction Maybe))) (Construction Wye) = Construction Maybe morphing (extract . run -> Construct x End) = point x- morphing (extract . run -> Construct x (Left lst)) = morph @Postorder lst + point x- morphing (extract . run -> Construct x (Right rst)) = morph @Postorder rst + point x- morphing (extract . run -> Construct x (Both lst rst)) = morph @Postorder lst + morph @Postorder rst + point x+ morphing (extract . run -> Construct x (Left lst)) = into @(Postorder (Nonempty Stack)) lst + point x+ morphing (extract . run -> Construct x (Right rst)) = into @(Postorder (Nonempty Stack)) rst + point x+ morphing (extract . run -> Construct x (Both lst rst)) = into @(Postorder (Nonempty Stack)) lst + into @(Postorder (Nonempty Stack)) rst + point x -instance Morphable o (Construction Wye) => Morphable o Binary where- type Morphing o Binary = Maybe <:.> Morphing o (Construction Wye)- morphing = unite . comap (morph @o) . run . extract . run+-- instance Morphable (Into (Levelorder (Construction Maybe))) (Construction Wye) where+-- type Morphing (Into (Levelorder (Construction Maybe))) (Construction Wye) = Construction Maybe+-- morphing (extract . run -> Construct x End) = point x+-- morphing (extract . run -> Construct x (Left lst)) = point x + into @(Levelorder (Nonempty Stack)) lst+-- morphing (extract . run -> Construct x (Right rst)) = point x + into @(Levelorder (Nonempty Stack)) lst+-- morphing (extract . run -> Construct x (Both lst rst)) = point x + extract lst + extract rst +++ -- (deconstruct lst :: )++instance Morphable (Into (o ds)) (Construction Wye) => Morphable (Into (o ds)) Binary where+ type Morphing (Into (o ds)) Binary = Maybe <:.> Morphing (Into (o ds)) (Construction Wye)+ morphing = unite . comap (into @(o ds)) . run . extract . run instance Focusable Left (Product s) where type Focusing Left (Product s) a = s
Pandora/Paradigm/Structure/Ability.hs view
@@ -11,4 +11,3 @@ import Pandora.Paradigm.Structure.Ability.Accessible 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
@@ -1,39 +0,0 @@-{-# LANGUAGE UndecidableInstances #-}--module Pandora.Paradigm.Structure.Ability.Comprehension where--import Pandora.Core.Functor (type (:=))-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.Primary.Functor.Function ((%))-import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))--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/Deletable.hs view
@@ -2,5 +2,7 @@ import Pandora.Pattern.Object.Setoid (Setoid) +infixr 3 -=+ class Deletable t where- delete :: Setoid a => a -> t a -> t a+ (-=) :: Setoid a => a -> t a -> t a
Pandora/Paradigm/Structure/Ability/Insertable.hs view
@@ -1,4 +1,6 @@ module Pandora.Paradigm.Structure.Ability.Insertable where +infixr 2 +=+ class Insertable t where- insert :: a -> t a -> t a+ (+=) :: a -> t a -> t a
Pandora/Paradigm/Structure/Ability/Morphable.hs view
@@ -16,4 +16,10 @@ data Walk a = Preorder a | Inorder a | Postorder a | Levelorder a -data Morph a = Rotate a+data Morph a = Rotate a | Into a++rotate :: forall f t . Morphable (Rotate f) t => t ~> Morphing (Rotate f) t+rotate = morphing . TU . Tag @(Rotate f)++into :: forall f t . Morphable (Into f) t => t ~> Morphing (Into f) t+into = morphing . TU . Tag @(Into f)
− Pandora/Paradigm/Structure/Binary.hs
@@ -1,162 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE UndecidableInstances #-}--module Pandora.Paradigm.Structure.Binary where--import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))-import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))-import Pandora.Pattern.Functor.Extractable (extract)-import Pandora.Pattern.Functor.Avoidable (empty)-import Pandora.Pattern.Transformer.Liftable (lift)-import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-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.Object.Numerator (Numerator (Numerator, Zero))-import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))-import Pandora.Paradigm.Primary.Functor.Function ((!), (%), (&))-import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))-import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate))-import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached)-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 (<:.>))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)-import Pandora.Paradigm.Inventory.State (State, modify)-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (over)-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.Measurable (Measurable (Measural, measurement), Scale (Heighth), measure)-import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve))-import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert))-import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing))-import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure), sub, substitute)-import Pandora.Paradigm.Structure.Ability.Zipper (Zipper)--type Binary = Maybe <:.> Construction Wye--rebalance :: Chain a => (Wye :. Construction Wye := a) -> Nonempty Binary a-rebalance (Both x y) = extract x <=> extract y & order- (Construct (extract y) $ Both x (rebalance $ deconstruct y))- (Construct (extract x) $ Both (rebalance $ deconstruct x) (rebalance $ deconstruct y))- (Construct (extract x) $ Both (rebalance $ deconstruct x) y)--instance (forall a . Chain a) => Insertable Binary where- insert x (run -> Nothing) = lift . Construct x $ End- insert x tree@(run -> Just nonempty) = x <=> extract nonempty & order- (tree & substitute @Left (insert x) ) tree (tree & substitute @Right (insert x))--instance (forall a . Chain a) => Focusable Root Binary where- type Focusing Root Binary a = Maybe a- 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 Measurable Heighth Binary where- type Measural Heighth Binary a = Numerator- measurement (run . extract -> Just bt) = Numerator $ measure @Heighth bt- measurement (run . extract -> Nothing) = Zero--instance Nullable Binary where- null = Predicate $ \case { TU Nothing -> True ; _ -> False }--instance Substructure Left Binary where- type Substructural Left Binary = Binary- substructure empty_tree@(run . extract . run -> Nothing) = Store $ extract (run empty_tree) :*: (!) empty_tree- substructure (run . extract . run -> Just tree) = lift . lift <$> sub @Left tree--instance Substructure Right Binary where- type Substructural Right Binary = Binary- substructure empty_tree@(run . extract . run -> Nothing) = Store $ extract (run empty_tree) :*: (!) empty_tree- substructure (run . extract . run -> Just tree) = lift . lift <$> sub @Right tree--binary :: forall t a . (Traversable t, Chain a) => t a -> Binary a-binary struct = attached $ run @(State (Binary a)) % empty $ struct ->> modify @(Binary a) . insert' where-- insert' :: a -> Binary a -> Binary a- insert' x (run -> Nothing) = lift . Construct x $ End- insert' x tree@(run -> Just nonempty) = x <=> extract nonempty & order- (tree & substitute @Left (insert' x)) tree (tree & substitute @Right (insert' x))--type instance Nonempty Binary = Construction Wye--instance Focusable Root (Construction Wye) where- type Focusing Root (Construction Wye) a = a- focusing (extract -> Construct x xs) = Store $ x :*: Tag . Construct % xs--instance (forall a . Chain a) => Insertable (Construction Wye) where- insert x b = let change = lift . resolve (insert x) (Construct x End) . run in- x <=> extract b & order (over (sub @Left) change $ b) b (over (sub @Right) change $ b)--instance Measurable Heighth (Construction Wye) where- type Measural Heighth (Construction Wye) a = Denumerator- measurement (deconstruct . extract -> End) = One- measurement (deconstruct . extract -> Left lst) = One + measure @Heighth lst- measurement (deconstruct . extract -> Right rst) = One + measure @Heighth rst- measurement (deconstruct . extract -> Both lst rst) = One +- let (lm :*: rm) = measure @Heighth lst :*: measure @Heighth rst- in lm <=> rm & order rm lm lm--instance Substructure Left (Construction Wye) where- type Substructural Left (Construction Wye) = Binary- substructure empty_tree@(extract . run -> Construct _ End) =- Store $ TU Nothing :*: (empty_tree !)- substructure (extract . run -> Construct x (Left lst)) =- Store $ lift lst :*: lift . Construct x . resolve Left End . run- substructure (extract . run -> Construct x (Right rst)) =- Store $ empty :*: lift . Construct x . resolve (Both % rst) (Right rst) . run- substructure (extract . run -> Construct x (Both lst rst)) =- Store $ lift lst :*: lift . Construct x . resolve (Both % rst) (Right rst) . run--instance Substructure Right (Construction Wye) where- type Substructural Right (Construction Wye) = Binary- substructure emtpy_tree@(extract . run -> Construct _ End) =- Store $ empty :*: (emtpy_tree !)- substructure (extract . run -> Construct x (Left lst)) =- Store $ empty :*: lift . Construct x . resolve (Both lst) (Left lst) . run- substructure (extract . run -> Construct x (Right rst)) =- Store $ lift rst :*: lift . Construct x . resolve Right End . run- substructure (extract . run -> Construct x (Both lst rst)) =- Store $ lift rst :*: lift . Construct x . resolve (Both lst) (Left lst) . run--data Biforked a = Top | Leftward a | Rightward a--type instance Zipper (Construction Wye) = T_U Covariant Covariant (Construction Wye) (:*:)- ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))--data Vertical a = Up a | Down a--instance Morphable Up (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Morphing Up (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- morphing (run . extract . run -> focused :*: TU (TU (Leftward (Construct (T_ (parent :*: TU (Just rst))) next)))) =- TU . Just . T_U $ Construct parent (Both focused rst) :*: TU (TU next)- morphing (run . extract . run -> focused :*: TU (TU (Leftward (Construct (T_ (parent :*: TU Nothing)) next)))) =- TU . Just . T_U $ Construct parent (Left focused) :*: TU (TU next)- morphing (run . extract . run -> focused :*: TU (TU (Rightward (Construct (T_ (parent :*: TU (Just lst))) next)))) =- TU . Just . T_U $ Construct parent (Both lst focused) :*: TU (TU next)- morphing (run . extract . run -> focused :*: TU (TU (Rightward (Construct (T_ (parent :*: TU Nothing)) next)))) =- TU . Just . T_U $ Construct parent (Right focused) :*: TU (TU next)- morphing (extract . run -> T_U (_ :*: TU (TU Top))) = TU Nothing--instance Morphable (Down Left) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Morphing (Down Left) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- morphing (run . extract . run -> Construct x (Left lst) :*: TU (TU next)) =- TU . Just . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_ $ x :*: TU Nothing) $ next- morphing (run . extract . run -> Construct x (Both lst rst) :*: TU (TU next)) =- TU . Just . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_ $ x :*: TU (Just rst)) $ next- morphing (run . extract . run -> Construct _ (Right _) :*: _) = TU Nothing- morphing (run . extract . run -> Construct _ End :*: _) = TU Nothing--instance Morphable (Down Right) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye))) where- type Morphing (Down Right) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_ Covariant (Maybe <:.> Construction Wye)))- morphing (run . extract . run -> Construct x (Right rst) :*: TU (TU next)) = TU . Just . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_ $ x :*: TU Nothing) $ next- morphing (run . extract . run -> Construct x (Both lst rst) :*: TU (TU next)) = TU . Just . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_ $ x :*: TU (Just lst)) $ next- morphing (run . extract . run -> Construct _ (Left _) :*: _) = TU Nothing- morphing (run . extract . run -> Construct _ End :*: _) = TU Nothing
Pandora/Paradigm/Structure/Interface.hs view
@@ -1,3 +1,4 @@ module Pandora.Paradigm.Structure.Interface (module Exports) where +import Pandora.Paradigm.Structure.Interface.Dictionary as Exports import Pandora.Paradigm.Structure.Interface.Set as Exports
+ Pandora/Paradigm/Structure/Interface/Dictionary.hs view
@@ -0,0 +1,6 @@+module Pandora.Paradigm.Structure.Interface.Dictionary where++import Pandora.Paradigm.Primary.Functor.Maybe (Maybe)++class Dictionary a k t where+ (?=) :: k -> t a -> Maybe a
Pandora/Paradigm/Structure/Interface/Set.hs view
@@ -2,7 +2,7 @@ import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))-import Pandora.Pattern.Object.Setoid (Setoid ((/=)))+import Pandora.Pattern.Object.Setoid (Setoid ((!=))) import Pandora.Pattern.Object.Semigroup ((+)) import Pandora.Pattern.Object.Quasiring (one) import Pandora.Paradigm.Primary.Functor.Function ((!), (%))@@ -19,7 +19,7 @@ member x = reduce @a @(Maybe a) (\_ _ -> True) False . find (equate x) 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)+subset ss s = Nothing != (ss ->> find % s . equate) cardinality :: Traversable t => t a -> Numerator cardinality s = attached . run @(State _) % Zero $ s ->> (!) (modify @Numerator (+ one))
+ Pandora/Paradigm/Structure/Modification.hs view
@@ -0,0 +1,4 @@+module Pandora.Paradigm.Structure.Modification (module Exports) where++import Pandora.Paradigm.Structure.Modification.Prefixed as Exports+import Pandora.Paradigm.Structure.Modification.Comprehension as Exports
+ Pandora/Paradigm/Structure/Modification/Comprehension.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE UndecidableInstances #-}++module Pandora.Paradigm.Structure.Modification.Comprehension where++import Pandora.Core.Functor (type (:=))+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.Primary.Functor.Function ((%))+import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))++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/Modification/Prefixed.hs view
@@ -0,0 +1,43 @@+{-# LANGUAGE UndecidableInstances #-}++module Pandora.Paradigm.Structure.Modification.Prefixed where++import Pandora.Core.Functor (type (:=))+import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Contravariant ((>$<))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Extractable (Extractable (extract))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Pattern.Transformer.Liftable (lift)+import Pandora.Pattern.Object.Monoid (Monoid (zero))+import Pandora.Pattern.Object.Setoid (Setoid)+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), attached)+import Pandora.Paradigm.Primary.Functor.Predicate (equate)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))+import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic, find)+import Pandora.Paradigm.Structure.Interface.Dictionary (Dictionary ((?=)))++type Keyed k = Product k <:.> Maybe++newtype Prefixed t k a = Prefixed (t <:.> Keyed k := a)++instance Interpreted (Prefixed t k) where+ type Primary (Prefixed t k) a = t <:.> Keyed k := a+ run ~(Prefixed x) = x+ unite = Prefixed++instance Covariant t => Covariant (Prefixed t k) where+ f <$> Prefixed x = Prefixed $ f <$> x++instance Traversable t => Traversable (Prefixed t k) where+ Prefixed x ->> f = Prefixed <$> (x ->> f)++instance (Monoid k, Pointable t) => Pointable (Prefixed t k) where+ point = Prefixed . lift . TU . (:*:) zero . Just++instance (Monotonic (Keyed k a) (t (Keyed k a)), Setoid k) => Dictionary a k (Prefixed t k) where+ k ?= Prefixed x = find @(Keyed k a) (attached . run >$< equate k) (run x) >>= extract . run
− Pandora/Paradigm/Structure/Rose.hs
@@ -1,53 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Structure.Rose where--import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant (comap))-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.Function ((!), (%))-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)-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)-import Pandora.Paradigm.Inventory.Store (Store (Store))-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)--type Rose = Maybe <:.> Construction Stack--instance Focusable Root Rose where- type Focusing Root Rose a = Maybe a- focusing (run . extract -> Nothing) = Store $ Nothing :*: Tag . TU . comap (Construct % empty)- focusing (run . extract -> Just rose) = Store $ Just (extract rose)- :*: Tag . resolve (lift . Construct % deconstruct rose) empty--instance Nullable Rose where- null = Predicate $ \case { TU Nothing -> True ; _ -> False }--instance Substructure Just Rose where- type Substructural Just Rose = Stack <:.> Construction Stack- substructure (run . extract . run -> Nothing) =- Store $ empty :*: (lift empty !)- substructure (run . extract . run -> Just (Construct x xs)) =- Store $ TU xs :*: lift . lift . Construct x . run--type instance Nonempty Rose = Construction Stack--instance Focusable Root (Construction Stack) where- type Focusing Root (Construction Stack) a = a- focusing (Tag rose) = Store $ extract rose :*: Tag . Construct % deconstruct rose--instance Substructure Just (Construction Stack) where- type Substructural Just (Construction Stack) = Stack <:.> Construction Stack- substructure (extract . run -> Construct x xs) = Store $ TU xs :*: lift . Construct x . run
+ Pandora/Paradigm/Structure/Some.hs view
@@ -0,0 +1,7 @@+module Pandora.Paradigm.Structure.Some (module Exports) where++import Pandora.Paradigm.Structure.Some.Rose as Exports+import Pandora.Paradigm.Structure.Some.Splay as Exports+import Pandora.Paradigm.Structure.Some.Binary as Exports+import Pandora.Paradigm.Structure.Some.Stack as Exports+import Pandora.Paradigm.Structure.Some.Stream as Exports
+ Pandora/Paradigm/Structure/Some/Binary.hs view
@@ -0,0 +1,167 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Pandora.Paradigm.Structure.Some.Binary where++import Pandora.Core.Functor (type (:.), type (:=))+import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>)))+import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Pattern.Functor.Avoidable (empty)+import Pandora.Pattern.Transformer.Liftable (lift)+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+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.Object.Numerator (Numerator (Numerator, Zero))+import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%), (&))+import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached)+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_U (T_U), type (<:.>))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Inventory.State (State, modify)+import Pandora.Paradigm.Inventory.Store (Store (Store))+import Pandora.Paradigm.Inventory.Optics (over)+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.Measurable (Measurable (Measural, measurement), Scale (Heighth), measure)+import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve))+import Pandora.Paradigm.Structure.Ability.Insertable (Insertable ((+=)))+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate, Into))+import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure), sub, substitute)+import Pandora.Paradigm.Structure.Ability.Zipper (Zipper)++type Binary = Maybe <:.> Construction Wye++rebalance :: Chain a => (Wye :. Construction Wye := a) -> Nonempty Binary a+rebalance (Both x y) = extract x <=> extract y & order+ (Construct (extract y) $ Both x (rebalance $ deconstruct y))+ (Construct (extract x) $ Both (rebalance $ deconstruct x) (rebalance $ deconstruct y))+ (Construct (extract x) $ Both (rebalance $ deconstruct x) y)++instance (forall a . Chain a) => Insertable Binary where+ x += (run -> Nothing) = lift . Construct x $ End+ x += tree@(run -> Just nonempty) = x <=> extract nonempty & order+ (tree & substitute @Left (x +=)) tree (tree & substitute @Right (x +=))++instance (forall a . Chain a) => Focusable Root Binary where+ type Focusing Root Binary a = Maybe a+ 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 Measurable Heighth Binary where+ type Measural Heighth Binary a = Numerator+ measurement (run . extract -> Just bt) = Numerator $ measure @Heighth bt+ measurement (run . extract -> Nothing) = Zero++instance Nullable Binary where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }++instance Substructure Left Binary where+ type Substructural Left Binary = Binary+ substructure empty_tree@(run . extract . run -> Nothing) = Store $ extract (run empty_tree) :*: (!) empty_tree+ substructure (run . extract . run -> Just tree) = lift . lift <$> sub @Left tree++instance Substructure Right Binary where+ type Substructural Right Binary = Binary+ substructure empty_tree@(run . extract . run -> Nothing) = Store $ extract (run empty_tree) :*: (!) empty_tree+ substructure (run . extract . run -> Just tree) = lift . lift <$> sub @Right tree++binary :: forall t a . (Traversable t, Chain a) => t a -> Binary a+binary struct = attached $ run @(State (Binary a)) % empty $ struct ->> modify @(Binary a) . insert' where++ insert' :: a -> Binary a -> Binary a+ insert' x (run -> Nothing) = lift . Construct x $ End+ insert' x tree@(run -> Just nonempty) = x <=> extract nonempty & order+ (tree & substitute @Left (insert' x)) tree (tree & substitute @Right (insert' x))++type instance Nonempty Binary = Construction Wye++instance Morphable (Into Binary) (Construction Wye) where+ type Morphing (Into Binary) (Construction Wye) = Binary+ morphing = lift . extract . run++instance Focusable Root (Construction Wye) where+ type Focusing Root (Construction Wye) a = a+ focusing (extract -> Construct x xs) = Store $ x :*: Tag . Construct % xs++instance (forall a . Chain a) => Insertable (Construction Wye) where+ x += b = let change = lift . resolve (x +=) (Construct x End) . run in+ x <=> extract b & order (over (sub @Left) change $ b) b (over (sub @Right) change $ b)++instance Measurable Heighth (Construction Wye) where+ type Measural Heighth (Construction Wye) a = Denumerator+ measurement (deconstruct . extract -> End) = One+ measurement (deconstruct . extract -> Left lst) = One + measure @Heighth lst+ measurement (deconstruct . extract -> Right rst) = One + measure @Heighth rst+ measurement (deconstruct . extract -> Both lst rst) = One ++ let (lm :*: rm) = measure @Heighth lst :*: measure @Heighth rst+ in lm <=> rm & order rm lm lm++instance Substructure Left (Construction Wye) where+ type Substructural Left (Construction Wye) = Binary+ substructure empty_tree@(extract . run -> Construct _ End) =+ Store $ empty :*: (empty_tree !)+ substructure (extract . run -> Construct x (Left lst)) =+ Store $ lift lst :*: lift . Construct x . resolve Left End . run+ substructure (extract . run -> Construct x (Right rst)) =+ Store $ empty :*: lift . Construct x . resolve (Both % rst) (Right rst) . run+ substructure (extract . run -> Construct x (Both lst rst)) =+ Store $ lift lst :*: lift . Construct x . resolve (Both % rst) (Right rst) . run++instance Substructure Right (Construction Wye) where+ type Substructural Right (Construction Wye) = Binary+ substructure emtpy_tree@(extract . run -> Construct _ End) =+ Store $ empty :*: (emtpy_tree !)+ substructure (extract . run -> Construct x (Left lst)) =+ Store $ empty :*: lift . Construct x . resolve (Both lst) (Left lst) . run+ substructure (extract . run -> Construct x (Right rst)) =+ Store $ lift rst :*: lift . Construct x . resolve Right End . run+ substructure (extract . run -> Construct x (Both lst rst)) =+ Store $ lift rst :*: lift . Construct x . resolve (Both lst) (Left lst) . run++data Biforked a = Top | Leftward a | Rightward a++instance Covariant Biforked where+ _ <$> Top = Top+ f <$> Leftward l = Leftward $ f l+ f <$> Rightward r = Rightward $ f r++type instance Zipper (Construction Wye) = T_U Covariant Covariant (Construction Wye) (:*:)+ ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye))++data Vertical a = Up a | Down a++instance Morphable (Rotate Up) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye))) where+ type Morphing (Rotate Up) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ morphing (run . extract . run -> focused :*: TU (TU (Rightward (Construct (T_U (Identity parent :*: rest)) next)))) =+ lift . T_U $ Construct parent (resolve (Both focused) (Left focused) $ run rest) :*: TU (TU next)+ morphing (run . extract . run -> focused :*: TU (TU (Rightward (Construct (T_U (Identity parent :*: rest)) next)))) =+ lift . T_U $ Construct parent (resolve (Both % focused) (Right focused) $ run rest) :*: TU (TU next)+ morphing (extract . run -> T_U (_ :*: TU (TU Top))) = empty++instance Morphable (Rotate (Down Left)) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye))) where+ type Morphing (Rotate (Down Left)) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ morphing (run . extract . run -> Construct x (Left lst) :*: TU (TU next)) =+ lift . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_U $ Identity x :*: empty) $ next+ morphing (run . extract . run -> Construct x (Both lst rst) :*: TU (TU next)) =+ lift . T_U . (:*:) lst . TU . TU . Leftward . Construct (T_U $ Identity x :*: lift rst) $ next+ morphing (run . extract . run -> Construct _ (Right _) :*: _) = empty+ morphing (run . extract . run -> Construct _ End :*: _) = empty++instance Morphable (Rotate (Down Right)) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye))) where+ type Morphing (Rotate (Down Right)) (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ = Maybe <:.> (T_U Covariant Covariant (Construction Wye) (:*:) ((Biforked <:.> Construction Biforked) <:.> T_U Covariant Covariant Identity (:*:) (Maybe <:.> Construction Wye)))+ morphing (run . extract . run -> Construct x (Right rst) :*: TU (TU next)) = lift . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_U $ Identity x :*: empty) $ next+ morphing (run . extract . run -> Construct x (Both lst rst) :*: TU (TU next)) = lift . T_U . (:*:) rst . TU . TU . Rightward . Construct (T_U $ Identity x :*: lift lst) $ next+ morphing (run . extract . run -> Construct _ (Left _) :*: _) = empty+ morphing (run . extract . run -> Construct _ End :*: _) = empty
+ Pandora/Paradigm/Structure/Some/Rose.hs view
@@ -0,0 +1,53 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Pandora.Paradigm.Structure.Some.Rose where++import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant (comap))+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.Function ((!), (%))+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)+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Inventory.Store (Store (Store))+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.Some.Stack (Stack)++type Rose = Maybe <:.> Construction Stack++instance Focusable Root Rose where+ type Focusing Root Rose a = Maybe a+ focusing (run . extract -> Nothing) = Store $ Nothing :*: Tag . TU . comap (Construct % empty)+ focusing (run . extract -> Just rose) = Store $ Just (extract rose)+ :*: Tag . resolve (lift . Construct % deconstruct rose) empty++instance Nullable Rose where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }++instance Substructure Just Rose where+ type Substructural Just Rose = Stack <:.> Construction Stack+ substructure (run . extract . run -> Nothing) =+ Store $ empty :*: (lift empty !)+ substructure (run . extract . run -> Just (Construct x xs)) =+ Store $ TU xs :*: lift . lift . Construct x . run++type instance Nonempty Rose = Construction Stack++instance Focusable Root (Construction Stack) where+ type Focusing Root (Construction Stack) a = a+ focusing (Tag rose) = Store $ extract rose :*: Tag . Construct % deconstruct rose++instance Substructure Just (Construction Stack) where+ type Substructural Just (Construction Stack) = Stack <:.> Construction Stack+ substructure (extract . run -> Construct x xs) = Store $ TU xs :*: lift . Construct x . run
+ Pandora/Paradigm/Structure/Some/Splay.hs view
@@ -0,0 +1,70 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE AllowAmbiguousTypes #-}++module Pandora.Paradigm.Structure.Some.Splay where++import Pandora.Core.Functor (type (~>), type (:.), type (:=))+import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Applicative ((<*>))+import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Paradigm.Primary ()+import Pandora.Paradigm.Primary.Functor (branches)+import Pandora.Paradigm.Primary.Functor.Function ((%))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))+import Pandora.Paradigm.Primary.Functor.Tagged (type (:#))+import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))+import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (||=))+import Pandora.Paradigm.Schemes (TU (TU), type (<:.>))+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate, Into), rotate, into)+import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)+import Pandora.Paradigm.Structure.Ability.Substructure (substitute)+import Pandora.Paradigm.Structure.Some.Binary (Binary)++data Splay a = Zig a | Zag a++instance Morphable (Rotate (Left Zig)) (Construction Wye) where+ type Morphing (Rotate (Left Zig)) (Construction Wye) = Binary+ morphing :: forall a . (:#) (Rotate (Left Zig)) <:.> Construction Wye := a -> Binary a+ morphing (extract . run -> Construct x xs) = TU $ Construct <$> parent <*> Just nodes where++ nodes :: Wye :. Nonempty Binary := a+ nodes = branches (branch @Left xs) . Just . Construct x+ $ branches (deconstruct <$> branch @Right xs >>= branch @Left)+ (deconstruct <$> branch @Right xs >>= branch @Right)++ parent :: Maybe a+ parent = extract <$> branch @Right xs++instance Morphable (Rotate (Right Zig)) (Construction Wye) where+ type Morphing (Rotate (Right Zig)) (Construction Wye) = Binary+ morphing :: forall a . (:#) (Rotate (Right Zig)) <:.> Construction Wye := a -> Binary a+ morphing (extract . run -> Construct x xs) = TU $ Construct <$> parent <*> Just nodes where++ nodes :: Wye :. Nonempty Binary := a+ nodes = branches (deconstruct <$> branch @Left xs >>= branch @Left) . Just . Construct x+ $ branches (deconstruct <$> branch @Left xs >>= branch @Right) (branch @Right xs)++ parent :: Maybe a+ parent = extract <$> branch @Left xs++instance Morphable (Rotate (Left (Zig Zig))) (Construction Wye) where+ type Morphing (Rotate (Left (Zig Zig))) (Construction Wye) = Binary+ morphing (extract . run -> tree) = TU $ run (rotate @(Left Zig) tree) >>= run . rotate @(Left Zig)++instance Morphable (Rotate (Right (Zig Zig))) (Construction Wye) where+ type Morphing (Rotate (Right (Zig Zig))) (Construction Wye) = Binary+ morphing (extract . run -> tree) = TU $ run (rotate @(Right Zig) tree) >>= run . rotate @(Right Zig)++instance Morphable (Rotate (Left (Zig Zag))) (Construction Wye) where+ type Morphing (Rotate (Left (Zig Zag))) (Construction Wye) = Binary+ morphing = rotate @(Left Zig) . substitute @Left ((>>= run . rotate @(Right Zig)) ||=) . extract . run++instance Morphable (Rotate (Right (Zig Zag))) (Construction Wye) where+ type Morphing (Rotate (Right (Zig Zag))) (Construction Wye) = Binary+ morphing = rotate @(Right Zig) . substitute @Right ((>>= run . rotate @(Left Zig)) ||=) . extract . run++branch :: forall b . Morphable (Into (b Maybe)) Wye => Wye ~> Morphing (Into (b Maybe)) Wye+branch = into @(b Maybe)
+ Pandora/Paradigm/Structure/Some/Stack.hs view
@@ -0,0 +1,156 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Pandora.Paradigm.Structure.Some.Stack where++import Pandora.Core.Functor (type (:.), type (:=))+import Pandora.Pattern ((.|..))+import Pandora.Pattern.Category ((.), ($), identity)+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Alternative ((<+>))+import Pandora.Pattern.Functor.Pointable (point)+import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Pattern.Functor.Avoidable (empty)+import Pandora.Pattern.Functor.Traversable (Traversable)+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 (Boolean (True, False), (?))+import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Numerator))+import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))+import Pandora.Paradigm.Primary.Functor.Function ((%), (&))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))+import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))+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.Tap (Tap (Tap))+import Pandora.Paradigm.Inventory.State (State, fold)+import Pandora.Paradigm.Inventory.Store (Store (Store))+import Pandora.Paradigm.Inventory.Optics (view)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))+import Pandora.Paradigm.Schemes.T_U (T_U (T_U), 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.Deletable (Deletable ((-=)))+import Pandora.Paradigm.Structure.Ability.Insertable (Insertable ((+=)))+import Pandora.Paradigm.Structure.Ability.Measurable (Measurable (Measural, measurement), Scale (Length), measure)+import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce))+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate, Into), rotate)+import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure), Segment (Tail), sub, subview)++-- | Linear data structure that serves as a collection of elements+type Stack = Maybe <:.> Construction Maybe++instance Setoid a => Setoid (Stack a) where+ TU ls == TU rs = ls == rs++instance Semigroup (Stack a) where+ TU Nothing + TU ys = TU ys+ TU (Just (Construct x xs)) + TU ys = lift . Construct x . run+ $ TU @Covariant @Covariant xs + TU @Covariant @Covariant ys++instance Monoid (Stack a) where+ zero = empty++instance Focusable Head Stack where+ type Focusing Head Stack a = Maybe a+ focusing (extract -> stack) = Store $ extract <$> run stack :*: \case+ Just x -> stack & subview @Tail & (x +=) & Tag+ Nothing -> stack & subview @Tail & Tag++instance Insertable Stack where+ x += (run -> stack) = TU $ (Construct x . Just <$> stack) <+> (point . point) x++instance Measurable Length Stack where+ type Measural Length Stack a = Numerator+ measurement (run . extract -> Nothing) = zero+ measurement (run . extract -> Just xs) = Numerator $ measure @Length xs++instance Nullable Stack where+ null = Predicate $ \case { TU Nothing -> True ; _ -> False }++instance Substructure Tail Stack where+ type Substructural Tail Stack = Stack+ substructure (run . extract . run -> Just ns) = lift . lift <$> sub @Tail ns+ substructure (run . extract . run -> Nothing) = Store $ empty :*: lift . identity++instance Deletable Stack where+ _ -= TU Nothing = TU Nothing+ x -= TU (Just (Construct y ys)) = x == y ? TU ys+ $ lift . Construct y . run . (-=) @Stack x $ TU ys++filter :: forall a . Predicate a -> Stack a -> Stack a+filter (Predicate p) = TU . extract+ . run @(State (Maybe :. Nonempty Stack := a)) % Nothing+ . fold (\now new -> p now ? Just (Construct now new) $ new)++-- | Transform any traversable structure into a stack+linearize :: forall t a . Traversable t => t a -> Stack a+linearize = TU . extract . run @(State (Maybe :. Nonempty Stack := a)) % Nothing . fold (Just .|.. Construct)++type instance Nonempty Stack = Construction Maybe++instance {-# OVERLAPS #-} Semigroup (Construction Maybe a) where+ Construct x Nothing + ys = Construct x $ Just ys+ Construct x (Just xs) + ys = Construct x . Just $ xs + ys++instance Morphable (Into Stack) (Construction Maybe) where+ type Morphing (Into Stack) (Construction Maybe) = Stack+ morphing = lift . extract . run++instance Focusable Head (Construction Maybe) where+ type Focusing Head (Construction Maybe) a = a+ focusing (extract -> stack) = Store $ extract stack :*: Tag . Construct % deconstruct stack++instance Insertable (Construction Maybe) where+ (+=) x = Construct x . Just++instance Measurable Length (Construction Maybe) where+ type Measural Length (Construction Maybe) a = Denumerator+ measurement (deconstruct . extract -> Nothing) = One+ measurement (deconstruct . extract -> Just xs) = One + measure @Length xs++instance Monotonic a (Construction Maybe a) where+ reduce f r ~(Construct x xs) = f x $ reduce f r xs++instance Substructure Tail (Construction Maybe) where+ type Substructural Tail (Construction Maybe) = Stack+ substructure (extract . run -> Construct x xs) =+ Store $ TU xs :*: lift . Construct x . run++type instance Zipper Stack = Tap ((:*:) <:.:> Stack)++instance {-# OVERLAPS #-} Extendable (Tap ((:*:) <:.:> Stack)) where+ z =>> f = let move rtt = TU . deconstruct $ rtt .-+ z+ in f <$> Tap z (T_U $ move (run . rotate @Left) :*: move (run . rotate @Right))++instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Stack)) where+ type Morphing (Rotate Left) (Tap ((:*:) <:.:> Stack)) = Maybe <:.> Zipper Stack+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU+ $ Tap % (T_U $ subview @Tail bs :*: x += fs) <$> view (focus @Head) bs++instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Stack)) where+ type Morphing (Rotate Right) (Tap ((:*:) <:.:> Stack)) = Maybe <:.> Zipper Stack+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU+ $ Tap % (T_U $ x += bs :*: subview @Tail fs) <$> view (focus @Head) fs++type instance Zipper (Construction Maybe) = Tap ((:*:) <:.:> Construction Maybe)++instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Construction Maybe)) where+ type Morphing (Rotate Left) (Tap ((:*:) <:.:> Construction Maybe)) = Maybe <:.> Zipper (Construction Maybe)+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU+ $ Tap (extract bs) . T_U . (:*: x += fs) <$> deconstruct bs++instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Construction Maybe)) where+ type Morphing (Rotate Right) (Tap ((:*:) <:.:> Construction Maybe)) = Maybe <:.> Zipper (Construction Maybe)+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU+ $ Tap (extract fs) . T_U . (x += bs :*:) <$> deconstruct fs++instance Monotonic a (Maybe <:.> Construction Maybe := a) where+ reduce f r = reduce f r . run
+ Pandora/Paradigm/Structure/Some/Stream.hs view
@@ -0,0 +1,40 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Pandora.Paradigm.Structure.Some.Stream where++import Pandora.Core.Functor (type (:=>))+import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Pointable (point)+import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))+import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))+import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))+import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct, (.-+))+import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap))+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate), rotate)+import Pandora.Paradigm.Structure.Ability.Zipper (Zipper)+import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>))++type Stream = Construction Identity++type instance Zipper Stream = Tap ((:*:) <:.:> Stream)++instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Stream)) where+ type Morphing (Rotate Left) (Tap ((:*:) <:.:> Stream)) = Tap ((:*:) <:.:> Stream)+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = Tap (extract bs) . T_U+ $ extract (deconstruct bs) :*: Construct x (point fs)++instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Stream)) where+ type Morphing (Rotate Right) (Tap ((:*:) <:.:> Stream)) = Tap ((:*:) <:.:> Stream)+ morphing (extract . run -> Tap x (T_U (bs :*: fs))) = Tap (extract fs) . T_U+ $ Construct x (point bs) :*: extract (deconstruct fs)++instance {-# OVERLAPS #-} Extendable (Tap ((:*:) <:.:> Stream)) where+ z =>> f = let move rtt = extract . deconstruct $ point . rtt .-+ z+ in f <$> Tap z (T_U $ move (rotate @Left) :*: move (rotate @Right))++repeat :: a :=> Stream+repeat x = Construct x . Identity $ repeat x
− Pandora/Paradigm/Structure/Splay.hs
@@ -1,51 +0,0 @@-{-# LANGUAGE UndecidableInstances #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Structure.Splay where--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, branches)-import Pandora.Paradigm.Primary.Functor.Function ((%))-import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))-import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))-import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct)-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (||=))-import Pandora.Paradigm.Schemes (TU (TU))-import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), morph)-import Pandora.Paradigm.Structure.Ability.Substructure (substitute)-import Pandora.Paradigm.Structure.Binary (Binary)--data Splay a = Zig a | Zag a--instance Morphable (Left Zig) (Construction Wye) where- type Morphing (Left Zig) (Construction Wye) = Binary- morphing (extract . run -> Construct parent st) = TU $ Construct % subtree . extract <$> left st where-- subtree = branches (deconstruct <$> left st >>= left) . Just . Construct parent- $ branches (deconstruct <$> left st >>= right) (right st)--instance Morphable (Right Zig) (Construction Wye) where- type Morphing (Right Zig) (Construction Wye) = Binary- morphing (extract . run -> Construct parent st) = TU $ Construct % subtree . extract <$> right st where-- subtree = branches (left st) . Just . Construct parent- $ branches (deconstruct <$> right st >>= left) (deconstruct <$> right st >>= right)--instance Morphable (Left (Zig Zig)) (Construction Wye) where- type Morphing (Left (Zig Zig)) (Construction Wye) = Binary- morphing (extract . run -> tree) = TU $ run (morph @(Left Zig) tree) >>= run . morph @(Left Zig)--instance Morphable (Right (Zig Zig)) (Construction Wye) where- type Morphing (Right (Zig Zig)) (Construction Wye) = Binary- morphing (extract . run -> tree) = TU $ run (morph @(Right Zig) tree) >>= run . morph @(Right Zig)--instance Morphable (Left (Zig Zag)) (Construction Wye) where- type Morphing (Left (Zig Zag)) (Construction Wye) = Binary- morphing = morph @(Left Zig) . substitute @Left ((>>= run . morph @(Right Zig)) ||=) . extract . run--instance Morphable (Right (Zig Zag)) (Construction Wye) where- type Morphing (Right (Zig Zag)) (Construction Wye) = Binary- morphing = morph @(Right Zig) . substitute @Right ((>>= run . morph @(Left Zig)) ||=) . extract . run
− Pandora/Paradigm/Structure/Stack.hs
@@ -1,156 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Structure.Stack where--import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Pattern ((.|..))-import Pandora.Pattern.Category ((.), ($), identity)-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))-import Pandora.Pattern.Functor.Alternative ((<+>))-import Pandora.Pattern.Functor.Pointable (point)-import Pandora.Pattern.Functor.Extractable (extract)-import Pandora.Pattern.Functor.Avoidable (empty)-import Pandora.Pattern.Functor.Traversable (Traversable)-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 (Boolean (True, False), (?))-import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Numerator))-import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))-import Pandora.Paradigm.Primary.Functor.Function ((%), (&))-import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))-import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate))-import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))-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.Tap (Tap (Tap))-import Pandora.Paradigm.Inventory.State (State, fold)-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (view)-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))-import Pandora.Paradigm.Schemes.T_U (T_U (T_U), 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.Deletable (Deletable (delete))-import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert))-import Pandora.Paradigm.Structure.Ability.Measurable (Measurable (Measural, measurement), Scale (Length), measure)-import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce))-import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate), morph)-import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure), Segment (Tail), sub, subview)---- | Linear data structure that serves as a collection of elements-type Stack = Maybe <:.> Construction Maybe--instance Setoid a => Setoid (Stack a) where- TU ls == TU rs = ls == rs--instance Semigroup (Stack a) where- TU Nothing + TU ys = TU ys- TU (Just (Construct x xs)) + TU ys = lift . Construct x . run- $ TU @Covariant @Covariant xs + TU @Covariant @Covariant ys--instance Monoid (Stack a) where- zero = empty--instance Focusable Head Stack where- type Focusing Head Stack a = Maybe a- focusing (extract -> stack) = Store $ extract <$> run stack :*: \case- Just x -> stack & subview @Tail & insert x & Tag- Nothing -> stack & subview @Tail & Tag--instance Insertable Stack where- insert x (run -> stack) = TU $ (Construct x . Just <$> stack) <+> (point . point) x--instance Measurable Length Stack where- type Measural Length Stack a = Numerator- measurement (run . extract -> Nothing) = zero- measurement (run . extract -> Just xs) = Numerator $ measure @Length xs--instance Nullable Stack where- null = Predicate $ \case { TU Nothing -> True ; _ -> False }--instance Substructure Tail Stack where- type Substructural Tail Stack = Stack- substructure (run . extract . run -> Just ns) = lift . lift <$> sub @Tail ns- substructure (run . extract . run -> Nothing) = Store $ empty :*: lift . identity--instance Deletable Stack where- delete _ (TU Nothing) = TU Nothing- delete x (TU (Just (Construct y ys))) = x == y ? TU ys- $ lift . Construct y . run . delete @Stack x $ TU ys--filter :: forall a . Predicate a -> Stack a -> Stack a-filter (Predicate p) = TU . extract- . run @(State (Maybe :. Nonempty Stack := a)) % Nothing- . fold (\now new -> p now ? Just (Construct now new) $ new)---- | Transform any traversable structure into a stack-linearize :: forall t a . Traversable t => t a -> Stack a-linearize = TU . extract . run @(State (Maybe :. Nonempty Stack := a)) % Nothing . fold (Just .|.. Construct)--type instance Nonempty Stack = Construction Maybe--instance {-# OVERLAPS #-} Semigroup (Construction Maybe a) where- Construct x Nothing + ys = Construct x $ Just ys- Construct x (Just xs) + ys = Construct x . Just $ xs + ys--instance Morphable Stack (Construction Maybe) where- type Morphing Stack (Construction Maybe) = Stack- morphing = lift . extract . run--instance Focusable Head (Construction Maybe) where- type Focusing Head (Construction Maybe) a = a- focusing (extract -> stack) = Store $ extract stack :*: Tag . Construct % deconstruct stack--instance Insertable (Construction Maybe) where- insert x = Construct x . Just--instance Measurable Length (Construction Maybe) where- type Measural Length (Construction Maybe) a = Denumerator- measurement (deconstruct . extract -> Nothing) = One- measurement (deconstruct . extract -> Just xs) = One + measure @Length xs--instance Monotonic a (Construction Maybe a) where- reduce f r ~(Construct x xs) = f x $ reduce f r xs--instance Substructure Tail (Construction Maybe) where- type Substructural Tail (Construction Maybe) = Stack- substructure (extract . run -> Construct x xs) =- Store $ TU xs :*: lift . Construct x . run--type instance Zipper Stack = Tap ((:*:) <:.:> Stack)--instance {-# OVERLAPS #-} Extendable (Tap ((:*:) <:.:> Stack)) where- z =>> f = let move rtt = TU . deconstruct $ rtt .-+ z- in f <$> Tap z (T_U $ move (run . morph @(Rotate Left)) :*: move (run . morph @(Rotate Right)))--instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Stack)) where- type Morphing (Rotate Left) (Tap ((:*:) <:.:> Stack)) = Maybe <:.> Zipper Stack- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU- $ Tap % (T_U $ subview @Tail bs :*: insert x fs) <$> view (focus @Head) bs--instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Stack)) where- type Morphing (Rotate Right) (Tap ((:*:) <:.:> Stack)) = Maybe <:.> Zipper Stack- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU- $ Tap % (T_U $ insert x bs :*: subview @Tail fs) <$> view (focus @Head) fs--type instance Zipper (Construction Maybe) = Tap ((:*:) <:.:> Construction Maybe)--instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Construction Maybe)) where- type Morphing (Rotate Left) (Tap ((:*:) <:.:> Construction Maybe)) = Maybe <:.> Zipper (Construction Maybe)- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU- $ Tap (extract bs) . T_U . (:*: insert x fs) <$> deconstruct bs--instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Construction Maybe)) where- type Morphing (Rotate Right) (Tap ((:*:) <:.:> Construction Maybe)) = Maybe <:.> Zipper (Construction Maybe)- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = TU- $ Tap (extract fs) . T_U . (insert x bs :*:) <$> deconstruct fs--instance Monotonic a (Maybe <:.> Construction Maybe := a) where- reduce f r = reduce f r . run
− Pandora/Paradigm/Structure/Stream.hs
@@ -1,40 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Structure.Stream where--import Pandora.Core.Functor (type (:=>))-import Pandora.Pattern.Category ((.), ($))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))-import Pandora.Pattern.Functor.Pointable (point)-import Pandora.Pattern.Functor.Extractable (extract)-import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)-import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:))-import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))-import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))-import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct, (.-+))-import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap))-import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate), morph)-import Pandora.Paradigm.Structure.Ability.Zipper (Zipper)-import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>))--type Stream = Construction Identity--type instance Zipper Stream = Tap ((:*:) <:.:> Stream)--instance Morphable (Rotate Left) (Tap ((:*:) <:.:> Stream)) where- type Morphing (Rotate Left) (Tap ((:*:) <:.:> Stream)) = Tap ((:*:) <:.:> Stream)- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = Tap (extract bs) . T_U- $ extract (deconstruct bs) :*: Construct x (point fs)--instance Morphable (Rotate Right) (Tap ((:*:) <:.:> Stream)) where- type Morphing (Rotate Right) (Tap ((:*:) <:.:> Stream)) = Tap ((:*:) <:.:> Stream)- morphing (extract . run -> Tap x (T_U (bs :*: fs))) = Tap (extract fs) . T_U- $ Construct x (point bs) :*: extract (deconstruct fs)--instance {-# OVERLAPS #-} Extendable (Tap ((:*:) <:.:> Stream)) where- z =>> f = let move rtt = extract . deconstruct $ point . rtt .-+ z- in f <$> Tap z (T_U $ move (morph @(Rotate Left)) :*: move (morph @(Rotate Right)))--repeat :: a :=> Stream-repeat x = Construct x . Identity $ repeat x
Pandora/Pattern/Category.hs view
@@ -1,5 +1,7 @@ module Pandora.Pattern.Category (Category (..)) where +import Pandora.Core.Functor (type (~~>))+ infixr 8 . infixr 0 $ @@ -7,7 +9,7 @@ identity :: m a a (.) :: m b c -> m a b -> m a c - ($) :: m a b -> m a b+ ($) :: m ~~> m ($) f = identity . f instance Category (->) where
Pandora/Pattern/Functor/Divariant.hs view
@@ -12,9 +12,9 @@ class Divariant (v :: * -> * -> *) where {-# MINIMAL (>->) #-}- (>->) :: v a b -> v c d -> v b c -> v a d+ (>->) :: (a -> b) -> (c -> d) -> v b c -> v a d -- | Prefix version of '>->'- dimap :: v a b -> v c d -> v b c -> v a d+ dimap :: (a -> b) -> (c -> d) -> v b c -> v a d dimap f g x = f >-> g $ x instance Divariant ((->)) where
Pandora/Pattern/Object/Setoid.hs view
@@ -1,22 +1,21 @@ module Pandora.Pattern.Object.Setoid (Setoid (..)) where import Pandora.Pattern.Category (($))-import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False, True), bool)+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False, True), (?)) -infix 4 ==, /=+infix 4 ==, != {- | > When providing a new instance, you should ensure it satisfies the four laws: > * Reflexivity: x == x ≡ True > * Symmetry: x == y ≡ y == x > * Transitivity: x == y * y == z ≡ True ===> x == z ≡ True-> * Negation: x /= y ≡ invert (x == y)+> * Negation: x != y ≡ invert (x == y) -} class Setoid a where {-# MINIMAL (==) #-} (==) :: a -> a -> Boolean - (/=) :: a -> a -> Boolean- -- (/=) x y = (x == y ? False) True- (/=) x y = bool True False $ x == y+ (!=) :: a -> a -> Boolean+ (!=) x y = x == y ? False $ True
pandora.cabal view
@@ -1,5 +1,5 @@ name: pandora-version: 0.3.6+version: 0.3.7 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@@ -52,6 +52,7 @@ Pandora.Paradigm.Primary.Transformer Pandora.Paradigm.Primary.Transformer.Backwards Pandora.Paradigm.Primary.Transformer.Reverse+ Pandora.Paradigm.Primary.Transformer.Flip Pandora.Paradigm.Primary.Transformer.Continuation Pandora.Paradigm.Primary.Transformer.Construction Pandora.Paradigm.Primary.Transformer.Instruction@@ -70,7 +71,6 @@ Pandora.Paradigm.Schemes.UT Pandora.Paradigm.Schemes.UTU Pandora.Paradigm.Schemes.T_U- Pandora.Paradigm.Schemes.T_ Pandora.Paradigm.Schemes.U_T -- Control flow primitives Pandora.Paradigm.Controlflow@@ -94,13 +94,7 @@ Pandora.Paradigm.Inventory.Store -- Tree-based datastructures Pandora.Paradigm.Structure- Pandora.Paradigm.Structure.Stream- Pandora.Paradigm.Structure.Stack- Pandora.Paradigm.Structure.Binary- Pandora.Paradigm.Structure.Splay- Pandora.Paradigm.Structure.Rose Pandora.Paradigm.Structure.Ability- Pandora.Paradigm.Structure.Ability.Comprehension Pandora.Paradigm.Structure.Ability.Morphable Pandora.Paradigm.Structure.Ability.Deletable Pandora.Paradigm.Structure.Ability.Accessible@@ -112,8 +106,18 @@ Pandora.Paradigm.Structure.Ability.Nullable Pandora.Paradigm.Structure.Ability.Zipper Pandora.Paradigm.Structure.Ability.Monotonic+ Pandora.Paradigm.Structure.Modification+ Pandora.Paradigm.Structure.Modification.Comprehension+ Pandora.Paradigm.Structure.Modification.Prefixed Pandora.Paradigm.Structure.Interface Pandora.Paradigm.Structure.Interface.Set+ Pandora.Paradigm.Structure.Interface.Dictionary+ Pandora.Paradigm.Structure.Some+ Pandora.Paradigm.Structure.Some.Stream+ Pandora.Paradigm.Structure.Some.Stack+ Pandora.Paradigm.Structure.Some.Binary+ Pandora.Paradigm.Structure.Some.Splay+ Pandora.Paradigm.Structure.Some.Rose Pandora.Pattern -- Category typeclass