pandora 0.4.9 → 0.5.0
raw patch · 70 files changed
+949/−858 lines, 70 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e) (Pandora.Paradigm.Inventory.Imprint.Imprint e)
- Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Equipment.Equipment e) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Store.Store s) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.Accumulator: Accumulator :: (e :*: a) -> Accumulator e a
- Pandora.Paradigm.Inventory.Accumulator: gather :: Accumulated e t => e -> t ()
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e)
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e)
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Pattern.Object.Monoid.Monoid e => Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e)
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e)
- Pandora.Paradigm.Inventory.Accumulator: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Accumulator.Accumulator e)
- Pandora.Paradigm.Inventory.Accumulator: newtype Accumulator e a
- Pandora.Paradigm.Inventory.Accumulator: type Accumulated e t = Adaptable t (->) (Accumulator e)
- Pandora.Paradigm.Inventory.Equipment: Equipment :: (e :*: a) -> Equipment e a
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Equipment.Equipment e)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Equipment.Equipment e)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Equipment.Equipment e)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Extendable.Extendable (->) u => Pandora.Pattern.Functor.Extendable.Extendable (->) ((Pandora.Paradigm.Primary.Algebraic.Product.:*:) e Pandora.Paradigm.Schemes.TU.<:.> u)
- Pandora.Paradigm.Inventory.Equipment: instance Pandora.Pattern.Functor.Traversable.Traversable (->) (->) (Pandora.Paradigm.Inventory.Equipment.Equipment e)
- Pandora.Paradigm.Inventory.Equipment: newtype Equipment e a
- Pandora.Paradigm.Inventory.Equipment: retrieve :: Equipped e t => t a -> e
- Pandora.Paradigm.Inventory.Imprint: Imprint :: (e -> a) -> Imprint e a
- Pandora.Paradigm.Inventory.Imprint: instance (Pandora.Pattern.Object.Semigroup.Semigroup e, Pandora.Pattern.Functor.Extendable.Extendable (->) u) => Pandora.Pattern.Functor.Extendable.Extendable (->) ((->) e Pandora.Paradigm.Schemes.UT.<.:> u)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Imprint.Imprint e)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Imprint.Imprint a)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Imprint.Imprint e)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Distributive.Distributive (->) (->) (Pandora.Paradigm.Inventory.Imprint.Imprint e)
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Functor.Divariant.Divariant (->) (->) (->) Pandora.Paradigm.Inventory.Imprint.Imprint
- Pandora.Paradigm.Inventory.Imprint: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Imprint.Imprint e)
- Pandora.Paradigm.Inventory.Imprint: newtype Imprint e a
- Pandora.Paradigm.Inventory.Imprint: type Traceable e t = Adaptable t (->) (Imprint e)
- Pandora.Paradigm.Inventory.Optics: (>>>) :: Lensic previous next => Lens previous source between -> Lens next between target -> Lens (Lensally previous next) source target
- Pandora.Paradigm.Inventory.Optics: class Lensic previous next where {
- Pandora.Paradigm.Inventory.Optics: infixl 2 #=@
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Core.Impliable.Impliable (Pandora.Paradigm.Schemes.P_Q_T.P_Q_T (->) Pandora.Paradigm.Inventory.Store.Store Pandora.Paradigm.Primary.Functor.Identity.Identity source target)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Core.Impliable.Impliable (Pandora.Paradigm.Schemes.P_Q_T.P_Q_T (->) Pandora.Paradigm.Inventory.Store.Store Pandora.Paradigm.Primary.Functor.Maybe.Maybe source target)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Paradigm.Inventory.Optics.Lensic Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Primary.Functor.Maybe.Maybe
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Paradigm.Inventory.Optics.Lensic Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Primary.Functor.Identity.Identity
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Category.Category (Pandora.Paradigm.Inventory.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Category.Category (Pandora.Paradigm.Inventory.Optics.Lens Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip (Pandora.Paradigm.Inventory.Optics.Lens available) tgt)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity source)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Optics.Lens Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Inventory.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Optics.Lens t) => Pandora.Paradigm.Inventory.Optics.Lensic t t
- Pandora.Paradigm.Inventory.Optics: over :: Lens available source target -> (available target -> available target) -> source -> source
- Pandora.Paradigm.Inventory.Optics: represent :: forall t a. (Representable t, Setoid (Representation t)) => Representation t -> Convex Lens (t a) a
- Pandora.Paradigm.Inventory.Optics: set :: Lens available source target -> available target -> source -> source
- Pandora.Paradigm.Inventory.Optics: type (#=@) source target available = forall a. Lens available (source a) (target a)
- Pandora.Paradigm.Inventory.Optics: type Lens = P_Q_T (->) Store
- Pandora.Paradigm.Inventory.Optics: type family Lensally previous next :: * -> *;
- Pandora.Paradigm.Inventory.Optics: view :: Lens available source target -> source -> available target
- Pandora.Paradigm.Inventory.Optics: }
- Pandora.Paradigm.Inventory.Provision: Provision :: (e -> a) -> Provision e a
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Provision.Provision a)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Distributive.Distributive (->) (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Monad.Monad (->) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Provision.Provision e)
- Pandora.Paradigm.Inventory.Provision: newtype Provision e a
- Pandora.Paradigm.Inventory.Provision: provided :: Provided e t => t e
- Pandora.Paradigm.Inventory.Provision: type Provided e t = Adaptable t (->) (Provision e)
- Pandora.Paradigm.Inventory.State: State :: (((->) s :. (:*:) s) := a) -> State s a
- Pandora.Paradigm.Inventory.State: current :: Stateful s t => t s
- Pandora.Paradigm.Inventory.State: fold :: (Traversable (->) (->) t, Memorable s u) => (a -> s -> s) -> t a -> u s
- Pandora.Paradigm.Inventory.State: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.State.State r)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Monad.Monad (->) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.State.State s)
- Pandora.Paradigm.Inventory.State: modify :: Stateful s t => (s -> s) -> t s
- Pandora.Paradigm.Inventory.State: newtype State s a
- Pandora.Paradigm.Inventory.State: reconcile :: (Bindable (->) t, Stateful s t, Adaptable t (->) u) => (s -> u s) -> t s
- Pandora.Paradigm.Inventory.State: replace :: Stateful s t => s -> t s
- Pandora.Paradigm.Inventory.State: type Memorable s t = (Covariant (->) (->) t, Pointable t, Stateful s t)
- Pandora.Paradigm.Inventory.State: type Stateful s t = Adaptable t (->) (State s)
- Pandora.Paradigm.Inventory.Store: Store :: (((:*:) s :. (->) s) := a) -> Store s a
- Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic.Comonadic (->) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Comonad.Comonad (->) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Store.Store r)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Store.Store s)
- Pandora.Paradigm.Inventory.Store: look :: Storable s t => s -> a <:= t
- Pandora.Paradigm.Inventory.Store: newtype Store s a
- Pandora.Paradigm.Inventory.Store: position :: Storable s t => t a -> s
- Pandora.Paradigm.Inventory.Store: retrofit :: (s -> s) -> Store s ~> Store s
- Pandora.Paradigm.Inventory.Store: type Storable s t = Adaptable (Store s) (->) t
- Pandora.Paradigm.Primary.Algebraic: (-+-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:+:) t) => t a -> t a -> t a
- Pandora.Paradigm.Primary.Algebraic.Exponential: instance Pandora.Pattern.Functor.Divariant.Divariant (->) (->) (->) (->)
- Pandora.Paradigm.Primary.Algebraic.Product: instance (Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) t, Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) u) => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Primary.Algebraic.Product: instance (Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) t, Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) u) => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Primary.Algebraic.Product: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:)
- Pandora.Paradigm.Primary.Algebraic.Product: twosome :: t a -> u a -> (<:.:>) t u (:*:) a
- Pandora.Paradigm.Primary.Algebraic.Sum: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) (Pandora.Paradigm.Primary.Algebraic.Sum.:+:)
- Pandora.Paradigm.Primary.Functor: match :: Predicate a -> (a -> r) -> a -> r -> r :*: a
- Pandora.Paradigm.Primary.Functor.Conclusion: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) Pandora.Paradigm.Primary.Functor.Conclusion.Conclusion
- Pandora.Paradigm.Primary.Functor.Constant: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) Pandora.Paradigm.Primary.Functor.Constant.Constant
- Pandora.Paradigm.Primary.Functor.Tagged: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) Pandora.Paradigm.Primary.Functor.Tagged.Tagged
- Pandora.Paradigm.Primary.Functor.Validation: instance Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) Pandora.Paradigm.Primary.Functor.Validation.Validation
- Pandora.Paradigm.Primary.Linear.Vector: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Linear.Vector.Vector r)
- Pandora.Paradigm.Primary.Linear.Vector: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) (Pandora.Paradigm.Primary.Linear.Vector.Vector r)
- Pandora.Paradigm.Primary.Object.Boolean: (?) :: Boolean -> a -> a -> a
- Pandora.Paradigm.Primary.Object.Boolean: infixr 1 ?
- Pandora.Paradigm.Primary.Transformer.Tap: instance Pandora.Pattern.Functor.Traversable.Traversable (->) (->) t => Pandora.Pattern.Functor.Traversable.Traversable (->) (->) (Pandora.Paradigm.Primary.Transformer.Tap.Tap ((t Pandora.Paradigm.Schemes.T_U.<:.:> t) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:)))
- 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 (->) (->) ((t Pandora.Paradigm.Schemes.T_U.>:.:> u) Pandora.Core.Functor.:= p)
- Pandora.Paradigm.Schemes.T_U: instance (forall i. Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (p i), Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) p, Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) t, Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) u) => Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) ((t Pandora.Paradigm.Schemes.T_U.>:.:< u) Pandora.Core.Functor.:= p)
- Pandora.Paradigm.Schemes.T_U: instance (forall i. Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (p i), Pandora.Pattern.Functor.Bivariant.Bivariant (->) (->) (->) p, Pandora.Pattern.Functor.Covariant.Covariant (->) (->) t, Pandora.Pattern.Functor.Covariant.Covariant (->) (->) u) => Pandora.Pattern.Functor.Covariant.Covariant (->) (->) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= p)
- Pandora.Paradigm.Structure.Some.Binary: instance Pandora.Pattern.Object.Chain.Chain k => Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Vary 'Pandora.Paradigm.Structure.Ability.Morphable.Element) (Pandora.Paradigm.Structure.Modification.Prefixed.Prefixed Pandora.Paradigm.Structure.Some.Binary.Binary k)
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Paradigm.Structure.Some.List.List
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Pattern.Functor.Extendable.Extendable (->) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.List: instance Pandora.Pattern.Functor.Traversable.Traversable (->) (->) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.List.List Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.List.List) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- 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.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.Stream.Stream Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- 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.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.Stream.Stream Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Paradigm.Structure.Some.Stream: instance Pandora.Pattern.Functor.Extendable.Extendable (->) ((Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Schemes.T_U.<:.:> ((Pandora.Paradigm.Structure.Some.Stream.Stream Pandora.Paradigm.Schemes.T_U.<:.:> Pandora.Paradigm.Structure.Some.Stream.Stream) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
- Pandora.Pattern.Functor.Bivariant: (<->) :: Bivariant left right target v => left a b -> right c d -> target (v a c) (v b d)
- Pandora.Pattern.Functor.Bivariant: class (forall i. Covariant left target (v i), forall i. Covariant right target (Flip v i)) => Bivariant left right target v
- Pandora.Pattern.Functor.Bivariant: infixl 4 <->
- Pandora.Pattern.Functor.Contravariant: (>!<) :: Contravariant source target t => source a b -> target (t b) (t a)
- Pandora.Pattern.Functor.Covariant: (<!!!>) :: (Covariant source target t, Covariant source (Betwixt source (Betwixt source target)) v, Covariant (Betwixt source (Betwixt source target)) (Betwixt (Betwixt source target) target) u, Covariant (Betwixt (Betwixt source target) target) target t) => source a b -> target (t (u (v a))) (t (u (v b)))
- Pandora.Pattern.Functor.Covariant: (<!!>) :: (Covariant source target t, Covariant source (Betwixt source target) u, Covariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))
- Pandora.Pattern.Functor.Covariant: (<!>) :: Covariant source target t => source a b -> target (t a) (t b)
- Pandora.Pattern.Functor.Divariant: (>->) :: Divariant left right target v => left a b -> right c d -> target (v b c) (v a d)
- Pandora.Pattern.Functor.Divariant: class (forall i. Contravariant left target (Flip v i), forall i. Covariant right target (v i)) => Divariant left right target v
- Pandora.Pattern.Functor.Divariant: infixl 4 >->
+ Pandora.Paradigm.Controlflow.Effect.Conditional: (?) :: Conditional clause => clause -> a -> a -> a
+ Pandora.Paradigm.Controlflow.Effect.Conditional: class Conditional clause
+ Pandora.Paradigm.Controlflow.Effect.Conditional: infixr 1 ?
+ Pandora.Paradigm.Controlflow.Effect.Conditional: instance Pandora.Paradigm.Controlflow.Effect.Conditional.Conditional (Pandora.Paradigm.Primary.Functor.Maybe.Maybe a)
+ Pandora.Paradigm.Controlflow.Effect.Conditional: instance Pandora.Paradigm.Controlflow.Effect.Conditional.Conditional Pandora.Paradigm.Primary.Object.Boolean.Boolean
+ Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e) (Pandora.Paradigm.Inventory.Some.Imprint.Imprint e)
+ Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Some.Equipment.Equipment e) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory: instance Pandora.Pattern.Functor.Adjoint.Adjoint (->) (->) (Pandora.Paradigm.Inventory.Some.Store.Store s) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Ability.Gettable: class Gettable i where {
+ Pandora.Paradigm.Inventory.Ability.Gettable: get :: Gettable i => Getting i e r
+ Pandora.Paradigm.Inventory.Ability.Gettable: type family Getting i e r :: *;
+ Pandora.Paradigm.Inventory.Ability.Gettable: }
+ Pandora.Paradigm.Inventory.Ability.Modifiable: class (Gettable i, Settable i) => Modifiable i where {
+ Pandora.Paradigm.Inventory.Ability.Modifiable: modify :: Modifiable i => Modification i e r
+ Pandora.Paradigm.Inventory.Ability.Modifiable: type family Modification i e r :: *;
+ Pandora.Paradigm.Inventory.Ability.Modifiable: }
+ Pandora.Paradigm.Inventory.Ability.Settable: class Settable i where {
+ Pandora.Paradigm.Inventory.Ability.Settable: set :: Settable i => Setting i e r
+ Pandora.Paradigm.Inventory.Ability.Settable: type family Setting i e r :: *;
+ Pandora.Paradigm.Inventory.Ability.Settable: }
+ Pandora.Paradigm.Inventory.Some.Accumulator: Accumulator :: (e :*: a) -> Accumulator e a
+ Pandora.Paradigm.Inventory.Some.Accumulator: gather :: Accumulated e t => e -> t ()
+ Pandora.Paradigm.Inventory.Some.Accumulator: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Accumulator: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Accumulator: instance Pandora.Pattern.Object.Monoid.Monoid e => Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Accumulator: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Accumulator: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Accumulator.Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Accumulator: newtype Accumulator e a
+ Pandora.Paradigm.Inventory.Some.Accumulator: type Accumulated e t = Adaptable t (->) (Accumulator e)
+ Pandora.Paradigm.Inventory.Some.Equipment: Equipment :: (e :*: a) -> Equipment e a
+ Pandora.Paradigm.Inventory.Some.Equipment: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.Equipment.Equipment e)
+ Pandora.Paradigm.Inventory.Some.Equipment: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.Equipment.Equipment e)
+ Pandora.Paradigm.Inventory.Some.Equipment: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Some.Equipment.Equipment e)
+ Pandora.Paradigm.Inventory.Some.Equipment: instance Pandora.Pattern.Functor.Extendable.Extendable (->) u => Pandora.Pattern.Functor.Extendable.Extendable (->) ((Pandora.Paradigm.Primary.Algebraic.Product.:*:) e Pandora.Paradigm.Schemes.TU.<:.> u)
+ Pandora.Paradigm.Inventory.Some.Equipment: instance Pandora.Pattern.Functor.Traversable.Traversable (->) (->) (Pandora.Paradigm.Inventory.Some.Equipment.Equipment e)
+ Pandora.Paradigm.Inventory.Some.Equipment: newtype Equipment e a
+ Pandora.Paradigm.Inventory.Some.Equipment: retrieve :: Equipped e t => t a -> e
+ Pandora.Paradigm.Inventory.Some.Imprint: Imprint :: (e -> a) -> Imprint e a
+ Pandora.Paradigm.Inventory.Some.Imprint: instance (Pandora.Pattern.Object.Semigroup.Semigroup e, Pandora.Pattern.Functor.Extendable.Extendable (->) u) => Pandora.Pattern.Functor.Extendable.Extendable (->) ((->) e Pandora.Paradigm.Schemes.UT.<.:> u)
+ Pandora.Paradigm.Inventory.Some.Imprint: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.Imprint.Imprint e)
+ Pandora.Paradigm.Inventory.Some.Imprint: instance Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Some.Imprint.Imprint a)
+ Pandora.Paradigm.Inventory.Some.Imprint: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.Imprint.Imprint e)
+ Pandora.Paradigm.Inventory.Some.Imprint: instance Pandora.Pattern.Functor.Distributive.Distributive (->) (->) (Pandora.Paradigm.Inventory.Some.Imprint.Imprint e)
+ Pandora.Paradigm.Inventory.Some.Imprint: instance Pandora.Pattern.Object.Semigroup.Semigroup e => Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Some.Imprint.Imprint e)
+ Pandora.Paradigm.Inventory.Some.Imprint: newtype Imprint e a
+ Pandora.Paradigm.Inventory.Some.Imprint: type Traceable e t = Adaptable t (->) (Imprint e)
+ Pandora.Paradigm.Inventory.Some.Optics: (>>>) :: Lensic previous next => Lens previous source between -> Lens next between target -> Lens (Lensally previous next) source target
+ Pandora.Paradigm.Inventory.Some.Optics: class Lensic previous next where {
+ Pandora.Paradigm.Inventory.Some.Optics: infixl 2 #=@
+ Pandora.Paradigm.Inventory.Some.Optics: instance (Pandora.Paradigm.Inventory.Ability.Gettable.Gettable (Pandora.Paradigm.Inventory.Some.Optics.Lens t), Pandora.Pattern.Functor.Covariant.Covariant (->) (->) t, Pandora.Paradigm.Primary.Algebraic.Pointable t) => Pandora.Paradigm.Inventory.Ability.Modifiable.Modifiable (Pandora.Paradigm.Inventory.Some.Optics.Lens t)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Core.Impliable.Impliable (Pandora.Paradigm.Schemes.P_Q_T.P_Q_T (->) Pandora.Paradigm.Inventory.Some.Store.Store Pandora.Paradigm.Primary.Functor.Identity.Identity source target)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Core.Impliable.Impliable (Pandora.Paradigm.Schemes.P_Q_T.P_Q_T (->) Pandora.Paradigm.Inventory.Some.Store.Store Pandora.Paradigm.Primary.Functor.Maybe.Maybe source target)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Paradigm.Inventory.Ability.Gettable.Gettable (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Paradigm.Inventory.Ability.Gettable.Gettable (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Paradigm.Inventory.Some.Optics.Lensic Pandora.Paradigm.Primary.Functor.Identity.Identity Pandora.Paradigm.Primary.Functor.Maybe.Maybe
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Paradigm.Inventory.Some.Optics.Lensic Pandora.Paradigm.Primary.Functor.Maybe.Maybe Pandora.Paradigm.Primary.Functor.Identity.Identity
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Paradigm.Primary.Algebraic.Pointable t => Pandora.Paradigm.Inventory.Ability.Settable.Settable (Pandora.Paradigm.Inventory.Some.Optics.Lens t)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Category.Category (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Category.Category (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip (Pandora.Paradigm.Inventory.Some.Optics.Lens available) tgt)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity source)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Identity.Identity)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Some.Optics.Lens Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Inventory.Some.Optics: instance Pandora.Pattern.Semigroupoid.Semigroupoid (Pandora.Paradigm.Inventory.Some.Optics.Lens t) => Pandora.Paradigm.Inventory.Some.Optics.Lensic t t
+ Pandora.Paradigm.Inventory.Some.Optics: represent :: forall t a. (Representable t, Setoid (Representation t)) => Representation t -> Convex Lens (t a) a
+ Pandora.Paradigm.Inventory.Some.Optics: type (#=@) source target available = forall a. Lens available (source a) (target a)
+ Pandora.Paradigm.Inventory.Some.Optics: type Lens = P_Q_T (->) Store
+ Pandora.Paradigm.Inventory.Some.Optics: type family Lensally previous next :: * -> *;
+ Pandora.Paradigm.Inventory.Some.Optics: }
+ Pandora.Paradigm.Inventory.Some.Provision: Provision :: (e -> a) -> Provision e a
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Paradigm.Inventory.Ability.Gettable.Gettable Pandora.Paradigm.Inventory.Some.Provision.Provision
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Some.Provision.Provision a)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Distributive.Distributive (->) (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Monad.Monad (->) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Provision.Provision e)
+ Pandora.Paradigm.Inventory.Some.Provision: newtype Provision e a
+ Pandora.Paradigm.Inventory.Some.Provision: provided :: Provided e t => t e
+ Pandora.Paradigm.Inventory.Some.Provision: type Provided e t = Adaptable t (->) (Provision e)
+ Pandora.Paradigm.Inventory.Some.State: State :: (((->) s :. (:*:) s) := a) -> State s a
+ Pandora.Paradigm.Inventory.Some.State: fold :: (Traversable (->) (->) t, Memorable s u) => (a -> s -> s) -> t a -> u s
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic.Monadic (->) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Paradigm.Inventory.Ability.Gettable.Gettable Pandora.Paradigm.Inventory.Some.State.State
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Paradigm.Inventory.Ability.Modifiable.Modifiable Pandora.Paradigm.Inventory.Some.State.State
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Paradigm.Inventory.Ability.Settable.Settable Pandora.Paradigm.Inventory.Some.State.State
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Bindable.Bindable (->) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Some.State.State r)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Monad.Monad (->) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.State.State s)
+ Pandora.Paradigm.Inventory.Some.State: newtype State s a
+ Pandora.Paradigm.Inventory.Some.State: reconcile :: (Bindable (->) t, Stateful s t, Adaptable t (->) u) => (s -> u s) -> t s
+ Pandora.Paradigm.Inventory.Some.State: type Memorable s t = (Covariant (->) (->) t, Pointable t, Stateful s t)
+ Pandora.Paradigm.Inventory.Some.State: type Stateful s t = Adaptable t (->) (State s)
+ Pandora.Paradigm.Inventory.Some.Store: Store :: (((:*:) s :. (->) s) := a) -> Store s a
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic.Comonadic (->) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Comonad.Comonad (->) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Invariant.Invariant (Pandora.Pattern.Morphism.Flip.Flip Pandora.Paradigm.Inventory.Some.Store.Store r)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Monoidal.Monoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: instance Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Inventory.Some.Store.Store s)
+ Pandora.Paradigm.Inventory.Some.Store: look :: Storable s t => s -> a <:= t
+ Pandora.Paradigm.Inventory.Some.Store: newtype Store s a
+ Pandora.Paradigm.Inventory.Some.Store: position :: Storable s t => t a -> s
+ Pandora.Paradigm.Inventory.Some.Store: retrofit :: (s -> s) -> Store s ~> Store s
+ Pandora.Paradigm.Inventory.Some.Store: type Storable s t = Adaptable (Store s) (->) t
+ Pandora.Paradigm.Primary: instance (Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) t, Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) u) => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.-->) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
+ Pandora.Paradigm.Primary: twosome :: t a -> u a -> (<:.:>) t u (:*:) a
+ Pandora.Paradigm.Primary.Algebraic: (.-+-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:+:) t) => t a -> t a -> t a
+ Pandora.Paradigm.Primary.Algebraic: (<-|-<-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d. (Covariant m m (p a), Covariant m m (Flip p d), Interpreted m (Flip p d)) => (m a b :*: m c d) -> m (p a c) (p b d)
+ Pandora.Paradigm.Primary.Algebraic: (<-|->-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d. (Covariant m m (Flip p c), Contravariant m m (p a), Interpreted m (Flip p c)) => (m a b :*: m c d) -> m (p a d) (p b c)
+ Pandora.Paradigm.Primary.Algebraic: (>-|-<-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d. (Contravariant m m (Flip p d), Covariant m m (p b), Interpreted m (Flip p d)) => (m a b :*: m c d) -> m (p b c) (p a d)
+ Pandora.Paradigm.Primary.Algebraic: (>-|->-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d. (Contravariant m m (p b), Contravariant m m (Flip p c), Interpreted m (Flip p c)) => (m a b :*: m c d) -> m (p b d) (p a c)
+ Pandora.Paradigm.Primary.Algebraic: infixl 0 >-|->-|-
+ Pandora.Paradigm.Primary.Algebraic: instance (Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) t, Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) u) => Pandora.Pattern.Functor.Semimonoidal.Semimonoidal (Pandora.Paradigm.Primary.Algebraic.Exponential.<--) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) (Pandora.Paradigm.Primary.Algebraic.Product.:*:) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= (Pandora.Paradigm.Primary.Algebraic.Product.:*:))
+ Pandora.Paradigm.Schemes.T_U: instance (Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) t, forall a. Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (p (t a)), Pandora.Pattern.Functor.Covariant.Covariant (->) (->) u, forall b. Pandora.Pattern.Functor.Contravariant.Contravariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip p (u b))) => Pandora.Pattern.Functor.Covariant.Covariant (->) (->) ((t Pandora.Paradigm.Schemes.T_U.>:.:> u) Pandora.Core.Functor.:= p)
+ Pandora.Paradigm.Schemes.T_U: instance (forall i. Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (p i), forall o. Pandora.Pattern.Functor.Covariant.Covariant (->) (->) (Pandora.Pattern.Morphism.Flip.Flip p o), Pandora.Pattern.Functor.Covariant.Covariant (->) (->) t, Pandora.Pattern.Functor.Covariant.Covariant (->) (->) u) => Pandora.Pattern.Functor.Covariant.Covariant (->) (->) ((t Pandora.Paradigm.Schemes.T_U.<:.:> u) Pandora.Core.Functor.:= p)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Primary.Linear.Vector.Vector r)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) (Pandora.Paradigm.Primary.Linear.Vector.Vector r)
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Possible.Possible o (o Pandora.Paradigm.Primary.Algebraic.Sum.:+: a)
+ Pandora.Paradigm.Structure.Modification.Turnover: Turnover :: t a -> Turnover t a
+ Pandora.Paradigm.Structure.Modification.Turnover: instance (Pandora.Pattern.Functor.Covariant.Covariant m m t, Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted m (Pandora.Paradigm.Structure.Modification.Turnover.Turnover t)) => Pandora.Pattern.Functor.Covariant.Covariant m m (Pandora.Paradigm.Structure.Modification.Turnover.Turnover t)
+ Pandora.Paradigm.Structure.Modification.Turnover: instance Pandora.Paradigm.Controlflow.Effect.Interpreted.Interpreted (->) (Pandora.Paradigm.Structure.Modification.Turnover.Turnover t)
+ Pandora.Paradigm.Structure.Modification.Turnover: instance forall k (structure :: * -> *) (segment :: k). (Pandora.Pattern.Functor.Covariant.Covariant (->) (->) structure, Pandora.Paradigm.Structure.Ability.Substructure.Substructure segment structure) => Pandora.Paradigm.Structure.Ability.Substructure.Substructure segment (Pandora.Paradigm.Structure.Modification.Turnover.Turnover structure)
+ Pandora.Paradigm.Structure.Modification.Turnover: newtype Turnover t a
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)) (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)) Pandora.Paradigm.Structure.Some.List.List
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into (Pandora.Paradigm.Structure.Modification.Comprehension.Comprehension Pandora.Paradigm.Primary.Functor.Maybe.Maybe)) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Into Pandora.Paradigm.Structure.Some.List.List) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Left) (Pandora.Paradigm.Structure.Modification.Turnover.Turnover (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Structure.Ability.Zipper.Tape (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Paradigm.Structure.Ability.Morphable.Morphable ('Pandora.Paradigm.Structure.Ability.Morphable.Rotate 'Pandora.Paradigm.Primary.Functor.Wye.Right) (Pandora.Paradigm.Structure.Modification.Turnover.Turnover (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List))
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.List: instance Pandora.Pattern.Functor.Traversable.Traversable (->) (->) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.List.List)
+ Pandora.Paradigm.Structure.Some.Splay: try_to_rotate :: forall direction. Morphed (Rotate direction) (Nonempty Binary) Binary => Nonempty Binary ~> Nonempty Binary
+ 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.Structure.Ability.Zipper.Tape 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.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.Stream.Stream)
+ Pandora.Paradigm.Structure.Some.Stream: instance Pandora.Pattern.Functor.Extendable.Extendable (->) (Pandora.Paradigm.Structure.Ability.Zipper.Tape Pandora.Paradigm.Structure.Some.Stream.Stream)
+ Pandora.Pattern.Functor.Contravariant: (>$$<) :: (Contravariant source target t, Contravariant source (Betwixt source target) u, Contravariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))
+ Pandora.Pattern.Functor.Contravariant: (>$<) :: Contravariant source target t => source a b -> target (t b) (t a)
+ Pandora.Pattern.Functor.Contravariant: (>-|-|-) :: (Contravariant source target t, Contravariant source (Betwixt source target) u, Contravariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))
+ Pandora.Pattern.Functor.Contravariant: infixl 3 >$$<
+ Pandora.Pattern.Functor.Covariant: (<$$$>) :: (Covariant source target t, Covariant source (Betwixt source (Betwixt source target)) v, Covariant (Betwixt source (Betwixt source target)) (Betwixt (Betwixt source target) target) u, Covariant (Betwixt (Betwixt source target) target) target t) => source a b -> target (t (u (v a))) (t (u (v b)))
+ Pandora.Pattern.Functor.Covariant: (<$$>) :: (Covariant source target t, Covariant source (Betwixt source target) u, Covariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))
+ Pandora.Pattern.Functor.Covariant: (<$>) :: Covariant source target t => source a b -> target (t a) (t b)
- Pandora.Paradigm.Controlflow.Effect.Interpreted: infixr 2 ||=
+ Pandora.Paradigm.Controlflow.Effect.Interpreted: infixr 2 =||
- Pandora.Paradigm.Inventory: (=<>) :: Stateful src t => Lens available src tgt -> available tgt -> t src
+ Pandora.Paradigm.Inventory: (=<>) :: (Pointable available, Stateful src t) => Lens available src tgt -> tgt -> t src
- Pandora.Paradigm.Inventory: (~<>) :: Stateful src t => Lens available src tgt -> (available tgt -> available tgt) -> t src
+ Pandora.Paradigm.Inventory: (~<>) :: (Pointable available, Covariant (->) (->) available, Gettable (Lens available), Stateful src t) => Lens available src tgt -> (tgt -> tgt) -> t src
- Pandora.Paradigm.Primary.Algebraic: infixl 3 -+-
+ Pandora.Paradigm.Primary.Algebraic: infixl 3 .-+-
- Pandora.Paradigm.Structure.Ability.Zipper: type Tape t = Identity <:.:> (t <:.:> t := (:*:)) := (:*:)
+ Pandora.Paradigm.Structure.Ability.Zipper: type Tape t = Identity <:.:> (Reverse t <:.:> t := (:*:)) := (:*:)
- Pandora.Pattern.Functor.Contravariant: infixl 4 >!<
+ Pandora.Pattern.Functor.Contravariant: infixl 4 >$<
- Pandora.Pattern.Functor.Covariant: infixl 2 <!!!>
+ Pandora.Pattern.Functor.Covariant: infixl 2 <$$$>
- Pandora.Pattern.Functor.Covariant: infixl 3 <!!>
+ Pandora.Pattern.Functor.Covariant: infixl 3 <$$>
- Pandora.Pattern.Functor.Covariant: infixl 4 <!>
+ Pandora.Pattern.Functor.Covariant: infixl 4 <$>
Files
- CHANGELOG.md +18/−0
- Pandora/Paradigm/Controlflow/Effect.hs +1/−0
- Pandora/Paradigm/Controlflow/Effect/Adaptable.hs +3/−5
- Pandora/Paradigm/Controlflow/Effect/Conditional.hs +18/−0
- Pandora/Paradigm/Controlflow/Effect/Transformer/Comonadic.hs +0/−1
- Pandora/Paradigm/Controlflow/Effect/Transformer/Monadic.hs +0/−1
- Pandora/Paradigm/Inventory.hs +9/−13
- Pandora/Paradigm/Inventory/Ability.hs +5/−0
- Pandora/Paradigm/Inventory/Ability/Gettable.hs +6/−0
- Pandora/Paradigm/Inventory/Ability/Modifiable.hs +9/−0
- Pandora/Paradigm/Inventory/Ability/Settable.hs +7/−0
- Pandora/Paradigm/Inventory/Accumulator.hs +0/−47
- Pandora/Paradigm/Inventory/Equipment.hs +0/−40
- Pandora/Paradigm/Inventory/Imprint.hs +0/−46
- Pandora/Paradigm/Inventory/Optics.hs +0/−121
- Pandora/Paradigm/Inventory/Provision.hs +0/−62
- Pandora/Paradigm/Inventory/Some.hs +9/−0
- Pandora/Paradigm/Inventory/Some/Accumulator.hs +47/−0
- Pandora/Paradigm/Inventory/Some/Equipment.hs +39/−0
- Pandora/Paradigm/Inventory/Some/Imprint.hs +41/−0
- Pandora/Paradigm/Inventory/Some/Optics.hs +126/−0
- Pandora/Paradigm/Inventory/Some/Provision.hs +65/−0
- Pandora/Paradigm/Inventory/Some/State.hs +82/−0
- Pandora/Paradigm/Inventory/Some/Store.hs +71/−0
- Pandora/Paradigm/Inventory/State.hs +0/−82
- Pandora/Paradigm/Inventory/Store.hs +0/−74
- Pandora/Paradigm/Primary.hs +12/−5
- Pandora/Paradigm/Primary/Algebraic.hs +37/−7
- Pandora/Paradigm/Primary/Algebraic/Exponential.hs +0/−5
- Pandora/Paradigm/Primary/Algebraic/Product.hs +0/−18
- Pandora/Paradigm/Primary/Algebraic/Sum.hs +0/−6
- Pandora/Paradigm/Primary/Functor.hs +4/−4
- Pandora/Paradigm/Primary/Functor/Conclusion.hs +0/−4
- Pandora/Paradigm/Primary/Functor/Constant.hs +0/−4
- Pandora/Paradigm/Primary/Functor/Endo.hs +3/−2
- Pandora/Paradigm/Primary/Functor/Identity.hs +2/−3
- Pandora/Paradigm/Primary/Functor/Tagged.hs +2/−6
- Pandora/Paradigm/Primary/Functor/Validation.hs +0/−4
- Pandora/Paradigm/Primary/Linear/Vector.hs +0/−12
- Pandora/Paradigm/Primary/Object/Boolean.hs +0/−6
- Pandora/Paradigm/Primary/Transformer/Backwards.hs +2/−3
- Pandora/Paradigm/Primary/Transformer/Construction.hs +2/−3
- Pandora/Paradigm/Primary/Transformer/Reverse.hs +2/−3
- Pandora/Paradigm/Primary/Transformer/Tap.hs +4/−11
- Pandora/Paradigm/Schemes/TT.hs +3/−4
- Pandora/Paradigm/Schemes/TU.hs +3/−4
- Pandora/Paradigm/Schemes/TUT.hs +2/−3
- Pandora/Paradigm/Schemes/T_U.hs +12/−12
- Pandora/Paradigm/Schemes/UT.hs +3/−4
- Pandora/Paradigm/Structure.hs +23/−7
- Pandora/Paradigm/Structure/Ability/Accessible.hs +1/−1
- Pandora/Paradigm/Structure/Ability/Possible.hs +1/−1
- Pandora/Paradigm/Structure/Ability/Substructure.hs +4/−5
- Pandora/Paradigm/Structure/Ability/Zipper.hs +16/−12
- Pandora/Paradigm/Structure/Interface/Set.hs +3/−2
- Pandora/Paradigm/Structure/Modification.hs +1/−0
- Pandora/Paradigm/Structure/Modification/Comprehension.hs +2/−3
- Pandora/Paradigm/Structure/Modification/Turnover.hs +24/−0
- Pandora/Paradigm/Structure/Some/Binary.hs +42/−43
- Pandora/Paradigm/Structure/Some/List.hs +110/−72
- Pandora/Paradigm/Structure/Some/Rose.hs +3/−3
- Pandora/Paradigm/Structure/Some/Splay.hs +15/−10
- Pandora/Paradigm/Structure/Some/Stream.hs +15/−15
- Pandora/Pattern/Functor.hs +0/−2
- Pandora/Pattern/Functor/Bivariant.hs +0/−16
- Pandora/Pattern/Functor/Contravariant.hs +12/−3
- Pandora/Pattern/Functor/Covariant.hs +9/−9
- Pandora/Pattern/Functor/Divariant.hs +0/−17
- Pandora/Pattern/Object/Setoid.hs +4/−2
- pandora.cabal +15/−10
CHANGELOG.md view
@@ -648,3 +648,21 @@ * Change priority of `:*:` operator * Change priority of `!` operator * Remove `$` operator in favor of `!`++0.5.0+* Define experimental `<-|-<-|-`, `<-|->-|-`, `>-|->-|-`, `>-|-<-|-` methods+* Define `>-|-|-` method in `Contravariant` typeclass+* Remove `Bivariant` typeclass+* Remove `Divariant` typeclass+* Define `Turnover` wrapper for data structures that can that can be rotated indefinitely+* Wrap left part of `Tape` into `Reverse`+* Rename `-+-` operator to `.-+-` in Algebraic module+* Define `Ability` umbrella module (like in `Structure`) in `Inventory`+* Define experimenal `Gettable`, `Settable` and `Modifiable` typeclasses+* Define `Some` umbrella module (like in `Structure`) in `Inventory`+* Remove `current`, `replace`, `modify` methods of `State` effect+* Remove `view` method of `Lens`+* Remove `set` method of `Lens`+* Define experimental `Conditional` typeclass+* Remove `?` method of `Boolean` datatype+* Remove `over` method of `Lens`
Pandora/Paradigm/Controlflow/Effect.hs view
@@ -1,5 +1,6 @@ module Pandora.Paradigm.Controlflow.Effect (module Exports) where import Pandora.Paradigm.Controlflow.Effect.Transformer as Exports+import Pandora.Paradigm.Controlflow.Effect.Conditional as Exports import Pandora.Paradigm.Controlflow.Effect.Interpreted as Exports import Pandora.Paradigm.Controlflow.Effect.Adaptable as Exports
Pandora/Paradigm/Controlflow/Effect/Adaptable.hs view
@@ -1,19 +1,17 @@ {-# LANGUAGE UndecidableInstances #-}- module Pandora.Paradigm.Controlflow.Effect.Adaptable where import Pandora.Core.Functor (type (#))-import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Pattern.Semigroupoid (Semigroupoid ((.))) import Pandora.Pattern.Category (Category (identity)) import Pandora.Pattern.Functor.Covariant (Covariant) import Pandora.Pattern.Functor.Monoidal (Monoidal)-import Pandora.Pattern.Transformer (Liftable (lift), Lowerable (lower))+import Pandora.Pattern.Transformer (Liftable (lift)) import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:))-import Pandora.Paradigm.Primary.Algebraic (Extractable, Pointable, extract, point)+import Pandora.Paradigm.Primary.Algebraic (Pointable, extract, point) import Pandora.Paradigm.Primary.Functor.Identity (Identity)-import Pandora.Paradigm.Controlflow.Effect.Transformer (Monadic, Comonadic, wrap, bring, (:>), (:<))+import Pandora.Paradigm.Controlflow.Effect.Transformer (Monadic, wrap, (:>)) class Adaptable u m t where {-# MINIMAL adapt #-}
+ Pandora/Paradigm/Controlflow/Effect/Conditional.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+module Pandora.Paradigm.Controlflow.Effect.Conditional where++import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))++infixr 1 ?++class Conditional clause where+ (?) :: clause -> a -> a -> a++instance Conditional Boolean where+ (?) True x _ = x+ (?) False _ y = y++instance Conditional (Maybe a) where+ (?) (Just _) x _ = x+ (?) Nothing _ y = y
Pandora/Paradigm/Controlflow/Effect/Transformer/Comonadic.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE UndecidableInstances #-}- module Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (..), (:<) (..)) where import Pandora.Pattern.Semigroupoid ((.))
Pandora/Paradigm/Controlflow/Effect/Transformer/Monadic.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE UndecidableInstances #-}- module Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (..), (:>) (..)) where import Pandora.Pattern.Morphism.Straight (Straight (Straight))
Pandora/Paradigm/Inventory.hs view
@@ -1,15 +1,9 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Inventory (module Exports, zoom, overlook, (=<>), (~<>)) where -import Pandora.Paradigm.Inventory.Optics as Exports-import Pandora.Paradigm.Inventory.Store as Exports-import Pandora.Paradigm.Inventory.State as Exports-import Pandora.Paradigm.Inventory.Imprint as Exports-import Pandora.Paradigm.Inventory.Equipment as Exports-import Pandora.Paradigm.Inventory.Provision as Exports-import Pandora.Paradigm.Inventory.Accumulator as Exports+import Pandora.Paradigm.Inventory.Ability as Exports+import Pandora.Paradigm.Inventory.Some as Exports import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Category ((#))@@ -20,7 +14,7 @@ import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Exponential ((%), type (<--))-import Pandora.Paradigm.Primary.Algebraic (extract)+import Pandora.Paradigm.Primary.Algebraic (Pointable, extract) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt)) @@ -47,8 +41,10 @@ overlook :: (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t) => State s result -> State (t s) (t result) overlook (State state) = State ! \ts -> mult @(<--) @(:*:) @(:*:) ! (state <-|- ts) -(=<>) :: Stateful src t => Lens available src tgt -> available tgt -> t src-lens =<> new = modify ! set lens new+(=<>) :: (Pointable available, Stateful src t)+ => Lens available src tgt -> tgt -> t src+lens =<> new = adapt (modify @State ! set @(Lens _) new lens) -(~<>) :: Stateful src t => Lens available src tgt -> (available tgt -> available tgt) -> t src-lens ~<> f = modify ! over lens f+(~<>) :: (Pointable available, Covariant (->) (->) available, Gettable (Lens available), Stateful src t)+ => Lens available src tgt -> (tgt -> tgt) -> t src+lens ~<> f = adapt (modify @State ! modify @(Lens _) f lens)
+ Pandora/Paradigm/Inventory/Ability.hs view
@@ -0,0 +1,5 @@+module Pandora.Paradigm.Inventory.Ability (module Exports) where++import Pandora.Paradigm.Inventory.Ability.Modifiable as Exports+import Pandora.Paradigm.Inventory.Ability.Settable as Exports+import Pandora.Paradigm.Inventory.Ability.Gettable as Exports
+ Pandora/Paradigm/Inventory/Ability/Gettable.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+module Pandora.Paradigm.Inventory.Ability.Gettable where++class Gettable i where+ type family Getting i e r :: *+ get :: Getting i e r
+ Pandora/Paradigm/Inventory/Ability/Modifiable.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+module Pandora.Paradigm.Inventory.Ability.Modifiable where++import Pandora.Paradigm.Inventory.Ability.Gettable (Gettable)+import Pandora.Paradigm.Inventory.Ability.Settable (Settable)++class (Gettable i, Settable i) => Modifiable i where+ type Modification i e r :: *+ modify :: Modification i e r
+ Pandora/Paradigm/Inventory/Ability/Settable.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE AllowAmbiguousTypes #-}+module Pandora.Paradigm.Inventory.Ability.Settable where++class Settable i where+ type family Setting i e r :: *+ set:: Setting i e r+
− Pandora/Paradigm/Inventory/Accumulator.hs
@@ -1,47 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}-module Pandora.Paradigm.Inventory.Accumulator (Accumulator (..), Accumulated, gather) where--import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Category ((#))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))-import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Object.Monoid (Monoid)-import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))-import Pandora.Paradigm.Primary.Algebraic (point)-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))-import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))--newtype Accumulator e a = Accumulator (e :*: a)--instance Covariant (->) (->) (Accumulator e) where- f <-|- Accumulator x = Accumulator ! f <-|- x--instance Semigroup e => Semimonoidal (-->) (:*:) (:*:) (Accumulator e) where- mult = Straight ! \(x :*: y) -> Accumulator ! k # run x # run y where- k ~(ex :*: x') ~(ey :*: y') = ex + ey :*: x' :*: y'--instance Semigroup e => Bindable (->) (Accumulator e) where- f =<< Accumulator (e :*: x) = let e' :*: b = run @(->) ! f x in- Accumulator ! e + e':*: b--type instance Schematic Monad (Accumulator e) = (<.:>) ((:*:) e)--instance Interpreted (->) (Accumulator e) where- type Primary (Accumulator e) a = e :*: a- run ~(Accumulator x) = x- unite = Accumulator--instance Monoid e => Monadic (->) (Accumulator e) where- wrap = TM . UT . point . run--type Accumulated e t = Adaptable t (->) (Accumulator e)--gather :: Accumulated e t => e -> t ()-gather x = adapt . Accumulator ! x :*: ()
− Pandora/Paradigm/Inventory/Equipment.hs
@@ -1,40 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Inventory.Equipment (Equipment (..), retrieve) where--import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))-import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Paradigm.Primary.Algebraic ()-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached)-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))--newtype Equipment e a = Equipment (e :*: a)--instance Covariant (->) (->) (Equipment e) where- f <-|- Equipment x = Equipment ! f <-|- x--instance Traversable (->) (->) (Equipment e) where- f <<- Equipment x = Equipment <-|- f <<- x--instance Extendable (->) (Equipment e) where- f <<= Equipment (e :*: x) = Equipment . (:*:) e . f . Equipment ! e :*: x--instance Interpreted (->) (Equipment e) where- type Primary (Equipment e) a = e :*: a- run ~(Equipment x) = x- unite = Equipment--type instance Schematic Comonad (Equipment e) = (<:.>) ((:*:) e)--type Equipped e t = Adaptable (Equipment e) (->) t--instance {-# OVERLAPS #-} Extendable (->) u => Extendable (->) ((:*:) e <:.> u) where- f <<= TU (e :*: x) = TU . (:*:) e ! f . TU . (:*:) e <<= x--retrieve :: Equipped e t => t a -> e-retrieve = attached . run @(->) @(Equipment _) . adapt
− Pandora/Paradigm/Inventory/Imprint.hs
@@ -1,46 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Inventory.Imprint (Imprint (..), Traceable) where--import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-)))-import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))-import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Pattern.Functor.Divariant (Divariant ((>->)))-import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-import Pandora.Paradigm.Primary.Algebraic.Exponential ()-import Pandora.Pattern.Morphism.Flip (Flip (Flip))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (||=), (!)))-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable)-import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))--newtype Imprint e a = Imprint (e -> a)--instance Covariant (->) (->) (Imprint e) where- f <-|- Imprint g = Imprint ! f . g--instance Contravariant (->) (->) (Flip Imprint a) where- f >-|- Flip (Imprint g) = Flip . Imprint ! g . f--instance Distributive (->) (->) (Imprint e) where- f -<< g = Imprint ! (run @(->) <-|- f) -<< g--instance Divariant (->) (->) (->) Imprint where- (>->) ab cd bc = ab >-> cd ||= bc--instance Semigroup e => Extendable (->) (Imprint e) where- f <<= Imprint x = Imprint ! \e -> f . Imprint ! x . (e +)--instance Interpreted (->) (Imprint e) where- type Primary (Imprint e) a = (->) e a- run ~(Imprint x) = x- unite = Imprint--type instance Schematic Comonad (Imprint e) = (<.:>) ((->) e)--instance {-# OVERLAPS #-} (Semigroup e, Extendable (->) u) => Extendable (->) ((->) e <.:> u) where- f <<= UT x = UT ! (\x' e -> f . UT . (<-|-) (. (e +)) ! x') <<= x--type Traceable e t = Adaptable t (->) (Imprint e)
− Pandora/Paradigm/Inventory/Optics.hs
@@ -1,121 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}-{-# LANGUAGE UndecidableInstances #-}--module Pandora.Paradigm.Inventory.Optics where--import Pandora.Core.Impliable (Impliable (Arguments, imply))-import Pandora.Pattern.Semigroupoid (Semigroupoid ((.)))-import Pandora.Pattern.Category (Category (identity, (#)))-import Pandora.Pattern.Kernel (Kernel (constant))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))-import Pandora.Pattern.Functor.Divariant ((>->))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))-import Pandora.Pattern.Functor.Representable (Representable (Representation, (<#>), tabulate))-import Pandora.Pattern.Object.Setoid (Setoid ((==)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (run, (!)))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->), (%))-import Pandora.Paradigm.Primary.Algebraic (extract)-import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))-import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))-import Pandora.Pattern.Morphism.Flip (Flip (Flip))-import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Paradigm.Primary.Object.Boolean ((?))-import Pandora.Paradigm.Inventory.Store (Store (Store), position, look, retrofit)-import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T))-import Pandora.Paradigm.Structure.Ability.Monotonic (resolve)--infixl 2 #=@--type Lens = P_Q_T (->) Store--instance Invariant (Flip (Lens available) tgt) where- f <!< g = \(Flip (P_Q_T lens)) -> Flip . P_Q_T ! g >-> (f <-|-) # lens--type family Convex lens where- Convex Lens = Lens Identity--instance Semigroupoid (Lens Identity) where- (.) :: Convex Lens between target -> Convex Lens source between -> Convex Lens source target- P_Q_T to . P_Q_T from = P_Q_T ! \source ->- let (Identity between :*: bs) = run # from source in- let (Identity target :*: tb) = run # to between in- Store ! Identity target :*: bs . Identity . tb--instance Category (Lens Identity) where- identity :: Convex Lens source source- identity = imply @(Convex Lens _ _) identity ((%) constant)--instance Semimonoidal (-->) (:*:) (:*:) (Lens Identity source) where- mult = Straight ! \(P_Q_T x :*: P_Q_T y) -> P_Q_T ! \source ->- let Store (Identity xt :*: ixts) :*: Store (Identity yt :*: _) = x source :*: y source in- Store ! Identity (xt :*: yt) :*: \(Identity (xt_ :*: yt_)) ->- let modified = ixts (Identity xt_) in- extract # run (y modified) # Identity yt_--instance Impliable (P_Q_T (->) Store Identity source target) where- type Arguments (P_Q_T (->) Store Identity source target) =- (source -> target) -> (source -> target -> source) -> Lens Identity source target- imply getter setter = P_Q_T ! \source -> Store ! Identity # getter source :*: setter source . extract--type family Obscure lens where- Obscure Lens = Lens Maybe--instance Impliable (P_Q_T (->) Store Maybe source target) where- type Arguments (P_Q_T (->) Store Maybe source target) =- (source -> Maybe target) -> (source -> Maybe target -> source) -> Lens Maybe source target- imply getter setter = P_Q_T ! \source -> Store ! getter source :*: setter source--instance Semigroupoid (Lens Maybe) where- (.) :: Obscure Lens between target -> Obscure Lens source between -> Obscure Lens source target- P_Q_T to . P_Q_T from = P_Q_T ! \source -> case run # from source of- (Nothing :*: _) -> Store ! Nothing :*: \_ -> source- (Just between :*: mbs) -> case run # to between of- (Nothing :*: _) -> Store ! Nothing :*: \_ -> source- (Just target :*: mtb) -> Store ! Just target :*: mbs . Just . mtb--instance Category (Lens Maybe) where- identity :: Obscure Lens source source- identity = imply @(Obscure Lens _ _) # Just # resolve identity---- Lens as natural transformation-type (#=@) source target available = forall a . Lens available (source a) (target a)---- | Get focused target value-view :: Lens available source target -> source -> available target-view lens = position @_ @(Store _) . run lens---- Replace focused target value with new value-set :: Lens available source target -> available target -> source -> source-set lens new = look new . run lens---- | Modify focused target value-over :: Lens available source target -> (available target -> available target) -> source -> source-over lens f = extract . retrofit f . run lens---- | Representable based lens-represent :: forall t a . (Representable t, Setoid (Representation t)) => Representation t -> Convex Lens (t a) a-represent r = imply @(Convex Lens (t a) a) (r <#>) (\source target -> tabulate ! \r' -> r' == r ? target ! r' <#> source)--class Lensic previous next where- type Lensally previous next :: * -> *- (>>>) :: Lens previous source between -> Lens next between target -> Lens (Lensally previous next) source target--instance Semigroupoid (Lens t) => Lensic t t where- type Lensally t t = t- x >>> y = y . x--instance Lensic Maybe Identity where- type Lensally Maybe Identity = Maybe- P_Q_T from >>> P_Q_T to = P_Q_T ! \source -> case run # from source of- (Nothing :*: _) -> Store ! Nothing :*: \_ -> source- (Just between :*: mbs) -> case run # to between of- (Identity target :*: itb) -> Store ! Just target :*: \mt -> mbs ! itb . Identity <-|- mt--instance Lensic Identity Maybe where- type Lensally Identity Maybe = Maybe- P_Q_T from >>> P_Q_T to = P_Q_T ! \source -> case run # from source of- (Identity between :*: ibs) -> case run # to between of- (Just target :*: mtb) -> Store ! Just target :*: ibs . Identity . mtb- (Nothing :*: _) -> Store ! Nothing :*: \_ -> source
− Pandora/Paradigm/Inventory/Provision.hs
@@ -1,62 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}-module Pandora.Paradigm.Inventory.Provision where--import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Category (identity, (#))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-)))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))-import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))-import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))-import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Functor.Divariant (Divariant ((>->)))-import Pandora.Pattern.Functor.Bivariant ((<->))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->), (%))-import Pandora.Paradigm.Primary.Algebraic ()-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:))-import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (point)-import Pandora.Pattern.Morphism.Flip (Flip (Flip))-import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))-import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))--newtype Provision e a = Provision (e -> a)--instance Covariant (->) (->) (Provision e) where- f <-|- Provision x = Provision ! f . x--instance Contravariant (->) (->) (Flip Provision a) where- f >-|- Flip (Provision g) = Flip . Provision ! g . f--instance Semimonoidal (-->) (:*:) (:*:) (Provision e) where- mult = Straight ! Provision . (mult @(-->) !) . (run @(->) <-> run @(->))--instance Monoidal (-->) (-->) (:*:) (:*:) (Provision e) where- unit _ = Straight ! \f -> Provision ! \_ -> run f One--instance Distributive (->) (->) (Provision e) where- f -<< g = Provision ! (run @(->) <-|- f) -<< g--instance Bindable (->) (Provision e) where- f =<< Provision x = Provision ! \e -> (run % e) . f . x ! e--instance Monad (->) (Provision e) where--instance Interpreted (->) (Provision e) where- type Primary (Provision e) a = (->) e a- run ~(Provision x) = x- unite = Provision--type instance Schematic Monad (Provision e) = (<:.>) ((->) e)--instance Monadic (->) (Provision e) where- wrap x = TM . TU ! point <-|- run x--type Provided e t = Adaptable t (->) (Provision e)--provided :: Provided e t => t e-provided = adapt # Provision identity
+ Pandora/Paradigm/Inventory/Some.hs view
@@ -0,0 +1,9 @@+module Pandora.Paradigm.Inventory.Some (module Exports) where++import Pandora.Paradigm.Inventory.Some.Optics as Exports+import Pandora.Paradigm.Inventory.Some.State as Exports+import Pandora.Paradigm.Inventory.Some.Store as Exports+import Pandora.Paradigm.Inventory.Some.Imprint as Exports+import Pandora.Paradigm.Inventory.Some.Accumulator as Exports+import Pandora.Paradigm.Inventory.Some.Provision as Exports+import Pandora.Paradigm.Inventory.Some.Equipment as Exports
+ Pandora/Paradigm/Inventory/Some/Accumulator.hs view
@@ -0,0 +1,47 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.Accumulator (Accumulator (..), Accumulated, gather) where++import Pandora.Pattern.Morphism.Straight (Straight (Straight))+import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Category ((#))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))+import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))+import Pandora.Pattern.Functor.Monad (Monad)+import Pandora.Pattern.Object.Monoid (Monoid)+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic (point)+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))+import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))++newtype Accumulator e a = Accumulator (e :*: a)++instance Covariant (->) (->) (Accumulator e) where+ f <-|- Accumulator x = Accumulator ! f <-|- x++instance Semigroup e => Semimonoidal (-->) (:*:) (:*:) (Accumulator e) where+ mult = Straight ! \(x :*: y) -> Accumulator ! k # run x # run y where+ k ~(ex :*: x') ~(ey :*: y') = ex + ey :*: x' :*: y'++instance Semigroup e => Bindable (->) (Accumulator e) where+ f =<< Accumulator (e :*: x) = let e' :*: b = run @(->) ! f x in+ Accumulator ! e + e':*: b++type instance Schematic Monad (Accumulator e) = (<.:>) ((:*:) e)++instance Interpreted (->) (Accumulator e) where+ type Primary (Accumulator e) a = e :*: a+ run ~(Accumulator x) = x+ unite = Accumulator++instance Monoid e => Monadic (->) (Accumulator e) where+ wrap = TM . UT . point . run++type Accumulated e t = Adaptable t (->) (Accumulator e)++gather :: Accumulated e t => e -> t ()+gather x = adapt . Accumulator ! x :*: ()
+ Pandora/Paradigm/Inventory/Some/Equipment.hs view
@@ -0,0 +1,39 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.Equipment (Equipment (..), retrieve) where++import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))+import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Paradigm.Primary.Algebraic ()+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached)+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))++newtype Equipment e a = Equipment (e :*: a)++instance Covariant (->) (->) (Equipment e) where+ f <-|- Equipment x = Equipment ! f <-|- x++instance Traversable (->) (->) (Equipment e) where+ f <<- Equipment x = Equipment <-|- f <<- x++instance Extendable (->) (Equipment e) where+ f <<= Equipment (e :*: x) = Equipment . (:*:) e . f . Equipment ! e :*: x++instance Interpreted (->) (Equipment e) where+ type Primary (Equipment e) a = e :*: a+ run ~(Equipment x) = x+ unite = Equipment++type instance Schematic Comonad (Equipment e) = (<:.>) ((:*:) e)++type Equipped e t = Adaptable (Equipment e) (->) t++instance {-# OVERLAPS #-} Extendable (->) u => Extendable (->) ((:*:) e <:.> u) where+ f <<= TU (e :*: x) = TU . (:*:) e ! f . TU . (:*:) e <<= x++retrieve :: Equipped e t => t a -> e+retrieve = attached . run @(->) @(Equipment _) . adapt
+ Pandora/Paradigm/Inventory/Some/Imprint.hs view
@@ -0,0 +1,41 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.Imprint (Imprint (..), Traceable) where++import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-)))+import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))+import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Paradigm.Primary.Algebraic ()+import Pandora.Pattern.Morphism.Flip (Flip (Flip))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable)+import Pandora.Paradigm.Schemes.UT (UT (UT), type (<.:>))++newtype Imprint e a = Imprint (e -> a)++instance Covariant (->) (->) (Imprint e) where+ f <-|- Imprint g = Imprint ! f . g++instance Contravariant (->) (->) (Flip Imprint a) where+ f >-|- Flip (Imprint g) = Flip . Imprint ! g . f++instance Distributive (->) (->) (Imprint e) where+ f -<< g = Imprint ! (run @(->) <-|- f) -<< g++instance Semigroup e => Extendable (->) (Imprint e) where+ f <<= Imprint x = Imprint ! \e -> f . Imprint ! x . (e +)++instance Interpreted (->) (Imprint e) where+ type Primary (Imprint e) a = (->) e a+ run ~(Imprint x) = x+ unite = Imprint++type instance Schematic Comonad (Imprint e) = (<.:>) ((->) e)++instance {-# OVERLAPS #-} (Semigroup e, Extendable (->) u) => Extendable (->) ((->) e <.:> u) where+ f <<= UT x = UT ! (\x' e -> f . UT . (<-|-) (. (e +)) ! x') <<= x++type Traceable e t = Adaptable t (->) (Imprint e)
+ Pandora/Paradigm/Inventory/Some/Optics.hs view
@@ -0,0 +1,126 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE UndecidableInstances #-}+module Pandora.Paradigm.Inventory.Some.Optics where++import Pandora.Core.Impliable (Impliable (Arguments, imply))+import Pandora.Pattern.Semigroupoid (Semigroupoid ((.)))+import Pandora.Pattern.Category (Category (identity, (#)))+import Pandora.Pattern.Kernel (Kernel (constant))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))+import Pandora.Pattern.Functor.Representable (Representable (Representation, (<#>), tabulate))+import Pandora.Pattern.Object.Setoid (Setoid ((==)))+import Pandora.Paradigm.Controlflow.Effect.Conditional (Conditional ((?)))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (run, (!)))+import Pandora.Paradigm.Inventory.Ability.Gettable (Gettable (Getting, get))+import Pandora.Paradigm.Inventory.Ability.Settable (Settable (Setting, set))+import Pandora.Paradigm.Inventory.Ability.Modifiable (Modifiable (Modification, modify))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->), (%))+import Pandora.Paradigm.Primary.Algebraic (Pointable, point, extract, (>-|-<-|-))+import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))+import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing))+import Pandora.Pattern.Morphism.Flip (Flip (Flip))+import Pandora.Pattern.Morphism.Straight (Straight (Straight))+import Pandora.Paradigm.Inventory.Some.Store (Store (Store), position, look, retrofit)+import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T))+import Pandora.Paradigm.Structure.Ability.Monotonic (resolve)++infixl 2 #=@++type Lens = P_Q_T (->) Store++instance Invariant (Flip (Lens available) tgt) where+ f <!< g = \(Flip (P_Q_T lens)) -> Flip . P_Q_T ! (g :*: (f <-|-) >-|-<-|-) lens++type family Convex lens where+ Convex Lens = Lens Identity++instance Semigroupoid (Lens Identity) where+ (.) :: Convex Lens between target -> Convex Lens source between -> Convex Lens source target+ P_Q_T to . P_Q_T from = P_Q_T ! \source ->+ let (Identity between :*: bs) = run # from source in+ let (Identity target :*: tb) = run # to between in+ Store ! Identity target :*: bs . Identity . tb++instance Category (Lens Identity) where+ identity :: Convex Lens source source+ identity = imply @(Convex Lens _ _) identity ((%) constant)++instance Semimonoidal (-->) (:*:) (:*:) (Lens Identity source) where+ mult = Straight ! \(P_Q_T x :*: P_Q_T y) -> P_Q_T ! \source ->+ let Store (Identity xt :*: ixts) :*: Store (Identity yt :*: _) = x source :*: y source in+ Store ! Identity (xt :*: yt) :*: \(Identity (xt_ :*: yt_)) ->+ let modified = ixts (Identity xt_) in+ extract # run (y modified) # Identity yt_++instance Impliable (P_Q_T (->) Store Identity source target) where+ type Arguments (P_Q_T (->) Store Identity source target) =+ (source -> target) -> (source -> target -> source) -> Lens Identity source target+ imply getter setter = P_Q_T ! \source -> Store ! Identity # getter source :*: setter source . extract++type family Obscure lens where+ Obscure Lens = Lens Maybe++instance Impliable (P_Q_T (->) Store Maybe source target) where+ type Arguments (P_Q_T (->) Store Maybe source target) =+ (source -> Maybe target) -> (source -> Maybe target -> source) -> Lens Maybe source target+ imply getter setter = P_Q_T ! \source -> Store ! getter source :*: setter source++instance Semigroupoid (Lens Maybe) where+ (.) :: Obscure Lens between target -> Obscure Lens source between -> Obscure Lens source target+ P_Q_T to . P_Q_T from = P_Q_T ! \source -> case run # from source of+ (Nothing :*: _) -> Store ! Nothing :*: \_ -> source+ (Just between :*: mbs) -> case run # to between of+ (Nothing :*: _) -> Store ! Nothing :*: \_ -> source+ (Just target :*: mtb) -> Store ! Just target :*: mbs . Just . mtb++instance Category (Lens Maybe) where+ identity :: Obscure Lens source source+ identity = imply @(Obscure Lens _ _) # Just # resolve identity++-- Lens as natural transformation+type (#=@) source target available = forall a . Lens available (source a) (target a)++-- | Representable based lens+represent :: forall t a . (Representable t, Setoid (Representation t)) => Representation t -> Convex Lens (t a) a+represent r = imply @(Convex Lens (t a) a) (r <#>) (\source target -> tabulate ! \r' -> r' == r ? target ! r' <#> source)++class Lensic previous next where+ type Lensally previous next :: * -> *+ (>>>) :: Lens previous source between -> Lens next between target -> Lens (Lensally previous next) source target++instance Semigroupoid (Lens t) => Lensic t t where+ type Lensally t t = t+ x >>> y = y . x++instance Lensic Maybe Identity where+ type Lensally Maybe Identity = Maybe+ P_Q_T from >>> P_Q_T to = P_Q_T ! \source -> case run # from source of+ (Nothing :*: _) -> Store ! Nothing :*: \_ -> source+ (Just between :*: mbs) -> case run # to between of+ (Identity target :*: itb) -> Store ! Just target :*: \mt -> mbs ! itb . Identity <-|- mt++instance Lensic Identity Maybe where+ type Lensally Identity Maybe = Maybe+ P_Q_T from >>> P_Q_T to = P_Q_T ! \source -> case run # from source of+ (Identity between :*: ibs) -> case run # to between of+ (Just target :*: mtb) -> Store ! Just target :*: ibs . Identity . mtb+ (Nothing :*: _) -> Store ! Nothing :*: \_ -> source++instance Gettable (Lens Identity) where+ type instance Getting (Lens Identity) source target = Lens Identity source target -> source -> target+ get lens = extract @Identity . position @_ @(Store _) . run lens++instance Gettable (Lens Maybe) where+ type instance Getting (Lens Maybe) source target = Lens Maybe source target -> source -> Maybe target+ get lens = position @_ @(Store _) . run lens++instance Pointable t => Settable (Lens t) where+ type instance Setting (Lens t) source target = target -> Lens t source target -> source -> source+ set new lens source = look @(t _) # point new # run lens source++instance (Gettable (Lens t), Covariant (->) (->) t, Pointable t) => Modifiable (Lens t) where+ type instance Modification (Lens t) source target = (target -> target) -> Lens t source target -> source -> source+ modify f lens = extract . retrofit (f <-|-) . run lens
+ Pandora/Paradigm/Inventory/Some/Provision.hs view
@@ -0,0 +1,65 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.Provision where++import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Category (identity, (#))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-)))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))+import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))+import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))+import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))+import Pandora.Pattern.Functor.Monad (Monad)+import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->), (%))+import Pandora.Paradigm.Primary.Algebraic ((<-|-<-|-))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic.One (One (One))+import Pandora.Paradigm.Primary.Algebraic (point)+import Pandora.Pattern.Morphism.Flip (Flip (Flip))+import Pandora.Pattern.Morphism.Straight (Straight (Straight))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite, (!)))+import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Inventory.Ability.Gettable (Gettable (Getting, get))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))++newtype Provision e a = Provision (e -> a)++instance Covariant (->) (->) (Provision e) where+ f <-|- Provision x = Provision ! f . x++instance Contravariant (->) (->) (Flip Provision a) where+ f >-|- Flip (Provision g) = Flip . Provision ! g . f++instance Semimonoidal (-->) (:*:) (:*:) (Provision e) where+ mult = Straight ! Provision . (mult @(-->) !) . (run :*: run <-|-<-|-)++instance Monoidal (-->) (-->) (:*:) (:*:) (Provision e) where+ unit _ = Straight ! \f -> Provision ! \_ -> run f One++instance Distributive (->) (->) (Provision e) where+ f -<< g = Provision ! (run @(->) <-|- f) -<< g++instance Bindable (->) (Provision e) where+ f =<< Provision x = Provision ! \e -> (run % e) . f . x ! e++instance Monad (->) (Provision e) where++instance Interpreted (->) (Provision e) where+ type Primary (Provision e) a = (->) e a+ run ~(Provision x) = x+ unite = Provision++type instance Schematic Monad (Provision e) = (<:.>) ((->) e)++instance Monadic (->) (Provision e) where+ wrap x = TM . TU ! point <-|- run x++type Provided e t = Adaptable t (->) (Provision e)++provided :: Provided e t => t e+provided = adapt # Provision identity++instance Gettable Provision where+ type Getting Provision p ouput = Provision p p+ get = Provision identity
+ Pandora/Paradigm/Inventory/Some/State.hs view
@@ -0,0 +1,82 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.State where++import Pandora.Pattern.Morphism.Flip (Flip)+import Pandora.Pattern.Morphism.Straight (Straight (Straight))+import Pandora.Core.Functor (type (:.), type (:=))+import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Category (identity, (#))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))+import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))+import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))+import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))+import Pandora.Pattern.Functor.Monad (Monad)+import Pandora.Pattern.Functor.Adjoint ((-|), (|-))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=), (!)), Schematic)+import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))+import Pandora.Paradigm.Inventory.Ability.Gettable (Gettable (Getting, get))+import Pandora.Paradigm.Inventory.Ability.Settable (Settable (Setting, set))+import Pandora.Paradigm.Inventory.Ability.Modifiable (Modifiable (Modification, modify))+import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>))+import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->))+import Pandora.Paradigm.Primary.Algebraic ((:*:) ((:*:)), (.-*-), delta)+import Pandora.Paradigm.Primary.Algebraic.One (One (One))+import Pandora.Paradigm.Primary.Algebraic (Pointable, point, (<-|-<-|-), (>-|-<-|-))++-- | Effectful computation with a variable+newtype State s a = State ((->) s :. (:*:) s := a)++instance Covariant (->) (->) (State s) where+ f <-|- x = State ! (<-|-) f . run x++instance Semimonoidal (-->) (:*:) (:*:) (State s) where+ mult = Straight ! \(State g :*: State h) -> State ! \s ->+ let old :*: x = g s in+ let new :*: y = h old in+ new :*: x :*: y++instance Monoidal (-->) (-->) (:*:) (:*:) (State s) where+ unit _ = Straight ! State . (identity @(->) -|) . (! One) . run++instance Bindable (->) (State s) where+ f =<< x = State ! (run . f |-) <-|- run x++instance Monad (->) (State s) where++instance Invariant (Flip State r) where+ f <!< g = (((g :*: (f :*: identity <-|-<-|-) >-|-<-|-) ||=) ||=)++instance Interpreted (->) (State s) where+ type Primary (State s) a = (->) s :. (:*:) s := a+ run ~(State x) = x+ unite = State++type instance Schematic Monad (State s) = (->) s <:<.>:> (:*:) s++instance Monadic (->) (State s) where+ wrap x = TM . TUT ! point <-|- run x++type Stateful s t = Adaptable t (->) (State s)++reconcile :: (Bindable (->) t, Stateful s t, Adaptable t (->) u) => (s -> u s) -> t s+reconcile f = adapt . set @State =<< adapt . f =<< adapt (get @State)++type Memorable s t = (Covariant (->) (->) t, Pointable t, Stateful s t)++fold :: (Traversable (->) (->) t, Memorable s u) => (a -> s -> s) -> t a -> u s+fold op struct = adapt (get @State) .-*- adapt . modify @State . op <<- struct++instance Gettable State where+ type Getting State state ouput = State state state+ get = State delta++instance Settable State where+ type Setting State state output = state -> State state state+ set new = State ! \_ -> new :*: new++instance Modifiable State where+ type Modification State state output = (state -> state) -> State state state+ modify f = State ! \s -> let r = f s in r :*: r
+ Pandora/Paradigm/Inventory/Some/Store.hs view
@@ -0,0 +1,71 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}+module Pandora.Paradigm.Inventory.Some.Store where++import Pandora.Core (type (:.), type (:=), type (<:=), type (~>))+import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Category (identity)+import Pandora.Pattern.Kernel (constant)+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)), (<-|-|-))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))+import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))+import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))+import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))+import Pandora.Pattern.Functor.Comonad (Comonad)+import Pandora.Pattern.Functor.Adjoint ((-|))+import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->), (%), (-.#..-))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached)+import Pandora.Paradigm.Primary.Algebraic (extract, (<-|-<-|-), (>-|-<-|-))+import Pandora.Pattern.Morphism.Flip (Flip (Flip))+import Pandora.Pattern.Morphism.Straight (Straight (Straight))+import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=), (!)), Schematic)+import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC))+import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>))++-- | Context based computation on value+newtype Store s a = Store ((:*:) s :. (->) s := a)++-- TODO: Try to generalize (->) here+instance Covariant (->) (->) (Store s) where+ (<-|-) f = (||=) (f <-|-|-)++instance Semimonoidal (<--) (:*:) (:*:) (Store s) where+ mult = Flip ! \(Store (s :*: f)) ->+ let (x :*: y) = f s in+ Store (s :*: constant x) :*: Store (s :*: constant y)++instance Monoidal (<--) (-->) (:*:) (:*:) (Store s) where+ unit _ = Flip ! \(Store (s :*: f)) -> Straight (\_ -> f s)++-- TODO: Try to generalize (->) here+instance Extendable (->) (Store s) where+ f <<= Store x = Store ! f <-|-|- (Store -.#..- (identity @(->) -|) <-|- x)++instance Comonad (->) (Store s) where++instance Invariant (Flip Store r) where+ f <!< g = \(Flip x) -> Flip ! (f :*: (g :*: identity >-|-<-|-) <-|-<-|-) ||= x++instance Interpreted (->) (Store s) where+ type Primary (Store s) a = (:*:) s :. (->) s := a+ run ~(Store x) = x+ unite = Store++type instance Schematic Comonad (Store s) = (:*:) s <:<.>:> (->) s++instance Comonadic (->) (Store s) where+ bring (TC (TUT (s :*: f))) = Store ! s :*: extract f++type Storable s t = Adaptable (Store s) (->) t++-- | Get current index+position :: Storable s t => t a -> s+position = attached . run @(->) @(Store _) . adapt++-- | Given an index return value+look :: Storable s t => s -> a <:= t+look s = (extract % s) . run @(->) @(Store _) . adapt++-- | Change index with function+retrofit :: (s -> s) -> Store s ~> Store s+retrofit g (Store (s :*: f)) = Store ! g s :*: f
− Pandora/Paradigm/Inventory/State.hs
@@ -1,82 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Inventory.State where--import Pandora.Pattern.Morphism.Flip (Flip)-import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Category (identity, (#))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))-import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))-import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))-import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Functor.Adjoint ((-|), (|-))-import Pandora.Pattern.Functor.Bivariant ((<->))-import Pandora.Pattern.Functor.Divariant ((>->))-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=), (!)), Schematic)-import Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic (Monadic (wrap), (:>) (TM))-import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->))-import Pandora.Paradigm.Primary.Algebraic ((:*:) ((:*:)), (.-*-), delta)-import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (Pointable, point)---- | Effectful computation with a variable-newtype State s a = State ((->) s :. (:*:) s := a)--instance Covariant (->) (->) (State s) where- f <-|- x = State ! (<-|-) f . run x--instance Semimonoidal (-->) (:*:) (:*:) (State s) where- mult = Straight ! \(State g :*: State h) -> State ! \s ->- let old :*: x = g s in- let new :*: y = h old in- new :*: x :*: y--instance Monoidal (-->) (-->) (:*:) (:*:) (State s) where- unit _ = Straight ! State . (identity @(->) -|) . (! One) . run--instance Bindable (->) (State s) where- f =<< x = State ! (run . f |-) <-|- run x--instance Monad (->) (State s) where--instance Invariant (Flip State r) where- f <!< g = ((g >-> ((<->) @_ @(->) @(->) f identity) ||=) ||=)--instance Interpreted (->) (State s) where- type Primary (State s) a = (->) s :. (:*:) s := a- run ~(State x) = x- unite = State--type instance Schematic Monad (State s) = (->) s <:<.>:> (:*:) s--instance Monadic (->) (State s) where- wrap x = TM . TUT ! point <-|- run x--type Stateful s t = Adaptable t (->) (State s)---- | Get current value-current :: Stateful s t => t s-current = adapt # State delta---- | Modify stored value with a function-modify :: Stateful s t => (s -> s) -> t s-modify f = adapt . State ! \s -> let r = f s in r :*: r---- | Replace current value with another one-replace :: Stateful s t => s -> t s-replace s = adapt . State ! \_ -> s :*: s--reconcile :: (Bindable (->) t, Stateful s t, Adaptable t (->) u) => (s -> u s) -> t s-reconcile f = replace =<< adapt . f =<< current--type Memorable s t = (Covariant (->) (->) t, Pointable t, Stateful s t)--fold :: (Traversable (->) (->) t, Memorable s u) => (a -> s -> s) -> t a -> u s-fold op struct = current .-*- modify . op <<- struct
− Pandora/Paradigm/Inventory/Store.hs
@@ -1,74 +0,0 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Inventory.Store where--import Pandora.Core (type (:.), type (:=), type (<:=), type (~>))-import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Category (identity)-import Pandora.Pattern.Kernel (constant)-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)), (<-|-|-))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult))-import Pandora.Pattern.Functor.Monoidal (Monoidal (unit))-import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))-import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Pattern.Functor.Bivariant ((<->))-import Pandora.Pattern.Functor.Divariant ((>->))-import Pandora.Pattern.Functor.Adjoint ((-|))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->), (%), (-.#..-))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached)-import Pandora.Paradigm.Primary.Algebraic (extract)-import Pandora.Pattern.Morphism.Flip (Flip (Flip))-import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable (adapt))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=), (!)), Schematic)-import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC))-import Pandora.Paradigm.Schemes.TUT (TUT (TUT), type (<:<.>:>))---- | Context based computation on value-newtype Store s a = Store ((:*:) s :. (->) s := a)---- TODO: Try to generalize (->) here-instance Covariant (->) (->) (Store s) where- (<-|-) f = (||=) (f <-|-|-)--instance Semimonoidal (<--) (:*:) (:*:) (Store s) where- mult = Flip ! \(Store (s :*: f)) ->- let (x :*: y) = f s in- Store (s :*: constant x) :*: Store (s :*: constant y)--instance Monoidal (<--) (-->) (:*:) (:*:) (Store s) where- unit _ = Flip ! \(Store (s :*: f)) -> Straight (\_ -> f s)---- TODO: Try to generalize (->) here-instance Extendable (->) (Store s) where- f <<= Store x = Store ! f <-|-|- (Store -.#..- (identity @(->) -|) <-|- x)--instance Comonad (->) (Store s) where--instance Invariant (Flip Store r) where- f <!< g = \(Flip x) -> Flip ! (<->) @_ @(->) f (g >-> identity @(->)) ||= x--instance Interpreted (->) (Store s) where- type Primary (Store s) a = (:*:) s :. (->) s := a- run ~(Store x) = x- unite = Store--type instance Schematic Comonad (Store s) = (:*:) s <:<.>:> (->) s--instance Comonadic (->) (Store s) where- bring (TC (TUT (s :*: f))) = Store ! s :*: extract f--type Storable s t = Adaptable (Store s) (->) t---- | Get current index-position :: Storable s t => t a -> s-position = attached . run @(->) @(Store _) . adapt---- | Given an index return value-look :: Storable s t => s -> a <:= t-look s = (extract % s) . run @(->) @(Store _) . adapt---- | Change index with function-retrofit :: (s -> s) -> Store s ~> Store s-retrofit g (Store (s :*: f)) = Store ! g s :*: f
Pandora/Paradigm/Primary.hs view
@@ -1,6 +1,5 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}--module Pandora.Paradigm.Primary (module Exports) where+module Pandora.Paradigm.Primary (module Exports, twosome) where import Pandora.Paradigm.Primary.Linear as Exports import Pandora.Paradigm.Primary.Transformer as Exports@@ -9,17 +8,19 @@ import Pandora.Paradigm.Primary.Algebraic as Exports import Pandora.Pattern.Morphism.Flip (Flip (Flip))+import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Core.Functor (type (:=)) import Pandora.Pattern.Semigroupoid (Semigroupoid ((.)))-import Pandora.Pattern.Category ((#)) import Pandora.Pattern.Kernel (Kernel (constant)) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((|-), (-|))) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Schemes (TU (TU), P_Q_T (P_Q_T), type (<:.>), type (<:.:>))+import Pandora.Paradigm.Controlflow.Effect.Conditional (Conditional ((?)))+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Schemes (TU (TU), T_U (T_U), P_Q_T (P_Q_T), type (<:.>), type (<:.:>)) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve)) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Into), premorph) import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Available, Substance, substructure))@@ -104,3 +105,9 @@ Left x -> Store ! Nothing :*: lift . constant (Left x) . (extract <-|-) Right y -> Store ! Just (Identity y) :*: lift . resolve Right End . (extract <-|-) Both x y -> Store ! Just (Identity y) :*: lift . resolve (Both x) (Left x) . (extract <-|-)++instance (Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) u) => Semimonoidal (-->) (:*:) (:*:) (t <:.:> u := (:*:)) where+ mult = Straight ! \(T_U (xls :*: xrs) :*: T_U (yls :*: yrs)) -> T_U ! (mult @(-->) !) (xls :*: yls) :*: (mult @(-->) !) (xrs :*: yrs)++twosome :: t a -> u a -> (<:.:>) t u (:*:) a+twosome x y = T_U ! x :*: y
Pandora/Paradigm/Primary/Algebraic.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Pandora.Paradigm.Primary.Algebraic (module Exports, Applicative, Alternative, Divisible, Decidable, Extractable, Pointable, (!>-), (!!>-), (!!!>-), (<-*-), (.-*-), (<-*-*-), (.-*-*-), forever_, (<-+-), (-+-), void, empty, point, pass, extract) where+module Pandora.Paradigm.Primary.Algebraic (module Exports, Applicative, Alternative, Divisible, Decidable, Extractable, Pointable, (!>-), (!!>-), (!!!>-), (<-*-), (.-*-), (<-*-*-), (.-*-*-), forever_, (<-+-), (.-+-), void, empty, point, pass, extract, (<-|-<-|-), (<-|->-|-), (>-|-<-|-), (>-|->-|-)) where import Pandora.Paradigm.Primary.Algebraic.Exponential as Exports import Pandora.Paradigm.Primary.Algebraic.Product as Exports@@ -8,25 +8,29 @@ import Pandora.Paradigm.Primary.Algebraic.Zero as Exports import Pandora.Paradigm.Primary.Algebraic.One as Exports +import Pandora.Core.Functor (type (:=)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Kernel (constant) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)), (<-|-|-), (<-|-|-|-))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-))) import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Functor.Monoidal (Monoidal (unit), Unit) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Paradigm.Primary.Functor.Proxy (Proxy (Proxy))-import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!))+import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted ((!), (=||))) type instance Unit (:*:) = One type instance Unit (:+:) = Zero infixl 4 <-*-, .-*- infixl 3 <-*-*-, .-*-*--infixl 3 <-+-, -+-+infixl 3 <-+-, .-+-+infixl 0 <-|-<-|-, <-|->-|-, >-|-<-|-, >-|->-|- (!>-) :: Covariant (->) (->) t => t a -> b -> t b x !>- r = constant r <-|- x@@ -40,6 +44,12 @@ void :: Covariant (->) (->) t => t a -> t () void x = x !>- () +instance (Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) u) => Semimonoidal (<--) (:*:) (:*:) (t <:.:> u := (:*:)) where+ mult = Flip ! \(T_U lrxys) ->+ -- TODO: I need matrix transposing here+ let ((lxs :*: lys) :*: (rxs :*: rys)) = ((mult @(<--) !) :*: (mult @(<--) !) <-|-<-|-) lrxys in+ T_U (lxs :*: rxs) :*: T_U (lys :*: rys)+ instance Traversable (->) (->) ((:*:) s) where f <<- x = (attached x :*:) <-|- f (extract x) @@ -105,10 +115,10 @@ f <-*-*- x = (<-*-) <-|- f <-*- x (.-*-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t) => t b -> t a -> t b-y .-*- x = (\x' y' -> y') <-|- x <-*- y+y .-*- x = (\_ y' -> y') <-|- x <-*- y (.-*-*-) :: (Covariant (->) (->) t, Covariant (->) (->) u, Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) u) => t (u b) -> t (u a) -> t (u b)-y .-*-*- x = (\x' y' -> y') <-|-|- x <-*-*- y+y .-*-*- x = (\_ y' -> y') <-|-|- x <-*-*- y forever_ :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t) => t a -> t b forever_ x = let r = r .-*- x in r@@ -116,8 +126,8 @@ (<-+-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:+:) t) => t b -> t a -> (a :+: b -> r) -> t r y <-+- x = \f -> f <-|- (mult @(-->) ! (x :*: y)) -(-+-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:+:) t) => t a -> t a -> t a-y -+- x = (\r -> case r of Option rx -> rx; Adoption ry -> ry) <-|- (mult @(-->) ! (x :*: y))+(.-+-) :: (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:+:) t) => t a -> t a -> t a+y .-+- x = (\r -> case r of Option rx -> rx; Adoption ry -> ry) <-|- (mult @(-->) ! (x :*: y)) type Extractable t = Monoidal (<--) (-->) (:*:) (:*:) t type Pointable t = Monoidal (-->) (-->) (:*:) (:*:) t@@ -137,3 +147,23 @@ --instance Appliable (->) b c (->) e d => Appliable (->) a (b -> c) (->) (a :*: e) d where -- f ! (x :*: y) = f x ! y++(<-|-<-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d .+ (Covariant m m (p a), Covariant m m (Flip p d), Interpreted m (Flip p d))+ => m a b :*: m c d -> m (p a c) (p b d)+(<-|-<-|-) (f :*: g) = (=||) @m @(Flip p d) ((<-|-) f) . ((<-|-) g)++(<-|->-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d .+ (Covariant m m (Flip p c), Contravariant m m (p a), Interpreted m (Flip p c))+ => m a b :*: m c d -> m (p a d) (p b c)+(<-|->-|-) (f :*: g) = (=||) @m @(Flip p c) ((<-|-) f) . ((>-|-) g)++(>-|-<-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d .+ (Contravariant m m (Flip p d), Covariant m m (p b), Interpreted m (Flip p d))+ => m a b :*: m c d -> m (p b c) (p a d)+(>-|-<-|-) (f :*: g) = (=||) @m @(Flip p d) ((>-|-) f) . ((<-|-) g)++(>-|->-|-) :: forall (m :: * -> * -> *) (p :: * -> * -> *) a b c d .+ (Contravariant m m (p b), Contravariant m m (Flip p c), Interpreted m (Flip p c))+ => m a b :*: m c d -> m (p b d) (p a c)+(>-|->-|-) (f :*: g) = (=||) @m @(Flip p c) ((>-|-) f) . ((>-|-) g)
Pandora/Paradigm/Primary/Algebraic/Exponential.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Primary.Algebraic.Exponential where import Pandora.Pattern.Betwixt (Betwixt)@@ -10,7 +9,6 @@ import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-))) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Divariant (Divariant ((>->))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Ringoid (Ringoid ((*))) import Pandora.Pattern.Morphism.Flip (Flip (Flip))@@ -39,9 +37,6 @@ instance Bindable (->) ((->) e) where f =<< g = \x -> f # g x # x--instance Divariant ((->)) (->) (->) (->) where- (>->) ab cd bc = cd . bc . ab instance Semigroup r => Semigroup (e -> r) where f + g = \e -> f e + g e
Pandora/Paradigm/Primary/Algebraic/Product.hs view
@@ -5,7 +5,6 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-))) import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Monoid (Monoid (zero))@@ -17,7 +16,6 @@ import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>)) import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!)) infixr 1 :*:@@ -33,9 +31,6 @@ instance Extendable (->) ((:*:) s) where f <<= ~(s :*: x) = s :*: f (s :*: x) -instance Bivariant (->) (->) (->) (:*:) where- f <-> g = \ ~(s :*: x) -> f s :*: g x- instance (Setoid s, Setoid a) => Setoid (s :*: a) where ~(sx :*: x) == ~(sy :*: y) = (sx == sy) * (x == y) @@ -62,16 +57,6 @@ instance (Group s, Group a) => Group (s :*: a) where invert ~(s :*: x) = invert # s :*: invert # x -instance (Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) u) => Semimonoidal (-->) (:*:) (:*:) (t <:.:> u := (:*:)) where- mult = Straight ! \(T_U (xls :*: xrs) :*: T_U (yls :*: yrs)) -> T_U ! (mult @(-->) !) (xls :*: yls) :*: (mult @(-->) !) (xrs :*: yrs)---- TODO: Generalize (:*:) as Bivariant p-instance (Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) u) => Semimonoidal (<--) (:*:) (:*:) (t <:.:> u := (:*:)) where- mult = Flip ! \(T_U lrxys) ->- -- TODO: I need matrix transposing here- let ((lxs :*: lys) :*: (rxs :*: rys)) = ((mult @(<--) !) <-> (mult @(<--) !)) lrxys in- T_U (lxs :*: rxs) :*: T_U (lys :*: rys)- delta :: a -> a :*: a delta x = x :*: x @@ -80,6 +65,3 @@ attached :: a :*: b -> a attached ~(x :*: _) = x--twosome :: t a -> u a -> (<:.:>) t u (:*:) a-twosome x y = T_U ! x :*: y
Pandora/Paradigm/Primary/Algebraic/Sum.hs view
@@ -2,7 +2,6 @@ import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Paradigm.Primary.Algebraic.Exponential () import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!))@@ -14,11 +13,6 @@ instance Covariant (->) (->) ((:+:) o) where _ <-|- Option s = Option s f <-|- Adoption x = Adoption ! f x--instance Bivariant (->) (->) (->) (:+:) where- f <-> g = \case- Option s -> Option ! f s- Adoption x -> Adoption ! g x instance Covariant (->) (->) (Flip (:+:) a) where _ <-|- Flip (Adoption x) = Flip ! Adoption x
Pandora/Paradigm/Primary/Functor.hs view
@@ -1,4 +1,4 @@-module Pandora.Paradigm.Primary.Functor (module Exports, Equivalence, Comparison, match) where+module Pandora.Paradigm.Primary.Functor (module Exports, Equivalence, Comparison) where import Pandora.Paradigm.Primary.Functor.Fix as Exports import Pandora.Paradigm.Primary.Functor.Convergence as Exports@@ -17,12 +17,12 @@ import Pandora.Paradigm.Primary.Functor.Identity as Exports import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))-import Pandora.Paradigm.Primary.Object.Boolean (Boolean, (?))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean) import Pandora.Paradigm.Primary.Object.Ordering (Ordering) import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!)) type Equivalence = Convergence Boolean type Comparison = Convergence Ordering -match :: Predicate a -> (a -> r) -> a -> r -> r :*: a-match (Predicate p) f x r = p x ? (f x :*: x) ! r :*: x+-- match :: Predicate a -> (a -> r) -> a -> r -> r :*: a+-- match (Predicate p) f x r = p x ? (f x :*: x) ! r :*: x
Pandora/Paradigm/Primary/Functor/Conclusion.hs view
@@ -10,7 +10,6 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<))) import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Chain (Chain ((<=>))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))@@ -62,9 +61,6 @@ _ =<< Failure y = Failure y --instance Monad (Conclusion e) where--instance Bivariant (->) (->) (->) Conclusion where- f <-> g = conclusion # Failure . f # Success . g instance (Setoid e, Setoid a) => Setoid (Conclusion e a) where Success x == Success y = x == y
Pandora/Paradigm/Primary/Functor/Constant.hs view
@@ -4,7 +4,6 @@ import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-))) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-))) import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Chain (Chain ((<=>))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))@@ -31,9 +30,6 @@ instance Invariant (Constant a) where _ <!< _ = \(Constant x) -> Constant x--instance Bivariant (->) (->) (->) Constant where- f <-> _ = \(Constant x) -> Constant ! f x instance Setoid a => Setoid (Constant a b) where Constant x == Constant y = x == y
Pandora/Paradigm/Primary/Functor/Endo.hs view
@@ -3,11 +3,12 @@ import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Category (identity, (#)) import Pandora.Pattern.Functor.Invariant (Invariant ((<!<)))-import Pandora.Pattern.Functor.Divariant ((>->)) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=))) import Pandora.Paradigm.Primary.Algebraic.Exponential ()+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic ((>-|-<-|-)) newtype Endo a = Endo { endo :: a -> a } @@ -17,7 +18,7 @@ unite = Endo instance Invariant Endo where- f <!< g = (g >-> f ||=)+ f <!< g = ((g :*: f >-|-<-|-) ||=) instance Semigroup (Endo a) where Endo f + Endo g = Endo # g . f
Pandora/Paradigm/Primary/Functor/Identity.hs view
@@ -9,7 +9,6 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<))) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Functor.Comonad (Comonad) --import Pandora.Pattern.Functor.Representable (Representable (Representation, (<#>), tabulate))@@ -26,7 +25,7 @@ import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (extract)+import Pandora.Paradigm.Primary.Algebraic (extract, (<-|-<-|-)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!)) newtype Identity a = Identity a@@ -35,7 +34,7 @@ f <-|- Identity x = Identity ! f x instance Semimonoidal (-->) (:*:) (:*:) Identity where- mult = Straight ! Identity . (extract <-> extract)+ mult = Straight ! Identity . (extract :*: extract <-|-<-|-) instance Monoidal (-->) (-->) (:*:) (:*:) Identity where unit _ = Straight ! Identity . (! One) . run
Pandora/Paradigm/Primary/Functor/Tagged.hs view
@@ -13,7 +13,6 @@ import Pandora.Pattern.Functor.Extendable (Extendable ((<<=))) import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Chain (Chain ((<=>))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))@@ -26,7 +25,7 @@ import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (extract)+import Pandora.Paradigm.Primary.Algebraic (extract, (<-|-<-|-)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!)) newtype Tagged tag a = Tag a@@ -41,7 +40,7 @@ _ <-|- Flip (Tag x) = Flip ! Tag x instance Semimonoidal (-->) (:*:) (:*:) (Tagged tag) where- mult = Straight ! Tag . (extract <-> extract)+ mult = Straight ! Tag . (extract :*: extract <-|-<-|-) instance Monoidal (-->) (-->) (:*:) (:*:) (Tagged tag) where unit _ = Straight ! Tag . (! One) . run@@ -67,9 +66,6 @@ f <<= x = Tag . f ! x instance Comonad (->) (Tagged tag)--instance Bivariant (->) (->) (->) Tagged where- _ <-> g = \(Tag x) -> Tag ! g x instance Setoid a => Setoid (Tagged tag a) where Tag x == Tag y = x == y
Pandora/Paradigm/Primary/Functor/Validation.hs view
@@ -6,7 +6,6 @@ import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->))) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Chain (Chain ((<=>))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))@@ -57,9 +56,6 @@ instance Traversable (->) (->) (Validation e) where f <<- Validated x = Validated <-|- f x _ <<- Flaws e = point ! Flaws e--instance Bivariant (->) (->) (->) Validation where- f <-> g = validation # Flaws . f # Validated . g instance (Setoid e, Setoid a) => Setoid (Validation e a) where Validated x == Validated y = x == y
Pandora/Paradigm/Primary/Linear/Vector.hs view
@@ -16,7 +16,6 @@ import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce)) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Into, Push), premorph, into, item)-import Pandora.Paradigm.Structure.Some.List (List) import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!)) data Vector r a where@@ -64,17 +63,6 @@ instance Monotonic a (Vector r a) => Monotonic a (Vector (a :*: r) a) where reduce f r (Vector x xs) = reduce f # f x r # xs---- TODO: move these instances to somewhere else since they involve structures-instance Morphable (Into List) (Vector r) where- type Morphing (Into List) (Vector r) = List- morphing (premorph -> Scalar x) = TT . Just ! Construct x Nothing- morphing (premorph -> Vector x xs) = item @Push x ! into @List xs--instance Morphable (Into (Construction Maybe)) (Vector r) where- type Morphing (Into (Construction Maybe)) (Vector r) = Construction Maybe- morphing (premorph -> Scalar x) = Construct x Nothing- morphing (premorph -> Vector x xs) = item @Push x ! into @(Nonempty List) xs class Vectorize a r where vectorize :: r -> Vector r a
Pandora/Paradigm/Primary/Object/Boolean.hs view
@@ -5,17 +5,11 @@ import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Pattern.Object.Quasiring (Quasiring (one)) -infixr 1 ?- data Boolean = True | False bool :: a -> a -> Boolean -> a bool x _ False = x bool _ y True = y--(?) :: Boolean -> a -> a -> a-(?) True x _ = x-(?) False _ y = y instance Semigroup Boolean where False + False = False
Pandora/Paradigm/Primary/Transformer/Backwards.hs view
@@ -8,7 +8,6 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\)))@@ -16,7 +15,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->), (%)) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (point, extract)+import Pandora.Paradigm.Primary.Algebraic (point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (!)))@@ -34,7 +33,7 @@ unit _ = Straight ! Backwards . point . (! One) . run instance (Semimonoidal (<--) (:*:) (:*:) t, Covariant (->) (->) t) => Semimonoidal (<--) (:*:) (:*:) (Backwards t) where- mult = Flip ! (Backwards <-> Backwards) . run (mult @(<--)) . run+ mult = Flip ! (Backwards :*: Backwards <-|-<-|-) . run (mult @(<--)) . run instance (Covariant (->) (->) t, Monoidal (<--) (-->) (:*:) (:*:) t) => Monoidal (<--) (-->) (:*:) (:*:) (Backwards t) where unit _ = Flip ! \(Backwards x) -> Straight (\_ -> extract x)
Pandora/Paradigm/Primary/Transformer/Construction.hs view
@@ -11,7 +11,6 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)), (<<-<<-)) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=))) import Pandora.Pattern.Functor.Comonad (Comonad)-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\))) import Pandora.Pattern.Object.Setoid (Setoid ((==)))@@ -23,7 +22,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:)) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (empty)+import Pandora.Paradigm.Primary.Algebraic (empty, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))@@ -41,7 +40,7 @@ mult = Straight ! \(Construct x xs :*: Construct y ys) -> Construct # (x :*: y) # (mult @(-->) !) <-|- (mult @(-->) ! (xs :*: ys)) instance (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t) => Semimonoidal (<--) (:*:) (:*:) (Construction t) where- mult = Flip ! \(Construct (x :*: y) xys) -> (Construct x <-> Construct y)+ mult = Flip ! \(Construct (x :*: y) xys) -> (Construct x :*: Construct y <-|-<-|-) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys instance (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t) => Monoidal (<--) (-->) (:*:) (:*:) (Construction t) where
Pandora/Paradigm/Primary/Transformer/Reverse.hs view
@@ -10,7 +10,6 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\)))@@ -18,7 +17,7 @@ import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (point, extract)+import Pandora.Paradigm.Primary.Algebraic (point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (!)))@@ -35,7 +34,7 @@ unit _ = Straight ! Reverse . point . (! One) . run instance (Semimonoidal (<--) (:*:) (:*:) t, Covariant (->) (->) t) => Semimonoidal (<--) (:*:) (:*:) (Reverse t) where- mult = Flip ! (Reverse <-> Reverse) . run (mult @(<--)) . run+ mult = Flip ! (Reverse :*: Reverse <-|-<-|-) . run (mult @(<--)) . run instance (Covariant (->) (->) t, Monoidal (<--) (-->) (:*:) (:*:) t) => Monoidal (<--) (-->) (:*:) (:*:) (Reverse t) where unit _ = Flip ! \(Reverse x) -> Straight (\_ -> extract x)
Pandora/Paradigm/Primary/Transformer/Tap.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE UndecidableInstances #-}- module Pandora.Paradigm.Primary.Transformer.Tap where import Pandora.Core.Functor (type (:=))@@ -10,20 +9,18 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\)))-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Controlflow.Effect.Interpreted ((!), (=||)) import Pandora.Paradigm.Primary.Algebraic ((<-*-), extract)-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), twosome)+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->), (%)) import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight))-import Pandora.Paradigm.Primary.Transformer.Reverse (Reverse (Reverse)) import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>)) import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T)) import Pandora.Paradigm.Structure.Ability.Substructure@@ -38,7 +35,7 @@ mult = Straight ! \(Tap x xs :*: Tap y ys) -> Tap # (x :*: y) # (mult @(-->) ! (xs :*: ys)) instance Semimonoidal (<--) (:*:) (:*:) t => Semimonoidal (<--) (:*:) (:*:) (Tap t) where- mult = Flip ! \(Tap (x :*: y) xys) -> (Tap x <-> Tap y) (mult @(<--) ! xys)+ mult = Flip ! \(Tap (x :*: y) xys) -> ((=||) @(->) @(Flip _ _) ((<-|-) (Tap x)) . ((<-|-) (Tap y))) (mult @(<--) ! xys) instance Semimonoidal (<--) (:*:) (:*:) t => Monoidal (<--) (-->) (:*:) (:*:) (Tap t) where unit _ = Flip ! \(Tap x _) -> Straight (\_ -> x)@@ -58,10 +55,6 @@ instance {-# OVERLAPS #-} Semimonoidal (-->) (:*:) (:*:) t => Semimonoidal (-->) (:*:) (:*:) (Tap (t <:.:> t := (:*:))) where mult = Straight ! \(Tap x (T_U (xls :*: xrs)) :*: Tap y (T_U (yls :*: yrs))) -> Tap (x :*: y) . T_U ! (mult @(-->) ! xls :*: yls) :*: (mult @(-->) ! xrs :*: yrs)--instance {-# OVERLAPS #-} Traversable (->) (->) t => Traversable (->) (->) (Tap (t <:.:> t := (:*:))) where- f <<- Tap x (T_U (future :*: past)) = (\past' x' future' -> Tap x' ! twosome # future' # run past')- <-|- f <<- Reverse past <-*- f x <-*- f <<- future instance (Covariant (->) (->) t) => Substructure Root (Tap (t <:.:> t := (:*:))) where type Available Root (Tap (t <:.:> t := (:*:))) = Identity
Pandora/Paradigm/Schemes/TT.hs view
@@ -12,7 +12,6 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)), (<<-<<-)) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\)))@@ -21,7 +20,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:), bitraverse_sum) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (empty, point, extract)+import Pandora.Paradigm.Primary.Algebraic (empty, point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) @@ -43,7 +42,7 @@ (<-|-) f = (||=) ((<-|-|-) f) instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) t') => Semimonoidal (-->) (:*:) (:*:) (t <::> t') where- mult = Straight ! TT . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run @(->) <-> run @(->))+ mult = Straight ! TT . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run :*: run <-|-<-|-) instance (Covariant (->) (->) t, Covariant (->) (->) t', Semimonoidal (-->) (:*:) (:*:) t', Monoidal (-->) (-->) (:*:) (:*:) t, Monoidal (-->) (-->) (:*:) (:*:) t') => Monoidal (-->) (-->) (:*:) (:*:) (t <::> t') where unit _ = Straight ! TT . point . point . (! One) . run@@ -55,7 +54,7 @@ unit _ = Straight ! \_ -> TT empty instance (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) t') => Semimonoidal (<--) (:*:) (:*:) (t <::> t') where- mult = Flip ! \(TT xys) -> (TT <-> TT) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys+ mult = Flip ! \(TT xys) -> (TT :*: TT <-|-<-|-) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys instance (Covariant (->) (->) t, Monoidal (<--) (-->) (:*:) (:*:) t, Monoidal (<--) (-->) (:*:) (:*:) t') => Monoidal (<--) (-->) (:*:) (:*:) (t <::> t') where unit _ = Flip ! \(TT x) -> Straight (\_ -> extract ! extract x)
Pandora/Paradigm/Schemes/TU.hs view
@@ -13,7 +13,6 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)), (<<-<<-)) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable ((/|\)))@@ -22,7 +21,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:) (Option, Adoption), sum) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (empty, point, extract)+import Pandora.Paradigm.Primary.Algebraic (empty, point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) @@ -44,7 +43,7 @@ (<-|-) f = (||=) ((<-|-|-) f) instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) u) => Semimonoidal (-->) (:*:) (:*:) (t <:.> u) where- mult = Straight ! TU . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run @(->) <-> run @(->))+ mult = Straight ! TU . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run :*: run <-|-<-|-) instance (Covariant (->) (->) t, Covariant (->) (->) u, Semimonoidal (-->) (:*:) (:*:) u, Monoidal (-->) (-->) (:*:) (:*:) t, Monoidal (-->) (-->) (:*:) (:*:) u) => Monoidal (-->) (-->) (:*:) (:*:) (t <:.> u) where unit _ = Straight ! TU . point . point . (! One) . run@@ -56,7 +55,7 @@ unit _ = Straight ! \_ -> TU empty instance (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) u) => Semimonoidal (<--) (:*:) (:*:) (t <:.> u) where- mult = Flip ! \(TU xys) -> (TU <-> TU) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys+ mult = Flip ! \(TU xys) -> (TU :*: TU <-|-<-|-) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys instance (Covariant (->) (->) t, Monoidal (<--) (-->) (:*:) (:*:) t, Monoidal (<--) (-->) (:*:) (:*:) u) => Monoidal (<--) (-->) (:*:) (:*:) (t <:.> u) where unit _ = Flip ! \(TU x) -> Straight (\_ -> extract ! extract x)
Pandora/Paradigm/Schemes/TUT.hs view
@@ -12,7 +12,6 @@ import Pandora.Pattern.Functor.Extendable (Extendable ((<<=))) import Pandora.Pattern.Functor.Distributive (Distributive ((-<<))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower))@@ -20,7 +19,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:) (Option, Adoption)) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (point, extract)+import Pandora.Paradigm.Primary.Algebraic (point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Pattern.Morphism.Straight (Straight (Straight)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (!), (||=)))@@ -50,7 +49,7 @@ mult = Straight ! \(TUT x :*: TUT y) -> TUT ((((\r -> (<-|-|-|-) (r :*:) y) |-) =<<) <-|- x) instance (Covariant (->) (->) t, Semimonoidal (<--) (:*:) (:*:) t, Covariant (->) (->) u, Semimonoidal (<--) (:*:) (:*:) u, Covariant (->) (->) t', Semimonoidal (<--) (:*:) (:*:) t') => Semimonoidal (<--) (:*:) (:*:) (t <:<.>:> t' := u) where- mult = Flip ! (TUT <-> TUT) . (mult @(<--) !) . (<-|-) (mult @(<--) !) . (<-|-|-) @_ @(->) (mult @(<--) !) . run+ mult = Flip ! (TUT :*: TUT <-|-<-|-) . (mult @(<--) !) . (<-|-) (mult @(<--) !) . (<-|-|-) @_ @(->) (mult @(<--) !) . run instance (Covariant (->) (->) t, Covariant (->) (->) u, Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) t', Monoidal (<--) (-->) (:*:) (:*:) u, Adjoint (->) (->) t t') => Monoidal (<--) (-->) (:*:) (:*:) (t <:<.>:> t' := u) where unit _ = Flip ! \(TUT xys) -> Straight (\_ -> (extract |-) xys)
Pandora/Paradigm/Schemes/T_U.hs view
@@ -1,11 +1,12 @@+{-# LANGUAGE UndecidableInstances #-} module Pandora.Paradigm.Schemes.T_U where import Pandora.Core.Functor (type (:=))-import Pandora.Pattern.Functor.Covariant (Covariant, Covariant ((<-|-)))-import Pandora.Pattern.Functor.Contravariant (Contravariant, Contravariant ((>-|-)))-import Pandora.Pattern.Functor.Bivariant (Bivariant ((<->)))-import Pandora.Pattern.Functor.Divariant (Divariant ((>->)))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=)))+import Pandora.Pattern.Semigroupoid ((.))+import Pandora.Pattern.Morphism.Flip (Flip)+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-), (<-|-|-)))+import Pandora.Pattern.Functor.Contravariant (Contravariant ((>-|-|-)))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=), (=||))) newtype T_U ct cu p t u a = T_U (p (t a) (u a)) @@ -21,11 +22,10 @@ run ~(T_U x) = x unite = T_U -instance (forall i . Covariant (->) (->) (p i), Bivariant (->) (->) (->) p, Covariant (->) (->) t, Covariant (->) (->) u) => Covariant (->) (->) (t <:.:> u := p) where- f <-|- x = (f <-|-) <-> (f <-|-) ||= x--instance (Divariant (->) (->) (->) p, Contravariant (->) (->) t, Covariant (->) (->) u) => Covariant (->) (->) (t >:.:> u := p) where- f <-|- x = (f >-|-) >-> (f <-|-) ||= x+-- TODO: generalize over (->)+instance (forall i . Covariant (->) (->) (p i), forall o . Covariant (->) (->) (Flip p o), Covariant (->) (->) t, Covariant (->) (->) u) => Covariant (->) (->) (t <:.:> u := p) where+ f <-|- x = ((=||) @_ @(Flip _ _) ((<-|-|-) f) . ((<-|-|-) f)) ||= x -instance (forall i . Covariant (->) (->) (p i), Bivariant (->) (->) (->) p, Contravariant (->) (->) t, Contravariant (->) (->) u) => Contravariant (->) (->) (t >:.:< u := p) where- f >-|- x = (f >-|-) <-> (f >-|-) ||= x+-- TODO: generalize over (->)+instance (Contravariant (->) (->) t, forall a . Covariant (->) (->) (p (t a)), Covariant (->) (->) u, forall b . Contravariant (->) (->) (Flip p (u b))) => Covariant (->) (->) (t >:.:> u := p) where+ (<-|-) f = (||=) ((=||) @_ @(Flip _ _) ((>-|-|-) f) . ((<-|-|-) f))
Pandora/Paradigm/Schemes/UT.hs view
@@ -13,7 +13,6 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<))) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (!), (||=)))@@ -21,7 +20,7 @@ import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:) (Option, Adoption), sum) import Pandora.Paradigm.Primary.Algebraic.One (One (One))-import Pandora.Paradigm.Primary.Algebraic (point, extract)+import Pandora.Paradigm.Primary.Algebraic (point, extract, (<-|-<-|-)) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) newtype UT ct cu t u a = UT (u :. t := a)@@ -42,7 +41,7 @@ (<-|-) f = (||=) ((<-|-|-) f) instance (Covariant (->) (->) u, Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) u) => Semimonoidal (-->) (:*:) (:*:) (t <.:> u) where- mult = Straight ! UT . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run @(->) <-> run @(->))+ mult = Straight ! UT . (<-|-) (mult @(-->) !) . (mult @(-->) !) . (run :*: run <-|-<-|-) instance (Covariant (->) (->) u, Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) u, Semimonoidal (-->) (:*:) (:+:) t) => Semimonoidal (-->) (:*:) (:+:) (t <.:> u) where mult = Straight ! \(UT x :*: UT y) -> UT ! (mult @(-->) @(:*:) @(:+:)) <-|- (mult @(-->) @(:*:) @(:*:) ! (x :*: y))@@ -54,7 +53,7 @@ f =<< UT x = UT ! ((identity =<<) <-|-) . (run . f <<-) =<< x instance (Covariant (->) (->) u, Semimonoidal (<--) (:*:) (:*:) t, Semimonoidal (<--) (:*:) (:*:) u) => Semimonoidal (<--) (:*:) (:*:) (t <.:> u) where- mult = Flip ! \(UT xys) -> (UT <-> UT) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys+ mult = Flip ! \(UT xys) -> (UT :*: UT <-|-<-|-) . (mult @(<--) !) ! (mult @(<--) !) <-|- xys instance (Covariant (->) (->) u, Monoidal (<--) (-->) (:*:) (:*:) t, Monoidal (<--) (-->) (:*:) (:*:) u) => Monoidal (<--) (-->) (:*:) (:*:) (t <.:> u) where unit _ = Flip ! \(UT x) -> Straight (\_ -> extract ! extract x)
Pandora/Paradigm/Structure.hs view
@@ -11,18 +11,16 @@ import Pandora.Core.Functor (type (:=)) import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Category ((#), identity)-import Pandora.Pattern.Kernel (constant) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Pattern.Object.Semigroup ((+)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (||=), (!))-import Pandora.Paradigm.Inventory.Optics ()-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached, twosome)+import Pandora.Paradigm.Inventory.Some.Optics ()+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:) (Option, Adoption))-import Pandora.Paradigm.Primary.Algebraic.Exponential (type (-->), (%))+import Pandora.Paradigm.Primary.Algebraic.Exponential ((%)) import Pandora.Paradigm.Primary.Algebraic (extract) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity))@@ -30,9 +28,12 @@ import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Both, Left, Right, End)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct))+import Pandora.Paradigm.Primary.Linear.Vector (Vector (Scalar, Vector))+import Pandora.Paradigm.Primary (twosome) import Pandora.Pattern.Morphism.Flip (Flip (Flip)) import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap)) import Pandora.Paradigm.Schemes.TU (type (<:.>))+import Pandora.Paradigm.Schemes.TT (TT (TT)) import Pandora.Paradigm.Schemes.T_U ( type (<:.:>)) import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T)) @@ -107,11 +108,16 @@ instance Possible a (Maybe a) where perhaps = P_Q_T ! \x -> Store ! x :*: identity -instance Possible a (o :+: a) where+instance {-# OVERLAPS #-} Possible a (o :+: a) where perhaps = P_Q_T ! \case Option s -> Store ! Nothing :*: resolve @a @(Maybe a) Adoption (Option s) Adoption x -> Store ! Just x :*: resolve @a @(Maybe a) Adoption (Adoption x) +instance {-# OVERLAPS #-} Possible o (o :+: a) where+ perhaps = P_Q_T ! \case+ Option s -> Store ! Just s :*: resolve @o @(Maybe o) Option (Option s)+ Adoption x -> Store ! Nothing :*: resolve @o @(Maybe o) Option (Adoption x)+ instance Accessible target source => Possible target (Maybe source) where perhaps = let lst = access @target @source in P_Q_T ! \case Just source -> let (Identity target :*: its) = run (lst ! source) in@@ -134,3 +140,13 @@ type Substance Right (t <:.:> t := (:*:)) = t substructure = P_Q_T ! \x -> case run # lower x of ls :*: rs -> Store ! Identity rs :*: lift . (twosome ls) . extract++instance Morphable (Into List) (Vector r) where+ type Morphing (Into List) (Vector r) = List+ morphing (premorph -> Scalar x) = TT . Just ! Construct x Nothing+ morphing (premorph -> Vector x xs) = item @Push x ! into @List xs++instance Morphable (Into (Construction Maybe)) (Vector r) where+ type Morphing (Into (Construction Maybe)) (Vector r) = Construction Maybe+ morphing (premorph -> Scalar x) = Construct x Nothing+ morphing (premorph -> Vector x xs) = item @Push x ! into @(Nonempty List) xs
Pandora/Paradigm/Structure/Ability/Accessible.hs view
@@ -1,7 +1,7 @@ module Pandora.Paradigm.Structure.Ability.Accessible where import Pandora.Paradigm.Primary.Functor.Identity (Identity)-import Pandora.Paradigm.Inventory.Optics (Lens)+import Pandora.Paradigm.Inventory.Some.Optics (Lens) class Accessible target source where access :: Lens Identity source target
Pandora/Paradigm/Structure/Ability/Possible.hs view
@@ -1,7 +1,7 @@ module Pandora.Paradigm.Structure.Ability.Possible where import Pandora.Paradigm.Primary.Functor.Maybe (Maybe)-import Pandora.Paradigm.Inventory.Optics (Lens)+import Pandora.Paradigm.Inventory.Some.Optics (Lens) class Possible target source where perhaps :: Lens Maybe source target
Pandora/Paradigm/Structure/Ability/Substructure.hs view
@@ -1,19 +1,18 @@ {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE UndecidableInstances #-}- module Pandora.Paradigm.Structure.Ability.Substructure where import Pandora.Core.Functor (type (:=)) import Pandora.Pattern.Semigroupoid (Semigroupoid ((.))) import Pandora.Pattern.Category (identity) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))-import Pandora.Pattern.Functor.Divariant ((>->)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Paradigm.Controlflow.Effect.Interpreted ((||=))-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (Lens, Convex, type (#=@))+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Inventory.Some.Optics (Lens, Convex, type (#=@)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic ((>-|-<-|-)) import Pandora.Paradigm.Primary.Functor.Identity (Identity) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged) import Pandora.Paradigm.Schemes.TU (type (<:.>))@@ -31,7 +30,7 @@ substructure :: (Tagged segment <:.> structure) #=@ Substance segment structure := Available segment structure sub :: (Covariant (->) (->) structure) => structure #=@ Substance segment structure := Available segment structure- sub = lift @(->) >-> (lower @(->) <-|-) ||= substructure @segment @structure+ sub = (lift :*: (lower @(->) <-|-) >-|-<-|-) ||= substructure @segment @structure -- TODO: generalize `available` and then rename to `singleton` -- The main problem is that we should handle (Maybe target -> sourse)
Pandora/Paradigm/Structure/Ability/Zipper.hs view
@@ -16,18 +16,22 @@ import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Paradigm.Primary.Algebraic (extract) import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->), (%))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), twosome)+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic ((<-*-)) import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right))+import Pandora.Paradigm.Primary.Transformer.Reverse (Reverse)+import Pandora.Paradigm.Primary (twosome) import Pandora.Paradigm.Schemes.TT (TT (TT), type (<::>)) import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>)) import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T)) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable, Morph (Rotate), Vertical (Up, Down)) import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Available, Substance, substructure), Segment (Root), sub) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!), (||=))-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (set, view)+import Pandora.Paradigm.Inventory.Ability.Gettable (get)+import Pandora.Paradigm.Inventory.Ability.Settable (set)+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Inventory.Some.Optics (Lens, Convex) class Zippable (structure :: * -> *) where type Breadcrumbs structure :: * -> *@@ -48,7 +52,7 @@ Fastenable structure (r ::: rs) = (Morphable (Rotate r) structure, Fastenable structure rs) Fastenable structure r = Morphable (Rotate r) structure -type Tape t = Identity <:.:> (t <:.:> t := (:*:)) := (:*:)+type Tape t = Identity <:.:> (Reverse t <:.:> t := (:*:)) := (:*:) -- TODO: It's too fragile to define such an instance without any hints about zippers? -- Should we wrap Zipper in Tagged Zippable?@@ -60,7 +64,7 @@ instance Covariant (->) (->) t => Substructure Left (Tape t) where type Available Left (Tape t) = Identity- type Substance Left (Tape t) = t+ type Substance Left (Tape t) = Reverse t substructure = P_Q_T ! \zipper -> case run # lower zipper of Identity x :*: T_U (ls :*: rs) -> Store ! Identity ls :*: lift . T_U . (Identity x :*:) . T_U . (:*: rs) . extract @@ -74,28 +78,28 @@ type Available Up (Tape t <::> Tape t) = Identity type Substance Up (Tape t <::> Tape t) = t <::> Tape t substructure = P_Q_T ! \x -> case run . run . extract . run # x of- Identity focused :*: T_U (d :*: u) -> + Identity focused :*: T_U (d :*: u) -> Store ! Identity (TT u) :*: lift . TT . twosome (Identity focused) . twosome d . run . extract instance Covariant (->) (->) t => Substructure Down (Tape t <::> Tape t) where type Available Down (Tape t <::> Tape t) = Identity- type Substance Down (Tape t <::> Tape t) = t <::> Tape t+ type Substance Down (Tape t <::> Tape t) = Reverse t <::> Tape t substructure = P_Q_T ! \ii -> case run . run . extract . run # ii of Identity focused :*: T_U (d :*: u) -> Store ! Identity (TT d) :*: lift . TT . twosome (Identity focused) . (twosome % u) . run . extract instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t) => Substructure Left (Tape t <::> Tape t) where type Available Left (Tape t <::> Tape t) = Identity- type Substance Left (Tape t <::> Tape t) = Tape t <::> t+ type Substance Left (Tape t <::> Tape t) = Tape t <::> Reverse t substructure = P_Q_T ! \ii ->- let target = (extract . view (sub @Left) <-|-) ||= (lower ii) in- let updated new = set (sub @Left) . Identity <-|- new <-*- run (lower ii) in+ let target = (get @(Convex Lens) (sub @Left) <-|-) ||= (lower ii) in+ let updated new = (set @(Convex Lens) % sub @Left) <-|- new <-*- run (lower ii) in Store ! Identity target :*: lift . (updated ||=) . extract instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t) => Substructure Right (Tape t <::> Tape t) where type Available Right (Tape t <::> Tape t) = Identity type Substance Right (Tape t <::> Tape t) = Tape t <::> t substructure = P_Q_T ! \ii ->- let target = (extract . view (sub @Right) <-|-) ||= lower ii in- let updated new = set (sub @Right) . Identity <-|- new <-*- run (lower ii) in+ let target = (get @(Convex Lens) (sub @Right) <-|-) ||= lower ii in+ let updated new = (set @(Convex Lens) % sub @Right) <-|- new <-*- run (lower ii) in Store ! Identity target :*: lift . (updated ||=) . extract
Pandora/Paradigm/Structure/Interface/Set.hs view
@@ -18,8 +18,9 @@ import Pandora.Paradigm.Primary.Object.Boolean (Boolean) import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Zero)) import Pandora.Paradigm.Schemes.T_U (type (<:.:>))+import Pandora.Paradigm.Inventory.Ability.Modifiable (modify) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing), Morph (Find), find)-import Pandora.Paradigm.Inventory.State (State, modify)+import Pandora.Paradigm.Inventory.Some.State (State) import Pandora.Paradigm.Controlflow.Effect (run, (!)) type Set t f a = (Traversable (->) (->) t, Setoid a, Setoid (t a), Morphable (Find f) t)@@ -28,4 +29,4 @@ subset = Convergence ! \s ss -> Nothing != (find @f @t @Maybe % s) . equate <<- ss cardinality :: Traversable (->) (->) t => t a -> Numerator-cardinality s = attached . run @(->) @(State _) % Zero ! constant (modify @Numerator (+ one)) <<- s+cardinality s = attached . run @(->) @(State _) % Zero ! constant (modify @State (+ one)) <<- s
Pandora/Paradigm/Structure/Modification.hs view
@@ -1,5 +1,6 @@ module Pandora.Paradigm.Structure.Modification (module Exports) where +import Pandora.Paradigm.Structure.Modification.Turnover as Exports import Pandora.Paradigm.Structure.Modification.Prefixed as Exports import Pandora.Paradigm.Structure.Modification.Comprehension as Exports import Pandora.Paradigm.Structure.Modification.Combinative as Exports
Pandora/Paradigm/Structure/Modification/Comprehension.hs view
@@ -12,7 +12,6 @@ import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Monoid (Monoid (zero))@@ -27,7 +26,7 @@ import Pandora.Paradigm.Primary.Algebraic.Exponential (type (<--), type (-->)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic.Sum ((:+:))-import Pandora.Paradigm.Primary.Algebraic (empty)+import Pandora.Paradigm.Primary.Algebraic (empty, (<-|-<-|-)) newtype Comprehension t a = Comprehension (t <::> Construction t := a) @@ -43,7 +42,7 @@ f <<- Comprehension x = Comprehension <-|- f <<- x instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) right t, Semimonoidal (-->) (:*:) right (t <::> Construction t)) => Semimonoidal (-->) (:*:) right (Comprehension t) where- mult = Straight ! Comprehension . (mult @(-->) @(:*:) @right !) . (run @(->) <-> run @(->))+ mult = Straight ! Comprehension . (mult @(-->) @(:*:) @right !) . (run :*: run <-|-<-|-) instance (Covariant (->) (->) t, Semimonoidal (-->) (:*:) (:*:) t, Semimonoidal (-->) (:*:) (:*:) (Construction t), Semimonoidal (-->) (:*:) (:+:) t, Semimonoidal (-->) (:*:) (:+:) (Construction t), Monoidal (-->) (-->) (:*:) (:+:) t) => Monoidal (-->) (-->) (:*:) (:+:) (Comprehension t) where unit _ = Straight ! \_ -> Comprehension empty
+ Pandora/Paradigm/Structure/Modification/Turnover.hs view
@@ -0,0 +1,24 @@+{-# LANGUAGE UndecidableInstances #-}+module Pandora.Paradigm.Structure.Modification.Turnover where++import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Transformer.Hoistable ((/|\))+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)))+import Pandora.Paradigm.Primary.Algebraic ((>-|-<-|-))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite, (||=)))+import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Available, Substance, substructure, sub), Segment (Root, Tail))++newtype Turnover t a = Turnover (t a)++instance (Covariant m m t, Interpreted m (Turnover t)) => Covariant m m (Turnover t) where+ (<-|-) f = (||=) ((<-|-) f)++instance Interpreted (->) (Turnover t) where+ type Primary (Turnover t) a = t a+ run ~(Turnover x) = x+ unite = Turnover++instance (Covariant (->) (->) structure, Substructure segment structure) => Substructure segment (Turnover structure) where+ type Available segment (Turnover structure) = Available segment structure+ type Substance segment (Turnover structure) = Substance segment structure+ substructure = ((run /|\) :*: ((unite /|\) <-|-) >-|-<-|-) ||= substructure @segment @structure
Pandora/Paradigm/Structure/Some/Binary.hs view
@@ -4,16 +4,15 @@ import Pandora.Core.Functor (type (~>), type (:=), type (:=>)) import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Category ((#))-import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-), (<-|-|-))) import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Bindable ((=<<)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Pattern.Object.Chain (Chain ((<=>)))-import Pandora.Paradigm.Primary ()-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), type (:*:), attached, twosome)+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), type (:*:), attached) import Pandora.Paradigm.Primary.Algebraic.Exponential ((%), (&))-import Pandora.Paradigm.Primary.Algebraic ((!!!>-), (<-*-), extract, point)+import Pandora.Paradigm.Primary.Algebraic ((!!!>-), (<-*-), (<-*-*-), extract, point) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Object.Ordering (order) import Pandora.Paradigm.Primary.Functor (Comparison)@@ -23,10 +22,15 @@ import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (End, Left, Right, Both)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct))+import Pandora.Paradigm.Primary (twosome) import Pandora.Paradigm.Schemes (TT (TT), T_U (T_U), P_Q_T (P_Q_T), type (<::>), type (<:.:>))+import Pandora.Paradigm.Controlflow.Effect.Conditional ((?)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!), (=||))-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (over, view)+import Pandora.Paradigm.Inventory.Ability.Gettable (get)+import Pandora.Paradigm.Inventory.Ability.Settable (set)+import Pandora.Paradigm.Inventory.Ability.Modifiable (modify)+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Inventory.Some.Optics (Lens, Convex, Obscure) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve))@@ -52,14 +56,12 @@ instance Morphable Insert Binary where type Morphing Insert Binary = (Identity <:.:> Comparison := (:*:)) <:.:> Binary := (->)- morphing binary = case run # premorph binary of+ morphing struct = case run # premorph struct of Nothing -> T_U ! \(T_U (Identity x :*: _)) -> lift # leaf x- Just non_empty_binary -> T_U ! \(T_U (Identity x :*: Convergence f)) -> lift @(->) !+ Just struct -> T_U ! \(T_U (Identity x :*: Convergence f)) -> lift @(->) ! let continue xs = run # morph @Insert @(Nonempty Binary) xs ! twosome # Identity x # Convergence f in- let change = Just . resolve continue (leaf x) in- f x # extract non_empty_binary & order # non_empty_binary- # over (sub @Left) change non_empty_binary- # over (sub @Right) change non_empty_binary+ let step = (?) <-|-|- get @(Obscure Lens) <-*-*- modify @(Obscure Lens) continue <-*-*- set @(Obscure Lens) (leaf x) in+ order struct ! step # sub @Left # struct ! step # sub @Right # struct ! f x # extract struct instance Nullable Binary where null = Predicate ! \case { TT Nothing -> True ; _ -> False }@@ -67,14 +69,14 @@ instance Substructure Left Binary where type Available Left Binary = Maybe type Substance Left Binary = Construction Wye- substructure = P_Q_T ! \bintree -> case run . lower # bintree of+ substructure = P_Q_T ! \struct -> case run . lower # struct of Nothing -> Store ! Nothing :*: lift . TT Just tree -> lift . lift @(->) <-|- run (sub @Left) tree instance Substructure Right Binary where type Available Right Binary = Maybe type Substance Right Binary = Construction Wye- substructure = P_Q_T ! \bintree -> case run . extract . run # bintree of+ substructure = P_Q_T ! \struct -> case run . extract . run # struct of Nothing -> Store ! Nothing :*: lift . TT Just tree -> lift . lift @(->) <-|- run (sub @Right) tree @@ -88,24 +90,21 @@ instance Morphable Insert (Construction Wye) where type Morphing Insert (Construction Wye) = (Identity <:.:> Comparison := (:*:)) <:.:> Construction Wye := (->)- morphing (premorph -> nonempty_list) = T_U ! \(T_U (Identity x :*: Convergence f)) ->+ morphing (premorph -> struct) = T_U ! \(T_U (Identity x :*: Convergence f)) -> let continue xs = run # morph @Insert @(Nonempty Binary) xs ! twosome # Identity x # Convergence f in- let change = Just . resolve continue (leaf x) in- order # nonempty_list- # over (sub @Left) change nonempty_list- # over (sub @Right) change nonempty_list- # f x (extract nonempty_list)+ let step = (?) <-|-|- get @(Obscure Lens) <-*-*- modify @(Obscure Lens) continue <-*-*- set @(Obscure Lens) (leaf x) in+ order struct ! step # sub @Left # struct ! step # sub @Right # struct ! f x # extract struct instance Substructure Root (Construction Wye) where type Available Root (Construction Wye) = Identity type Substance Root (Construction Wye) = Identity- substructure = P_Q_T ! \bintree -> case lower bintree of+ substructure = P_Q_T ! \struct -> case lower struct of Construct x xs -> Store ! Identity (Identity x) :*: lift . (Construct % xs) . extract . extract instance Substructure Left (Construction Wye) where type Available Left (Construction Wye) = Maybe type Substance Left (Construction Wye) = Construction Wye- substructure = P_Q_T ! \bintree -> case extract # run bintree of+ substructure = P_Q_T ! \struct -> case extract # run struct of Construct x End -> Store ! Nothing :*: lift . resolve (Construct x . Left) (leaf x) Construct x (Left lst) -> Store ! Just lst :*: lift . Construct x . resolve Left End Construct x (Right rst) -> Store ! Nothing :*: lift . Construct x . resolve (Both % rst) (Right rst)@@ -114,7 +113,7 @@ instance Substructure Right (Construction Wye) where type Available Right (Construction Wye) = Maybe type Substance Right (Construction Wye) = Construction Wye- substructure = P_Q_T ! \bintree -> case extract # run bintree of+ substructure = P_Q_T ! \struct -> case extract # run struct of Construct x End -> Store ! Nothing :*: lift . resolve (Construct x . Right) (leaf x) Construct x (Left lst) -> Store ! Nothing :*: lift . Construct x . resolve (Both lst) (Left lst) Construct x (Right rst) -> Store ! Just rst :*: lift . Construct x . resolve Right End@@ -124,23 +123,23 @@ instance Chain k => Morphable (Lookup Key) (Prefixed Binary k) where type Morphing (Lookup Key) (Prefixed Binary k) = (->) k <::> Maybe- morphing prefixed_tree = case run . run . premorph ! prefixed_tree of+ morphing struct = case run . run . premorph ! struct of Nothing -> TT ! \_ -> Nothing Just tree -> TT ! \key -> let root = extract tree in key <=> attached root & order (Just # extract root)- (lookup @Key key . Prefixed =<< view # sub @Left # tree)- (lookup @Key key . Prefixed =<< view # sub @Right # tree)+ (lookup @Key key . Prefixed =<< get @(Obscure Lens) # sub @Left # tree)+ (lookup @Key key . Prefixed =<< get @(Obscure Lens) # sub @Right # tree) -instance Chain k => Morphable (Vary Element) (Prefixed Binary k) where- type Morphing (Vary Element) (Prefixed Binary k) = ((:*:) k <::> Identity) <:.:> Prefixed Binary k := (->)- morphing prefixed_tree = case run . run . premorph ! prefixed_tree of- Nothing -> T_U ! \(TT (key :*: Identity value)) -> Prefixed . lift . leaf ! key :*: value- Just tree -> T_U ! \(TT (key :*: Identity value)) ->- let continue = ((vary @Element @k @_ @(Prefixed Binary _) key value =||) =||)- in let root = extract tree in Prefixed . lift ! key <=> attached root & order- # over (sub @Root) (!!!>- value) tree- # over (sub @Left) continue tree- # over (sub @Right) continue tree+-- instance Chain k => Morphable (Vary Element) (Prefixed Binary k) where+ -- type Morphing (Vary Element) (Prefixed Binary k) = ((:*:) k <::> Identity) <:.:> Prefixed Binary k := (->)+ -- morphing struct = case run . run . premorph ! struct of+ -- Nothing -> T_U ! \(TT (key :*: Identity value)) -> Prefixed . lift . leaf ! key :*: value+ -- Just tree -> T_U ! \(TT (key :*: Identity value)) ->+ -- let continue = ((vary @Element @k @_ @(Prefixed Binary _) key value =||) =||) in+ -- Prefixed . lift ! key <=> attached (extract tree) & order+ -- # over (sub @Root) (!!!>- value) tree+ -- # over (sub @Left) continue tree+ -- # over (sub @Right) continue tree ---------------------------------- Prefixed non-empty binary tree ---------------------------------- @@ -148,8 +147,8 @@ type Morphing (Lookup Key) (Prefixed (Construction Wye) key) = (->) key <::> Maybe morphing (run . premorph -> Construct x xs) = TT ! \key -> key <=> attached x & order (Just # extract x)- (lookup @Key key . Prefixed . extract =<< view # sub @Left # xs)- (lookup @Key key . Prefixed . extract =<< view # sub @Left # xs)+ (lookup @Key key . Prefixed . extract =<< get @(Obscure Lens) # sub @Left # xs)+ (lookup @Key key . Prefixed . extract =<< get @(Obscure Lens) # sub @Left # xs) -------------------------------------- Zipper of binary tree --------------------------------------- @@ -178,14 +177,14 @@ instance Morphable (Rotate Up) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) where type Morphing (Rotate Up) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) = Maybe <::> ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> Bifurcation <::> Bicursor := (:*:))- morphing zipper = case run # premorph zipper of+ morphing struct = case run # premorph struct of focused :*: TT (TT (Rightward (Construct (T_U (Identity parent :*: rest)) next))) ->- lift @(->) . (twosome % TT (TT next)) . twosome (Identity parent) . TT ! resolve+ lift . (twosome % TT (TT next)) . twosome (Identity parent) . TT ! resolve # Both (_focused_part_to_nonempty_binary_tree focused) # Left (_focused_part_to_nonempty_binary_tree focused) # run rest focused :*: TT (TT (Leftward (Construct (T_U (Identity parent :*: rest)) next))) ->- lift @(->) . (twosome % TT (TT next)) . twosome (Identity parent) . TT ! resolve+ lift . (twosome % TT (TT next)) . twosome (Identity parent) . TT ! resolve # Both % _focused_part_to_nonempty_binary_tree focused # Right (_focused_part_to_nonempty_binary_tree focused) # run rest@@ -197,7 +196,7 @@ instance Morphable (Rotate (Down Left)) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) where type Morphing (Rotate (Down Left)) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) = Maybe <::> ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> Bifurcation <::> Bicursor := (:*:))- morphing zipper = case run # premorph zipper of+ morphing struct = case run # premorph struct of T_U (Identity x :*: TT (Left lst)) :*: TT (TT next) -> lift . twosome (_nonempty_binary_tree_to_focused_part lst) . TT . TT . Leftward ! Construct # twosome (Identity x) (TT Nothing) # next@@ -209,7 +208,7 @@ instance Morphable (Rotate (Down Right)) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) where type Morphing (Rotate (Down Right)) ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> (Bifurcation <::> Bicursor) := (:*:)) = Maybe <::> ((Identity <:.:> Wye <::> Construction Wye := (:*:)) <:.:> Bifurcation <::> Bicursor := (:*:))- morphing zipper = case run # premorph zipper of+ morphing struct = case run # premorph struct of T_U (Identity x :*: TT (Right rst)) :*: TT (TT next) -> lift . twosome (_nonempty_binary_tree_to_focused_part rst) . TT . TT . Rightward ! Construct # twosome (Identity x) (TT Nothing) # next
Pandora/Paradigm/Structure/Some/List.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Structure.Some.List where import Pandora.Core.Functor (type (:.), type (:=))@@ -10,33 +9,37 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((<<-))) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<)))-import Pandora.Pattern.Functor.Bivariant ((<->)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((|-))) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) 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.Algebraic ((<-*-), (-.#..-), extract, point, empty)-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached, twosome)+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))+import Pandora.Paradigm.Primary.Algebraic ((<-*-), (.-+-), (-.#..-), extract, point, empty, void)+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached) import Pandora.Paradigm.Primary.Algebraic.Exponential ((%))+import Pandora.Paradigm.Primary.Algebraic ((<-|-<-|-)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Identity (Identity (Identity)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct, (.-+)) import Pandora.Paradigm.Primary.Transformer.Reverse (Reverse (Reverse))-import Pandora.Paradigm.Inventory.State (State, fold, modify)-import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics (Convex, Lens, view)+import Pandora.Paradigm.Primary (twosome)+import Pandora.Paradigm.Inventory.Ability.Gettable (get)+import Pandora.Paradigm.Inventory.Ability.Modifiable (Modifiable (Modification, modify))+import Pandora.Paradigm.Inventory.Some.State (State, fold)+import Pandora.Paradigm.Inventory.Some.Store (Store (Store))+import Pandora.Paradigm.Inventory.Some.Optics (Convex, Obscure, Lens)+import Pandora.Paradigm.Controlflow.Effect.Conditional (Conditional ((?))) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!), (||=)) import Pandora.Paradigm.Schemes.TT (TT (TT), type (<::>)) import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>)) import Pandora.Paradigm.Schemes.P_Q_T (P_Q_T (P_Q_T)) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null))-import Pandora.Paradigm.Structure.Ability.Zipper (Zippable (Breadcrumbs), Zipper)+import Pandora.Paradigm.Structure.Ability.Zipper (Zippable (Breadcrumbs), Zipper, Tape) import Pandora.Paradigm.Structure.Ability.Monotonic (resolve) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing) , Morph (Rotate, Into, Push, Pop, Delete, Find, Lookup, Element, Key)@@ -46,6 +49,7 @@ import Pandora.Paradigm.Structure.Modification.Combinative (Combinative) import Pandora.Paradigm.Structure.Modification.Comprehension (Comprehension (Comprehension)) import Pandora.Paradigm.Structure.Modification.Prefixed (Prefixed (Prefixed))+import Pandora.Paradigm.Structure.Modification.Turnover (Turnover (Turnover)) -- | Linear data structure that serves as a collection of elements type List = Maybe <::> Construction Maybe@@ -59,7 +63,7 @@ ! TT @Covariant @Covariant xs + TT @Covariant @Covariant ys instance Monoid (List a) where- zero = TT Nothing+ zero = empty instance Morphable Push List where type Morphing Push List = Identity <:.:> List := (->)@@ -79,14 +83,14 @@ instance Morphable (Delete First) List where type Morphing (Delete First) List = Predicate <:.:> List := (->) morphing list = case run # premorph list of- Nothing -> T_U ! \_ -> TT Nothing+ Nothing -> T_U ! \_ -> empty Just (Construct x xs) -> T_U ! \p -> run p x ? TT xs ! lift . Construct x . run . filter @First @List p # TT xs instance Morphable (Delete All) List where type Morphing (Delete All) List = Predicate <:.:> List := (->) morphing list = case run # premorph list of- Nothing -> T_U ! \_ -> TT Nothing+ Nothing -> T_U ! \_ -> empty Just (Construct x xs) -> T_U ! \p -> run p x ? filter @All @List p (TT xs) ! lift . Construct x . run . filter @All @List p # TT xs@@ -136,7 +140,8 @@ morphing nonempty_list_with_maybe_elements = case run . premorph # nonempty_list_with_maybe_elements of Construct (Just x) (Just xs) -> item @Push x # into @List (TT @Covariant @Covariant xs) Construct (Just x) Nothing -> point x- Construct Nothing Nothing -> TT Nothing -- empty+ Construct Nothing (Just xs) -> into @List (TT @Covariant @Covariant xs)+ Construct Nothing Nothing -> empty instance Morphable Push (Construction Maybe) where type Morphing Push (Construction Maybe) = Identity <:.:> Construction Maybe := (->)@@ -161,85 +166,118 @@ ----------------------------------------- Zipper of list ------------------------------------------- instance Zippable List where- type Breadcrumbs List = (List <:.:> List := (:*:))+ type Breadcrumbs List = (Reverse List <:.:> List := (:*:)) -instance {-# OVERLAPS #-} Traversable (->) (->) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- f <<- T_U (Identity x :*: T_U (future :*: past)) = (\past' x' future' -> twosome (Identity x') ! twosome # future' # run past')- <-|- f <<- Reverse past <-*- f x <-*- f <<- future+instance {-# OVERLAPS #-} Traversable (->) (->) (Tape List) where+ f <<- T_U (Identity x :*: T_U (left :*: right)) = (\past' x' left' -> twosome (Identity x') ! twosome # left' # run past')+ <-|- f <<- Reverse right <-*- f x <-*- f <<- left -instance {-# OVERLAPS #-} Extendable (->) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where+instance {-# OVERLAPS #-} Extendable (->) (Tape List) where f <<= z = let move rtt = TT . deconstruct ! run . rtt .-+ z in- twosome (Identity # f z) ! twosome # f <-|- move (rotate @Left) # f <-|- move (rotate @Right)+ twosome (Identity # f z) ! twosome # Reverse (f <-|- move (rotate @Left)) # f <-|- move (rotate @Right) -instance Morphable (Rotate Left) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- type Morphing (Rotate Left) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) = Maybe <::> (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) =- let subtree = twosome # extract (view (sub @Tail) future) # item @Push x past in- TT ! (twosome . Identity . extract) % subtree <-|- view (sub @Root) future+instance Morphable (Rotate Left) (Tape List) where+ type Morphing (Rotate Left) (Tape List) = Maybe <::> Tape List+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) =+ let subtree = twosome # Reverse (get @(Convex Lens) # sub @Tail # left) # item @Push x right in+ TT ! (twosome . Identity . extract) % subtree <-|- get @(Obscure Lens) (sub @Root) left -instance Morphable (Rotate Right) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- type Morphing (Rotate Right) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) = Maybe <::> (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) =- let subtree = twosome # item @Push x future # extract (view (sub @Tail) past) in- TT ! (twosome . Identity . extract) % subtree <-|- view (sub @Root) past+instance Morphable (Rotate Right) (Tape List) where+ type Morphing (Rotate Right) (Tape List) = Maybe <::> Tape List+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) =+ let subtree = twosome # Reverse (item @Push x left) # get @(Convex Lens) (sub @Tail) right in+ TT ! twosome % subtree <-|- get @(Obscure Lens) (sub @Root) right -instance Morphable (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) List where- type Morphing (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) List = Maybe <::> (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))+instance Morphable (Rotate Left) (Turnover (Tape List)) where+ type Morphing (Rotate Left) (Turnover (Tape List)) = Turnover (Tape List)+ morphing s@(premorph -> Turnover (T_U (Identity x :*: T_U (Reverse left :*: right)))) =+ resolve @(Tape List _) Turnover # premorph s ! (rotate_over x <-|- run right) .-+- (rotate_left x right <-|- run left) where++ rotate_left :: a -> List a -> Nonempty List a -> Tape List a+ rotate_left focused rs (Construct lx lxs) = twosome # point lx+ ! twosome # Reverse (TT lxs) # item @Push focused rs++ rotate_over :: a -> Nonempty List a -> Tape List a+ rotate_over focused rs = let new_left = attached (put_over <<- rs ! point focused) in+ twosome # point (extract new_left) ! twosome (Reverse . TT # deconstruct new_left) empty++ put_over :: a -> State (Nonempty List a) ()+ put_over = void . modify @State . item @Push++instance Morphable (Rotate Right) (Turnover (Tape List)) where+ type Morphing (Rotate Right) (Turnover (Tape List)) = Turnover (Tape List)+ morphing s@(premorph -> Turnover (T_U (Identity x :*: T_U (Reverse left :*: right)))) =+ resolve @(Tape List _) Turnover # premorph s ! (rotate_over x <-|- run left) .-+- (rotate_right x left <-|- run right) where++ rotate_right :: a -> List a -> Nonempty List a -> Tape List a+ rotate_right focused ls (Construct rx rxs) = twosome # point rx+ ! twosome # Reverse (item @Push focused ls) # TT rxs++ rotate_over :: a -> Nonempty List a -> Tape List a+ rotate_over focused ls = let new_right = attached (put_over <<- ls ! point focused) in+ twosome # point (extract new_right) ! twosome (Reverse empty) (TT # deconstruct new_right)++ put_over :: a -> State (Nonempty List a) ()+ put_over = void . modify @State . item @Push++instance Morphable (Into (Tape List)) List where+ type Morphing (Into (Tape List)) List = Maybe <::> Tape List morphing (premorph -> list) = (into @(Zipper List) <-|-) ||= list -instance Morphable (Into List) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- type Morphing (Into List) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) = List- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = attached ! run @(->) @(State _)- # modify . item @Push @List <<- past- # item @Push x future+instance Morphable (Into List) (Tape List) where+ type Morphing (Into List) (Tape List) = List+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) = attached ! run @(->) @(State _)+ # modify @State . item @Push @List <<- right+ # item @Push x left -instance Morphable (Into (Comprehension Maybe)) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- type Morphing (Into (Comprehension Maybe)) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) = Comprehension Maybe- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = attached ! run @(->) @(State _)- # modify . item @Push @(Comprehension Maybe) <<- past- # item @Push x (Comprehension future)+instance Morphable (Into (Comprehension Maybe)) (Tape List) where+ type Morphing (Into (Comprehension Maybe)) (Tape List) = Comprehension Maybe+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) = attached ! run @(->) @(State _)+ # modify @State . item @Push @(Comprehension Maybe) <<- right+ # item @Push x (Comprehension left) ------------------------------------- Zipper of non-empty list ------------------------------------- instance Zippable (Construction Maybe) where- type Breadcrumbs (Construction Maybe) = (Construction Maybe <:.:> Construction Maybe := (:*:))+ type Breadcrumbs (Construction Maybe) = Reverse (Construction Maybe) <:.:> Construction Maybe := (:*:) -instance Morphable (Rotate Left) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) where- type Morphing (Rotate Left) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) =- Maybe <::> (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:))- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = TT ! T_U . (Identity (extract future) :*:) . twosome % item @Push x past <-|- deconstruct future+instance Morphable (Rotate Left) (Tape (Construction Maybe)) where+ type Morphing (Rotate Left) (Tape (Construction Maybe)) =+ Maybe <::> (Tape (Construction Maybe))+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) =+ TT ! T_U . (Identity (extract left) :*:) . (twosome % item @Push x right) . Reverse <-|- deconstruct left -instance Morphable (Rotate Right) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) where- type Morphing (Rotate Right) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) =- Maybe <::> (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:))- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = TT ! T_U . (Identity (extract past) :*:) . twosome (item @Push x future) <-|- deconstruct past+instance Morphable (Rotate Right) (Tape (Construction Maybe)) where+ type Morphing (Rotate Right) (Tape (Construction Maybe)) =+ Maybe <::> Tape (Construction Maybe)+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) =+ TT ! T_U . (Identity (extract right) :*:) . twosome (Reverse # item @Push x left) <-|- deconstruct right -instance Morphable (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) (Construction Maybe) where- type Morphing (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) (Construction Maybe) = Identity <:.:> (List <:.:> List := (:*:)) := (:*:)- morphing (premorph -> ne) = twosome # Identity (extract ne) ! twosome # extract (view # sub @Tail # ne) # zero+instance Morphable (Into (Tape List)) (Construction Maybe) where+ type Morphing (Into (Tape List)) (Construction Maybe) = Tape List+ morphing (premorph -> ne) = twosome # Identity (extract ne) ! twosome # Reverse zero # (get @(Convex Lens) # sub @Tail # ne) -instance Morphable (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) where- type Morphing (Into (Identity <:.:> (List <:.:> List := (:*:)) := (:*:))) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) =- Identity <:.:> (List <:.:> List := (:*:)) := (:*:)- morphing (premorph -> zipper) = ((lift @(->) <-> lift @(->) ||=) <-|-) ||= zipper+instance Morphable (Into (Tape List)) (Tape (Construction Maybe)) where+ type Morphing (Into (Tape List)) (Tape (Construction Maybe)) = Tape List+ morphing (premorph -> zipper) = ((((lift ||=) :*: lift <-|-<-|-) ||=) <-|-) ||= zipper -instance Morphable (Into (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:))) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) where- type Morphing (Into (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:))) (Identity <:.:> (List <:.:> List := (:*:)) := (:*:)) =- Maybe <::> (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:))- morphing (premorph -> zipper) = let spread x y = (:*:) <-|- x <-*- y in- TT ! T_U . (Identity (extract zipper) :*:) . T_U <-|- ((spread |-) . (run @(->) <-> run @(->)) . run . extract ! run zipper)+instance Morphable (Into (Tape (Construction Maybe))) (Tape List) where+ type Morphing (Into (Tape (Construction Maybe))) (Tape List) =+ Maybe <::> Tape (Construction Maybe)+ morphing (premorph -> zipper) = let spread x y = (\x' y' -> Reverse x' :*: y') <-|- x <-*- y in+ TT ! T_U . (Identity (extract zipper) :*:) . T_U <-|- ((spread |-) . (run . run :*: run <-|-<-|-) . run . extract ! run zipper) -instance Morphable (Into (Construction Maybe)) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) where- type Morphing (Into (Construction Maybe)) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) = Construction Maybe- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = attached ! run @(->) @(State _)- # modify . item @Push @(Nonempty List) <<- past- # item @Push x future+instance Morphable (Into (Construction Maybe)) (Tape (Construction Maybe)) where+ type Morphing (Into (Construction Maybe)) (Tape (Construction Maybe)) = Construction Maybe+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) = attached ! run @(->) @(State _)+ # modify @State . item @Push @(Nonempty List) <<- right+ # item @Push x left -instance Morphable (Into List) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) where- type Morphing (Into List) (Identity <:.:> (Construction Maybe <:.:> Construction Maybe := (:*:)) := (:*:)) = List- morphing (premorph -> T_U (Identity x :*: T_U (future :*: past))) = attached ! run @(->) @(State _)- # modify . item @Push @List <<- past- # item @Push x (lift future)+instance Morphable (Into List) (Tape (Construction Maybe)) where+ type Morphing (Into List) (Tape (Construction Maybe)) = List+ morphing (premorph -> T_U (Identity x :*: T_U (Reverse left :*: right))) = attached ! run @(->) @(State _)+ # modify @State . item @Push @List <<- right+ # item @Push x (lift left) ------------------------------------ Zipper of combinative list ------------------------------------
Pandora/Paradigm/Structure/Some/Rose.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Structure.Some.Rose where import Pandora.Core.Functor (type (:.), type (:=))@@ -10,7 +9,7 @@ import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Transformer.Lowerable (lower) import Pandora.Pattern.Object.Setoid (Setoid ((==), (!=)))-import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False), (?))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), attached) import Pandora.Paradigm.Primary.Algebraic.Exponential ((%)) import Pandora.Paradigm.Primary.Algebraic (extract)@@ -19,8 +18,9 @@ import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate), equate) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct) import Pandora.Paradigm.Schemes (TU (TU), P_Q_T (P_Q_T), type (<:.>))+import Pandora.Paradigm.Controlflow.Effect.Conditional (Conditional ((?))) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))-import Pandora.Paradigm.Inventory.Store (Store (Store))+import Pandora.Paradigm.Inventory.Some.Store (Store (Store)) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing) , Morph (Lookup, Element, Key), premorph, find) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty)
Pandora/Paradigm/Structure/Some/Splay.hs view
@@ -4,22 +4,24 @@ import Pandora.Core.Functor (type (~>), type (:.), type (:=)) import Pandora.Pattern.Semigroupoid ((.))-import Pandora.Pattern.Category ((#))+import Pandora.Pattern.Category ((#), identity) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-))) import Pandora.Pattern.Functor.Bindable (Bindable ((=<<))) import Pandora.Paradigm.Primary () import Pandora.Paradigm.Primary.Algebraic ((<-*-), extract)-import Pandora.Paradigm.Primary.Algebraic.Product (twosome) 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.Primary (twosome) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))-import Pandora.Paradigm.Inventory.Optics (over)+import Pandora.Paradigm.Inventory.Ability.Modifiable (modify)+import Pandora.Paradigm.Inventory.Some.Optics (Lens, Obscure) import Pandora.Paradigm.Schemes (TT (TT), type (<::>))-import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate, Into), premorph, rotate, into)+import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morphed, Morph (Rotate, Into), premorph, rotate, into) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Substructure (sub)+import Pandora.Paradigm.Structure.Ability.Monotonic (resolve) import Pandora.Paradigm.Structure.Some.Binary (Binary) data Splay a = Zig a | Zag a@@ -77,23 +79,26 @@ -- TODO: Morphing ... = Conclussion Error <::> Nonempty Binary instance Morphable (Rotate (Left (Zig Zig))) (Construction Wye) where- type Morphing (Rotate (Left (Zig Zig))) (Construction Wye) = Binary+ type Morphing (Rotate (Left (Zig Zig))) (Construction Wye) = Maybe <::> Construction Wye morphing (premorph -> tree) = TT ! run . rotate @(Left Zig) =<< run # rotate @(Left Zig) tree -- TODO: Morphing ... = Conclussion Error <::> Nonempty Binary instance Morphable (Rotate (Right (Zig Zig))) (Construction Wye) where- type Morphing (Rotate (Right (Zig Zig))) (Construction Wye) = Binary+ type Morphing (Rotate (Right (Zig Zig))) (Construction Wye) = Maybe <::> Construction Wye morphing (premorph -> tree) = TT ! run . rotate @(Right Zig) =<< run # rotate @(Right Zig) tree -- TODO: Morphing ... = Conclussion Error <::> Nonempty Binary instance Morphable (Rotate (Left (Zig Zag))) (Construction Wye) where- type Morphing (Rotate (Left (Zig Zag))) (Construction Wye) = Binary- morphing = rotate @(Left Zig) . over (sub @Left) (run . rotate @(Right Zig) =<<) . premorph+ type Morphing (Rotate (Left (Zig Zag))) (Construction Wye) = Maybe <::> Construction Wye+ morphing (premorph -> struct) = rotate @(Left Zig) ! modify @(Obscure Lens) # try_to_rotate @(Right Zig) # sub @Left # struct -- TODO: Morphing ... = Conclussion Error <::> Nonempty Binary instance Morphable (Rotate (Right (Zig Zag))) (Construction Wye) where- type Morphing (Rotate (Right (Zig Zag))) (Construction Wye) = Binary- morphing = rotate @(Right Zig) . over (sub @Right) (run . rotate @(Left Zig) =<<) . premorph+ type Morphing (Rotate (Right (Zig Zag))) (Construction Wye) = Maybe <::> Construction Wye+ morphing (premorph -> struct) = rotate @(Right Zig) ! modify @(Obscure Lens) # try_to_rotate @(Left Zig) # sub @Right # struct branch :: forall b . Morphable (Into (b Maybe)) Wye => Wye ~> Morphing (Into (b Maybe)) Wye branch = into @(b Maybe)++try_to_rotate :: forall direction . Morphed (Rotate direction) (Nonempty Binary) Binary => Nonempty Binary ~> Nonempty Binary+try_to_rotate tree = resolve @(Nonempty Binary _) identity tree ! run # rotate @direction tree
Pandora/Paradigm/Structure/Some/Stream.hs view
@@ -1,5 +1,4 @@ {-# OPTIONS_GHC -fno-warn-orphans #-}- module Pandora.Paradigm.Structure.Some.Stream where import Pandora.Core.Functor (type (:=), type (:=>))@@ -7,13 +6,15 @@ import Pandora.Pattern.Category ((#)) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-))) import Pandora.Pattern.Functor.Extendable (Extendable ((<<=)))-import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:)), twosome)+import Pandora.Paradigm.Primary.Algebraic.Product ((:*:) ((:*:))) import Pandora.Paradigm.Primary.Algebraic (extract) 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.Reverse (Reverse (Reverse))+import Pandora.Paradigm.Primary (twosome) import Pandora.Paradigm.Structure.Ability.Morphable (Morphable (Morphing, morphing), Morph (Rotate), premorph, rotate)-import Pandora.Paradigm.Structure.Ability.Zipper (Zippable (Breadcrumbs))+import Pandora.Paradigm.Structure.Ability.Zipper (Zippable (Breadcrumbs), Tape) import Pandora.Paradigm.Schemes.T_U (T_U (T_U), type (<:.:>)) import Pandora.Paradigm.Primary.Algebraic (point) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, (!))@@ -21,22 +22,21 @@ type Stream = Construction Identity instance Zippable (Construction Identity) where- type Breadcrumbs (Construction Identity) = Stream <:.:> Stream := (:*:)+ type Breadcrumbs (Construction Identity) = Reverse Stream <:.:> Stream := (:*:) -instance Morphable (Rotate Left) (Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)) where- type Morphing (Rotate Left) (Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)) =- Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)- morphing (run . premorph -> Identity x :*: T_U (bs :*: fs)) = twosome # Identity (extract bs)- ! twosome # extract (deconstruct bs) # Construct x (point fs)+instance Morphable (Rotate Left) (Tape Stream) where+ type Morphing (Rotate Left) (Tape Stream) = Tape Stream+ morphing (run . premorph -> Identity x :*: T_U (Reverse bs :*: fs)) = twosome # Identity (extract bs)+ ! twosome # Reverse (extract # deconstruct bs) # Construct x (point fs) -instance Morphable (Rotate Right) (Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)) where- type Morphing (Rotate Right) (Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)) = Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)- morphing (run . premorph -> Identity x :*: T_U (bs :*: fs)) = twosome # Identity (extract fs)- ! twosome # Construct x (point bs) # extract (deconstruct fs)+instance Morphable (Rotate Right) (Tape Stream) where+ type Morphing (Rotate Right) (Tape Stream) = Tape Stream+ morphing (run . premorph -> Identity x :*: T_U (Reverse bs :*: fs)) = twosome # Identity (extract fs)+ ! twosome # Reverse (Construct x # point bs) # extract (deconstruct fs) -instance {-# OVERLAPS #-} Extendable (->) (Identity <:.:> (Stream <:.:> Stream := (:*:)) := (:*:)) where+instance {-# OVERLAPS #-} Extendable (->) (Tape Stream) where f <<= z = let move rtt = extract . deconstruct ! point . rtt .-+ z- in f <-|- T_U (Identity z :*: twosome # move (rotate @Left) # move (rotate @Right))+ in f <-|- T_U (Identity z :*: twosome # Reverse (move (rotate @Left)) # move (rotate @Right)) repeat :: a :=> Stream repeat x = Construct x . Identity ! repeat x
Pandora/Pattern/Functor.hs view
@@ -1,7 +1,5 @@ module Pandora.Pattern.Functor (module Exports) where -import Pandora.Pattern.Functor.Bivariant as Exports-import Pandora.Pattern.Functor.Divariant as Exports import Pandora.Pattern.Functor.Comonad as Exports import Pandora.Pattern.Functor.Monad as Exports import Pandora.Pattern.Functor.Representable as Exports
− Pandora/Pattern/Functor/Bivariant.hs
@@ -1,16 +0,0 @@-module Pandora.Pattern.Functor.Bivariant where--import Pandora.Pattern.Functor.Covariant (Covariant)-import Pandora.Pattern.Morphism.Flip (Flip)--infixl 4 <->--{- |-> When providing a new instance, you should ensure it satisfies:-> * Identity: identity <-> identity ≡ identity-> * Parametricity: (f . g) <-> (h . i) ≡ f <-> h . g <-> i--}--class (forall i . Covariant left target (v i), forall i . Covariant right target (Flip v i))- => Bivariant left right target v where- (<->) :: left a b -> right c d -> target (v a c) (v b d)
Pandora/Pattern/Functor/Contravariant.hs view
@@ -1,8 +1,10 @@ module Pandora.Pattern.Functor.Contravariant where import Pandora.Pattern.Category (Category)+import Pandora.Pattern.Betwixt (Betwixt) -infixl 4 >-|-, >!<+infixl 4 >-|-, >$<+infixl 3 >-|-|-, >$$< {- | > When providing a new instance, you should ensure it satisfies:@@ -13,5 +15,12 @@ class (Category source, Category target) => Contravariant source target t where (>-|-) :: source a b -> target (t b) (t a) -(>!<) :: Contravariant source target t => source a b -> target (t b) (t a)-(>!<) = (>-|-)+ (>-|-|-) :: (Contravariant source (Betwixt source target) u, Contravariant (Betwixt source target) target t)+ => source a b -> target (t (u a)) (t (u b))+ (>-|-|-) s = ((>-|-) ((>-|-) @source @(Betwixt source target) @_ s))++(>$<) :: Contravariant source target t => source a b -> target (t b) (t a)+(>$<) = (>-|-)++(>$$<) :: (Contravariant source target t, Contravariant source (Betwixt source target) u, Contravariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))+(>$$<) = (>-|-|-)
Pandora/Pattern/Functor/Covariant.hs view
@@ -5,9 +5,9 @@ import Pandora.Pattern.Betwixt (Betwixt) import Pandora.Pattern.Semigroupoid (Semigroupoid) -infixl 4 <-|-, <!>-infixl 3 <-|-|-, <!!>-infixl 2 <-|-|-|-, <!!!>+infixl 4 <-|-, <$>+infixl 3 <-|-|-, <$$>+infixl 2 <-|-|-|-, <$$$> {- | > When providing a new instance, you should ensure it satisfies:@@ -26,12 +26,12 @@ => source a b -> target (t (u (v a))) (t (u (v b))) (<-|-|-|-) s = ((<-|-) @(Betwixt (Betwixt source target) target) @target ((<-|-) @(Betwixt source (Betwixt source target)) @(Betwixt (Betwixt source target) target) @_ ((<-|-) @source @(Betwixt source (Betwixt source target)) @_ s))) -(<!>) :: Covariant source target t => source a b -> target (t a) (t b)-(<!>) = (<-|-)+(<$>) :: Covariant source target t => source a b -> target (t a) (t b)+(<$>) = (<-|-) -(<!!>) :: (Covariant source target t, Covariant source (Betwixt source target) u, Covariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))-(<!!>) = (<-|-|-)+(<$$>) :: (Covariant source target t, Covariant source (Betwixt source target) u, Covariant (Betwixt source target) target t) => source a b -> target (t (u a)) (t (u b))+(<$$>) = (<-|-|-) -(<!!!>) :: (Covariant source target t, Covariant source (Betwixt source (Betwixt source target)) v, Covariant (Betwixt source (Betwixt source target)) (Betwixt (Betwixt source target) target) u, Covariant (Betwixt (Betwixt source target) target) target t)+(<$$$>) :: (Covariant source target t, Covariant source (Betwixt source (Betwixt source target)) v, Covariant (Betwixt source (Betwixt source target)) (Betwixt (Betwixt source target) target) u, Covariant (Betwixt (Betwixt source target) target) target t) => source a b -> target (t (u (v a))) (t (u (v b)))-(<!!!>) s = (<-|-|-|-) s+(<$$$>) s = (<-|-|-|-) s
− Pandora/Pattern/Functor/Divariant.hs
@@ -1,17 +0,0 @@-module Pandora.Pattern.Functor.Divariant where--import Pandora.Pattern.Functor.Covariant (Covariant)-import Pandora.Pattern.Functor.Contravariant (Contravariant)-import Pandora.Pattern.Morphism.Flip (Flip)--infixl 4 >->--{- |-> When providing a new instance, you should ensure it satisfies:-> * Identity: identity >-> identity ≡ identity-> * Interpreted: f . g >-> h . i ≡ g >-> h . f >-> i--}--class (forall i . Contravariant left target (Flip v i), forall i . Covariant right target (v i))- => Divariant left right target v where- (>->) :: left a b -> right c d -> target (v b c) (v a d)
Pandora/Pattern/Object/Setoid.hs view
@@ -1,6 +1,6 @@ module Pandora.Pattern.Object.Setoid (Setoid (..)) where -import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False, True), (?))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (False, True)) infix 4 ==, != @@ -17,4 +17,6 @@ (==) :: a -> a -> Boolean (!=) :: a -> a -> Boolean- (!=) x y = (x == y ? False) True+ (!=) x y = case x == y of+ True -> False+ False -> True
pandora.cabal view
@@ -1,5 +1,5 @@ name: pandora-version: 0.4.9+version: 0.5.0 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@@ -88,6 +88,7 @@ -- Typeclassess about functor junctions Pandora.Paradigm.Controlflow.Effect Pandora.Paradigm.Controlflow.Effect.Interpreted+ Pandora.Paradigm.Controlflow.Effect.Conditional Pandora.Paradigm.Controlflow.Effect.Transformer Pandora.Paradigm.Controlflow.Effect.Transformer.Monadic Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic@@ -96,13 +97,18 @@ Pandora.Paradigm.Controlflow.Pipeline -- Tools for datastructures Pandora.Paradigm.Inventory- Pandora.Paradigm.Inventory.Accumulator- Pandora.Paradigm.Inventory.Provision- Pandora.Paradigm.Inventory.Equipment- Pandora.Paradigm.Inventory.Imprint- Pandora.Paradigm.Inventory.Optics- Pandora.Paradigm.Inventory.State- Pandora.Paradigm.Inventory.Store+ Pandora.Paradigm.Inventory.Ability+ Pandora.Paradigm.Inventory.Ability.Gettable+ Pandora.Paradigm.Inventory.Ability.Settable+ Pandora.Paradigm.Inventory.Ability.Modifiable+ Pandora.Paradigm.Inventory.Some+ Pandora.Paradigm.Inventory.Some.Accumulator+ Pandora.Paradigm.Inventory.Some.Provision+ Pandora.Paradigm.Inventory.Some.Equipment+ Pandora.Paradigm.Inventory.Some.Imprint+ Pandora.Paradigm.Inventory.Some.Optics+ Pandora.Paradigm.Inventory.Some.State+ Pandora.Paradigm.Inventory.Some.Store -- Tree-based datastructures Pandora.Paradigm.Structure Pandora.Paradigm.Structure.Ability@@ -118,6 +124,7 @@ Pandora.Paradigm.Structure.Modification.Combinative Pandora.Paradigm.Structure.Modification.Comprehension Pandora.Paradigm.Structure.Modification.Prefixed+ Pandora.Paradigm.Structure.Modification.Turnover Pandora.Paradigm.Structure.Interface Pandora.Paradigm.Structure.Interface.Set Pandora.Paradigm.Structure.Interface.Dictionary@@ -156,8 +163,6 @@ Pandora.Pattern.Functor.Monad Pandora.Pattern.Functor.Representable Pandora.Pattern.Functor.Traversable- Pandora.Pattern.Functor.Divariant- Pandora.Pattern.Functor.Bivariant -- Typeclassess about object internals Pandora.Pattern.Object Pandora.Pattern.Object.Setoid