packages feed

pandora 0.3.4 → 0.3.5

raw patch · 48 files changed

+378/−181 lines, 48 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Pandora.Core.Morphism: (!) :: a -> b -> a
- Pandora.Core.Morphism: (%) :: (a -> b -> c) -> b -> a -> c
- Pandora.Core.Morphism: (&) :: a -> (a -> b) -> b
- Pandora.Core.Morphism: fix :: (a -> a) -> a
- Pandora.Core.Morphism: infixl 1 &
- Pandora.Core.Morphism: infixr 2 !
- Pandora.Core.Morphism: infixr 9 %
- Pandora.Paradigm.Primary.Object.Natural: Natural :: Natural -> Natural
- Pandora.Paradigm.Primary.Object.Natural: Zero :: Natural
- Pandora.Paradigm.Primary.Object.Natural: data Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Chain.Chain Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Monoid.Monoid Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Quasiring.Quasiring Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Ringoid.Ringoid Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Semigroup.Semigroup Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Primary.Object.Natural: instance Pandora.Pattern.Object.Setoid.Setoid Pandora.Paradigm.Primary.Object.Natural.Natural
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Functor.Product.Product s)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Primary.Functor.Delta.Delta
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left t => Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Transformer.Tap.Tap (t Pandora.Paradigm.Schemes.TU.<:.> u))
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Functor.Product.Product s)
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Primary.Functor.Delta.Delta
- Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right t => Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Transformer.Tap.Tap (t Pandora.Paradigm.Schemes.TU.<:.> u))
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
- Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Structure.Binary.Binary
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Stack.Stack)
- Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just Pandora.Paradigm.Structure.Rose.Rose
- Pandora.Paradigm.Structure.Stack: delete :: Setoid a => a -> Stack a -> Stack a
- Pandora.Paradigm.Structure.Stack: pop :: Stack ~> Stack
- Pandora.Pattern.Functor.Applicative: instance Pandora.Pattern.Functor.Applicative.Applicative ((->) e)
- Pandora.Pattern.Functor.Bindable: (<>>=) :: Bindable t => (t b -> c) -> (a -> t b) -> t a -> c
- Pandora.Pattern.Functor.Bindable: instance Pandora.Pattern.Functor.Bindable.Bindable ((->) e)
- Pandora.Pattern.Functor.Covariant: instance Pandora.Pattern.Functor.Covariant.Covariant ((->) a)
- Pandora.Pattern.Functor.Distributive: instance Pandora.Pattern.Functor.Distributive.Distributive ((->) e)
- Pandora.Pattern.Functor.Extractable: instance Pandora.Pattern.Object.Monoid.Monoid e => Pandora.Pattern.Functor.Extractable.Extractable ((->) e)
- Pandora.Pattern.Functor.Pointable: instance Pandora.Pattern.Functor.Pointable.Pointable ((->) e)
- Pandora.Pattern.Functor.Representable: instance Pandora.Pattern.Functor.Representable.Representable ((->) e)
+ Pandora.Paradigm.Primary.Functor: match :: Predicate a -> (a -> r) -> a -> r -> r :*: a
+ Pandora.Paradigm.Primary.Functor.Equivalence: instance Pandora.Pattern.Functor.Divisible.Divisible Pandora.Paradigm.Primary.Functor.Equivalence.Equivalence
+ Pandora.Paradigm.Primary.Functor.Function: (!) :: a -> b -> a
+ Pandora.Paradigm.Primary.Functor.Function: (%) :: (a -> b -> c) -> b -> a -> c
+ Pandora.Paradigm.Primary.Functor.Function: (&) :: a -> (a -> b) -> b
+ Pandora.Paradigm.Primary.Functor.Function: fix :: (a -> a) -> a
+ Pandora.Paradigm.Primary.Functor.Function: infixl 1 &
+ Pandora.Paradigm.Primary.Functor.Function: infixr 2 !
+ Pandora.Paradigm.Primary.Functor.Function: infixr 9 %
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Applicative.Applicative ((->) e)
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Bindable.Bindable ((->) e)
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Covariant.Covariant ((->) a)
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Distributive.Distributive ((->) e)
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Pointable.Pointable ((->) e)
+ Pandora.Paradigm.Primary.Functor.Function: instance Pandora.Pattern.Functor.Representable.Representable ((->) e)
+ Pandora.Paradigm.Primary.Functor.Predicate: instance Pandora.Pattern.Functor.Divisible.Divisible Pandora.Paradigm.Primary.Functor.Predicate.Predicate
+ Pandora.Paradigm.Primary.Object.Denumerator: Denumerator :: Denumerator -> Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: One :: Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: data Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: instance Pandora.Pattern.Object.Chain.Chain Pandora.Paradigm.Primary.Object.Denumerator.Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: instance Pandora.Pattern.Object.Ringoid.Ringoid Pandora.Paradigm.Primary.Object.Denumerator.Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: instance Pandora.Pattern.Object.Semigroup.Semigroup Pandora.Paradigm.Primary.Object.Denumerator.Denumerator
+ Pandora.Paradigm.Primary.Object.Denumerator: instance Pandora.Pattern.Object.Setoid.Setoid Pandora.Paradigm.Primary.Object.Denumerator.Denumerator
+ Pandora.Paradigm.Primary.Object.Numerator: Numerator :: Denumerator -> Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: Zero :: Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: data Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Chain.Chain Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Monoid.Monoid Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Quasiring.Quasiring Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Ringoid.Ringoid Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Semigroup.Semigroup Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Primary.Object.Numerator: instance Pandora.Pattern.Object.Setoid.Setoid Pandora.Paradigm.Primary.Object.Numerator.Numerator
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t) a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Functor.Product.Product s) a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Primary.Functor.Delta.Delta a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Functor.Delta.Delta Pandora.Paradigm.Schemes.TU.<:.> t) a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Functor.Product.Product s) a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Primary.Functor.Delta.Delta a2
+ Pandora.Paradigm.Structure: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail (Pandora.Paradigm.Primary.Transformer.Tap.Tap t) a2
+ Pandora.Paradigm.Structure.Ability.Convertible: class Convertible f t u a
+ Pandora.Paradigm.Structure.Ability.Convertible: conversion :: Convertible f t u a => Tagged f (t a) -> u a
+ Pandora.Paradigm.Structure.Ability.Convertible: convert :: forall f t u a. Convertible f t u a => t a -> u a
+ Pandora.Paradigm.Structure.Ability.Measurable: Depth :: Scale
+ Pandora.Paradigm.Structure.Ability.Measurable: Heighth :: Scale
+ Pandora.Paradigm.Structure.Ability.Measurable: Length :: Scale
+ Pandora.Paradigm.Structure.Ability.Measurable: class Measurable f t where {
+ Pandora.Paradigm.Structure.Ability.Measurable: data Scale
+ Pandora.Paradigm.Structure.Ability.Measurable: measure :: forall f t a. Measurable f t => t a -> Measural f t a
+ Pandora.Paradigm.Structure.Ability.Measurable: measurement :: Measurable f t => Tagged f (t a) -> Measural f t a
+ Pandora.Paradigm.Structure.Ability.Measurable: type family Measural (f :: k) (t :: * -> *) a;
+ Pandora.Paradigm.Structure.Ability.Measurable: }
+ Pandora.Paradigm.Structure.Ability.Substructure: All :: a -> Segment a
+ Pandora.Paradigm.Structure.Ability.Substructure: Delete :: a -> Command a
+ Pandora.Paradigm.Structure.Ability.Substructure: First :: a -> Segment a
+ Pandora.Paradigm.Structure.Ability.Substructure: Tail :: a -> Segment a
+ Pandora.Paradigm.Structure.Ability.Substructure: data Command a
+ Pandora.Paradigm.Structure.Ability.Substructure: data Segment a
+ Pandora.Paradigm.Structure.Binary: binary :: forall t a. (Traversable t, Chain a) => t a -> Binary a
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye)
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Heighth Pandora.Paradigm.Structure.Binary.Binary
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) a2
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Left Pandora.Paradigm.Structure.Binary.Binary a2
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Wye.Wye) a2
+ Pandora.Paradigm.Structure.Binary: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Wye.Right Pandora.Paradigm.Structure.Binary.Binary a2
+ Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Structure.Stack.Stack) a2
+ Pandora.Paradigm.Structure.Rose: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Primary.Functor.Maybe.Just Pandora.Paradigm.Structure.Rose.Rose a2
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe)
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Measurable.Measurable 'Pandora.Paradigm.Structure.Ability.Measurable.Length Pandora.Paradigm.Structure.Stack.Stack
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) a2
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Paradigm.Structure.Ability.Substructure.Substructure 'Pandora.Paradigm.Structure.Ability.Substructure.Tail Pandora.Paradigm.Structure.Stack.Stack a2
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Setoid.Setoid a2 => Pandora.Paradigm.Structure.Ability.Substructure.Substructure ('Pandora.Paradigm.Structure.Ability.Substructure.Delete 'Pandora.Paradigm.Structure.Ability.Substructure.All) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) a2
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Setoid.Setoid a2 => Pandora.Paradigm.Structure.Ability.Substructure.Substructure ('Pandora.Paradigm.Structure.Ability.Substructure.Delete 'Pandora.Paradigm.Structure.Ability.Substructure.First) (Pandora.Paradigm.Primary.Transformer.Construction.Construction Pandora.Paradigm.Primary.Functor.Maybe.Maybe) a2
+ Pandora.Paradigm.Structure.Stack: instance Pandora.Pattern.Object.Setoid.Setoid a2 => Pandora.Paradigm.Structure.Ability.Substructure.Substructure ('Pandora.Paradigm.Structure.Ability.Substructure.Delete 'Pandora.Paradigm.Structure.Ability.Substructure.First) Pandora.Paradigm.Structure.Stack.Stack a2
+ Pandora.Pattern.Functor.Adjoint: ($$$$|-) :: (Adjoint t u, Covariant v, Covariant w, Covariant x, Covariant y) => ((v :. (w :. (x :. (y :. t)))) := a) -> (a -> u b) -> (v :. (w :. (x :. y))) := b
+ Pandora.Pattern.Functor.Adjoint: ($$$|-) :: (Adjoint t u, Covariant v, Covariant w, Covariant x) => ((v :. (w :. (x :. t))) := a) -> (a -> u b) -> (v :. (w :. x)) := b
+ Pandora.Pattern.Functor.Adjoint: ($$|-) :: (Adjoint t u, Covariant v, Covariant w) => ((v :. (w :. t)) := a) -> (a -> u b) -> (v :. w) := b
+ Pandora.Pattern.Functor.Divisible: (>*<) :: Divisible t => t b -> t c -> t (b :*: c)
+ Pandora.Pattern.Functor.Divisible: class Contravariant t => Divisible t
+ Pandora.Pattern.Functor.Divisible: infixr 5 >*<
- Pandora.Paradigm.Structure.Ability.Substructure: class Substructure f t where {
+ Pandora.Paradigm.Structure.Ability.Substructure: class Substructure f t a where {
- Pandora.Paradigm.Structure.Ability.Substructure: sub :: forall f t a. Substructure f t => t a :-. Substructural f t a
+ Pandora.Paradigm.Structure.Ability.Substructure: sub :: forall f t a. Substructure f t a => t a :-. Substructural f t a
- Pandora.Paradigm.Structure.Ability.Substructure: substructure :: Substructure f t => Tagged f (t a) :-. Substructural f t a
+ Pandora.Paradigm.Structure.Ability.Substructure: substructure :: Substructure f t a => Tagged f (t a) :-. Substructural f t a
- Pandora.Paradigm.Structure.Ability.Substructure: type family Substructural (f :: * -> k) (t :: * -> *) a;
+ Pandora.Paradigm.Structure.Ability.Substructure: type family Substructural (f :: k) (t :: * -> *) a;
- Pandora.Paradigm.Structure.Interface.Set: cardinality :: Traversable t => t a -> Natural
+ Pandora.Paradigm.Structure.Interface.Set: cardinality :: Traversable t => t a -> Numerator

Files

CHANGELOG.md view
@@ -310,3 +310,20 @@ * Rename `via` to `-=:` in Interpreted module * Flip arguments for `Bindable` `$>>=` and `Extendable` `$=>>` methods * Define experimental methods: `-|$`, `$|-`++# 0.3.5+* Define inductive `Denumerator` number datatype in `Object` module+* Rename `Natural` datatype to `Numerator`+* Define `Measurable` typeclass to measure datastructures+* Define `Convertible` typeclass for structure transformation+* Define `binary` method to construct `Binary` trees from other structures+* Remove `pop` method of `Stack`, use `Substructure` `Tail` instance instead+* Appear additional type parameter in `Substructure` typeclass+* Define `Divisible` typeclass+* Define `Function` module to contain instances for function+* Move `!`, `%`, `&` to `Function` module+* Remove `Pandora.Core.Morphism` module+* Define `$$|-`, `$$$|-`, `$$$$|-` methods of `Adjoint` typeclass+* Define `match` method to chain predicates++# 0.3.6
Pandora/Core.hs view
@@ -1,4 +1,3 @@ module Pandora.Core (module Exports) where -import Pandora.Core.Morphism as Exports import Pandora.Core.Functor as Exports
Pandora/Core/Functor.hs view
@@ -19,7 +19,7 @@ -- | Algebra's type operator type (<-|) a t = t a -> a --- | Natural transformation+-- | Numerator transformation type (~>) t u = forall a . t a -> u a  type (::|:.) p a b = p (p a b) b
− Pandora/Core/Morphism.hs
@@ -1,20 +0,0 @@-module Pandora.Core.Morphism (fix, (&), (!), (%)) where--infixl 1 &-infixr 2 !-infixr 9 %--fix :: (a -> a) -> a-fix f = let x = f x in x--{-# INLINE (&) #-}-(&) :: a -> (a -> b) -> b-x & f = f x--{-# INLINE (!) #-}-(!) :: a -> b -> a-x ! _ = x--{-# INLINE (%) #-}-(%) :: (a -> b -> c) -> b -> a -> c-(%) f x y = f y x
Pandora/Paradigm/Inventory.hs view
@@ -11,9 +11,9 @@ import Pandora.Paradigm.Inventory.Accumulator as Exports  import Pandora.Core.Functor (type (~>))-import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.), ($), identity) import Pandora.Pattern.Functor (Adjoint ((-|), (|-)), extract, (<->))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:))) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run) import Pandora.Paradigm.Controlflow.Effect.Adaptable (adapt)@@ -33,4 +33,5 @@ 	x |- g = run x |- run . g  zoom :: Stateful bg t => Lens bg ls -> State ls ~> t-zoom lens lesser = adapt . State $ (\(Store (p :*: g)) -> (g <-> identity) . run lesser $ p) . lens+zoom lens less = let restruct f v = f <-> identity $ run less v+	in adapt . State $ (|- restruct) . run . lens
Pandora/Paradigm/Inventory/Environment.hs view
@@ -9,7 +9,7 @@ import Pandora.Pattern.Functor.Distributive (Distributive ((>>-))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Monad (Monad)-import Pandora.Core.Morphism ((!), (%))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%)) 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))
Pandora/Paradigm/Inventory/Imprint.hs view
@@ -10,6 +10,7 @@ import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Paradigm.Primary.Functor.Function () import Pandora.Paradigm.Controlflow.Effect.Interpreted (Schematic, Interpreted (Primary, run, unite)) import Pandora.Paradigm.Controlflow.Effect.Transformer.Comonadic (Comonadic (bring), (:<) (TC)) import Pandora.Paradigm.Controlflow.Effect.Adaptable (Adaptable)
Pandora/Paradigm/Inventory/Optics.hs view
@@ -18,7 +18,7 @@ -- Reference to taret within some source type Lens src tgt = src |-> Store tgt --- Lens as natural transformation+-- Lens as Numerator transformation type (:~.) t u a = Lens (t a) (u a)  -- | Lens composition infix operator
Pandora/Paradigm/Inventory/Store.hs view
@@ -2,7 +2,7 @@  module Pandora.Paradigm.Inventory.Store where -import Pandora.Core (type (:.), type (:=), type (<-|), type (~>), (%))+import Pandora.Core (type (:.), type (:=), type (<-|), type (~>)) import Pandora.Pattern ((.|..)) import Pandora.Pattern.Category (identity, (.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>)))@@ -10,7 +10,9 @@ import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Functor.Comonad (Comonad) import Pandora.Pattern.Functor.Adjoint ((-|), (|-))-import Pandora.Paradigm.Primary.Functor (Product ((:*:)), type (:*:), attached)+import Pandora.Paradigm.Primary.Functor.Function ((%))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), type (:*:), attached)+import Pandora.Paradigm.Primary.Functor () 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))
Pandora/Paradigm/Primary/Functor.hs view
@@ -1,6 +1,6 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Pandora.Paradigm.Primary.Functor (module Exports, note, hush, left, right, this, that, here, there, branches) where+module Pandora.Paradigm.Primary.Functor (module Exports, note, hush, left, right, this, that, here, there, branches, match) where  import Pandora.Paradigm.Primary.Functor.Fix as Exports import Pandora.Paradigm.Primary.Functor.Equivalence as Exports@@ -19,11 +19,12 @@ import Pandora.Paradigm.Primary.Functor.Delta as Exports import Pandora.Paradigm.Primary.Functor.Constant as Exports import Pandora.Paradigm.Primary.Functor.Identity as Exports+import Pandora.Paradigm.Primary.Functor.Function as Exports -import Pandora.Core.Morphism ((!)) import Pandora.Core.Functor (type (~>)) import Pandora.Pattern.Category (($)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-)))+import Pandora.Paradigm.Primary.Object.Boolean ((?)) import Pandora.Paradigm.Structure.Ability.Monotonic (reduce)  instance Adjoint (Product s) ((->) s) where@@ -75,3 +76,6 @@ branches Nothing (Just y) = Right y branches (Just x) Nothing = Left x branches Nothing Nothing = End++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/Equivalence.hs view
@@ -2,9 +2,16 @@  import Pandora.Pattern.Category (($)) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))+import Pandora.Pattern.Functor.Divisible (Divisible ((>*<)))+import Pandora.Pattern.Object.Ringoid (Ringoid ((*))) import Pandora.Paradigm.Primary.Object.Boolean (Boolean)+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))  data Equivalence a = Equivalence (a -> a -> Boolean)  instance Contravariant Equivalence where 	f >$< Equivalence g = Equivalence $ \x y -> g (f x) (f y)++instance Divisible Equivalence where+	Equivalence g >*< Equivalence h = Equivalence $+		\(x :*: x') (y :*: y') -> g x y * h x' y'
+ Pandora/Paradigm/Primary/Functor/Function.hs view
@@ -0,0 +1,50 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++module Pandora.Paradigm.Primary.Functor.Function where++import Pandora.Pattern.Category ((.), identity)+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Applicative (Applicative ((<*>)))+import Pandora.Pattern.Functor.Distributive (Distributive ((>>-)))+import Pandora.Pattern.Functor.Pointable (Pointable (point))+import Pandora.Pattern.Functor.Bindable (Bindable ((>>=)))+import Pandora.Pattern.Functor.Representable (Representable (Representation, (<#>), tabulate))++infixr 2 !+infixr 9 %+infixl 1 &++instance Covariant ((->) a) where+	(<$>) = (.)++instance Applicative ((->) e) where+	(<*>) f g x = f x (g x)++instance Distributive ((->) e) where+	g >>- f = \e -> (f % e) <$> g++instance Pointable ((->) e) where+	point = (!)++instance Bindable ((->) e) where+	f >>= g = \x -> g (f x) x++instance Representable ((->) e) where+	type Representation ((->) e) = e+	(<#>) = (identity %)+	tabulate = identity++{-# INLINE (!) #-}+(!) :: a -> b -> a+x ! _ = x++{-# INLINE (%) #-}+(%) :: (a -> b -> c) -> b -> a -> c+(%) f x y = f y x++{-# INLINE (&) #-}+(&) :: a -> (a -> b) -> b+x & f = f x++fix :: (a -> a) -> a+fix f = let x = f x in x
Pandora/Paradigm/Primary/Functor/Predicate.hs view
@@ -1,19 +1,25 @@ module Pandora.Paradigm.Primary.Functor.Predicate where  import Pandora.Core.Functor (type (~>), type (|->))-import Pandora.Core.Morphism ((!)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))+import Pandora.Pattern.Functor.Divisible (Divisible ((>*<))) import Pandora.Pattern.Functor.Determinable (Determinable (determine)) import Pandora.Pattern.Functor.Pointable (Pointable (point)) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Object.Setoid (Setoid ((==)))+import Pandora.Pattern.Object.Ringoid (Ringoid ((*))) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False), bool, (?))+import Pandora.Paradigm.Primary.Functor.Function ((!))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))  newtype Predicate a = Predicate (a -> Boolean)  instance Contravariant Predicate where 	f >$< Predicate g = Predicate $ g . f++instance Divisible Predicate where+	Predicate g >*< Predicate h = Predicate $ \(b :*: c) -> g b * h c  instance Determinable Predicate where 	determine = Predicate (True !)
Pandora/Paradigm/Primary/Object.hs view
@@ -2,7 +2,8 @@  module Pandora.Paradigm.Primary.Object (module Exports) where -import Pandora.Paradigm.Primary.Object.Natural as Exports+import Pandora.Paradigm.Primary.Object.Denumerator as Exports+import Pandora.Paradigm.Primary.Object.Numerator as Exports import Pandora.Paradigm.Primary.Object.Ordering as Exports import Pandora.Paradigm.Primary.Object.Boolean as Exports 
+ Pandora/Paradigm/Primary/Object/Denumerator.hs view
@@ -0,0 +1,30 @@+module Pandora.Paradigm.Primary.Object.Denumerator where++import Pandora.Pattern.Category (($))+import Pandora.Pattern.Object.Setoid (Setoid ((==)))+import Pandora.Pattern.Object.Chain (Chain ((<=>)))+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Pattern.Object.Ringoid (Ringoid ((*)))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))+import Pandora.Paradigm.Primary.Object.Ordering (Ordering (Less, Equal, Greater))++data Denumerator = One | Denumerator Denumerator++instance Setoid Denumerator where+	One == One = True+	Denumerator n == Denumerator m = n == m+	_ == _ = False++instance Chain Denumerator where+	One <=> One = Equal+	One <=> Denumerator _ = Less+	Denumerator _ <=> One = Greater+	Denumerator n <=> Denumerator m = n <=> m++instance Semigroup Denumerator where+	One + m = Denumerator m+	Denumerator n + m = Denumerator $ n + m++instance Ringoid Denumerator where+	One * n = n+	Denumerator n * m = m + n * m
− Pandora/Paradigm/Primary/Object/Natural.hs
@@ -1,38 +0,0 @@-module Pandora.Paradigm.Primary.Object.Natural where--import Pandora.Pattern.Category (($))-import Pandora.Pattern.Object.Setoid (Setoid ((==)))-import Pandora.Pattern.Object.Chain (Chain ((<=>)))-import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-import Pandora.Pattern.Object.Ringoid (Ringoid ((*)))-import Pandora.Pattern.Object.Monoid (Monoid (zero))-import Pandora.Pattern.Object.Quasiring (Quasiring (one))-import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))-import Pandora.Paradigm.Primary.Object.Ordering (Ordering (Less, Equal, Greater))--data Natural = Zero | Natural Natural--instance Setoid Natural where-	Zero == Zero = True-	Natural n == Natural m = n == m-	_ == _ = False--instance Chain Natural where-	Zero <=> Zero = Equal-	Zero <=> Natural _ = Less-	Natural _ <=> Zero = Greater-	Natural n <=> Natural m = n <=> m--instance Semigroup Natural where-	Zero + m = m-	Natural n + m = Natural $ n + m--instance Ringoid Natural where-	Zero * _ = Zero-	Natural n * m = m + n * m--instance Monoid Natural where-	zero = Zero--instance Quasiring Natural where-	one = Natural Zero
+ Pandora/Paradigm/Primary/Object/Numerator.hs view
@@ -0,0 +1,41 @@+module Pandora.Paradigm.Primary.Object.Numerator where++import Pandora.Pattern.Category (($))+import Pandora.Pattern.Object.Setoid (Setoid ((==)))+import Pandora.Pattern.Object.Chain (Chain ((<=>)))+import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))+import Pandora.Pattern.Object.Ringoid (Ringoid ((*)))+import Pandora.Pattern.Object.Monoid (Monoid (zero))+import Pandora.Pattern.Object.Quasiring (Quasiring (one))+import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))+import Pandora.Paradigm.Primary.Object.Ordering (Ordering (Less, Equal, Greater))+import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))++data Numerator = Zero | Numerator Denumerator++instance Setoid Numerator where+	Zero == Zero = True+	Numerator n == Numerator m = n == m+	_ == _ = False++instance Chain Numerator where+	Zero <=> Zero = Equal+	Zero <=> Numerator _ = Less+	Numerator _ <=> Zero = Greater+	Numerator n <=> Numerator m = n <=> m++instance Semigroup Numerator where+	Zero + m = m+	Numerator n + Zero = Numerator n+	Numerator n + Numerator m = Numerator $ n + m++instance Ringoid Numerator where+	Zero * _ = Zero+	Numerator _ * Zero = Zero+	Numerator n * Numerator m = Numerator $ m + n * m++instance Monoid Numerator where+	zero = Zero++instance Quasiring Numerator where+	one = Numerator One
Pandora/Paradigm/Primary/Transformer/Backwards.hs view
@@ -1,6 +1,5 @@ module Pandora.Paradigm.Primary.Transformer.Backwards where -import Pandora.Core.Morphism ((&)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Contravariant (Contravariant ((>$<)))@@ -12,6 +11,7 @@ import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))+import Pandora.Paradigm.Primary.Functor.Function ((&)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))  newtype Backwards t a = Backwards (t a)
Pandora/Paradigm/Primary/Transformer/Continuation.hs view
@@ -1,7 +1,6 @@ module Pandora.Paradigm.Primary.Transformer.Continuation where  import Pandora.Core.Functor (type (:.), type (:=), type (::|:.))-import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))@@ -10,6 +9,7 @@ import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Functor.Monad (Monad) import Pandora.Pattern.Transformer.Liftable (Liftable (lift))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%))  newtype Continuation r t a = Continuation { continue :: (->) ::|:. a :. t := r } 
Pandora/Paradigm/Primary/Transformer/Day.hs view
@@ -9,6 +9,7 @@ import Pandora.Pattern.Functor.Extendable (Extendable ((=>>))) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))+import Pandora.Paradigm.Primary.Functor.Function () import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))  data Day t u a = forall b c . Day (t b) (u c) (b -> c -> a)
Pandora/Paradigm/Primary/Transformer/Outline.hs view
@@ -1,6 +1,5 @@ module Pandora.Paradigm.Primary.Transformer.Outline where -import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category (identity, (.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))@@ -9,6 +8,7 @@ import Pandora.Pattern.Transformer.Liftable (Liftable (lift)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))+import Pandora.Paradigm.Primary.Functor.Function ((%))  data Outline t a where 	Line :: a -> Outline t a
Pandora/Paradigm/Primary/Transformer/Tap.hs view
@@ -1,6 +1,5 @@ module Pandora.Paradigm.Primary.Transformer.Tap where -import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty))@@ -13,6 +12,7 @@ import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Transformer.Lowerable (Lowerable (lower)) import Pandora.Pattern.Transformer.Hoistable (Hoistable (hoist))+import Pandora.Paradigm.Primary.Functor.Function ((%))  data Tap t a = Tap a (t a) 
Pandora/Paradigm/Primary/Transformer/Yoneda.hs view
@@ -1,6 +1,5 @@ module Pandora.Paradigm.Primary.Transformer.Yoneda where -import Pandora.Core.Morphism ((!)) import Pandora.Pattern.Category (identity, (.), ($)) import Pandora.Pattern.Functor ((<*+>)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))@@ -11,6 +10,7 @@ import Pandora.Pattern.Functor.Extractable (Extractable (extract)) import Pandora.Pattern.Functor.Adjoint (Adjoint ((-|), (|-))) import Pandora.Pattern.Transformer.Liftable (Liftable (lift))+import Pandora.Paradigm.Primary.Functor.Function ((!))  newtype Yoneda t a = Yoneda 	{ yoneda :: forall b . (a -> b) -> t b }
Pandora/Paradigm/Structure.hs view
@@ -12,7 +12,7 @@  import Pandora.Pattern (($), (.), extract) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, unite)-import Pandora.Paradigm.Inventory (Store (Store), (^.), (.~))+import Pandora.Paradigm.Inventory.Store (Store (Store)) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Functor.Delta (Delta ((:^:))) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just))@@ -29,36 +29,30 @@ instance Nullable Maybe where 	null = Predicate $ \case { Just _ -> True ; _ -> False } -instance Substructure Left (Product s) where+instance Substructure Left (Product s) a where 	type Substructural Left (Product s) a = s 	substructure (extract -> s :*: x) = Store $ s :*: Tag . (:*: x) -instance Substructure Right (Product s) where+instance Substructure Right (Product s) a where 	type Substructural Right (Product s) a = a 	substructure (extract -> s :*: x) = Store $ x :*: Tag . (s :*:) -instance Substructure Left Delta where+instance Substructure Left Delta a where 	type Substructural Left Delta a = a 	substructure (extract -> l :^: r) = Store $ l :*: Tag . (:^: r) -instance Substructure Right Delta where+instance Substructure Right Delta a where 	type Substructural Right Delta a = a 	substructure (extract -> l :^: r) = Store $ r :*: Tag . (l :^:) -instance Substructure Left (Delta <:.> t) where+instance Substructure Left (Delta <:.> t) a where 	type Substructural Left (Delta <:.> t) a = t a 	substructure (run . extract -> l :^: r) = Store $ r :*: Tag . unite . (l :^:) -instance Substructure Right (Delta <:.> t) where+instance Substructure Right (Delta <:.> t) a where 	type Substructural Right (Delta <:.> t) a = t a 	substructure (run . extract -> l :^: r) = Store $ l :*: Tag . unite . (:^: r) -instance Substructure Left t => Substructure Left (Tap (t <:.> u)) where-	type Substructural Left (Tap (t <:.> u)) a = Substructural Left t (u a)-	substructure (extract -> Tap x xs) = Store $-		sub @Left ^. run xs :*: Tag . (\new -> sub @Left .~ new $ Tap x xs)--instance Substructure Right t => Substructure Right (Tap (t <:.> u)) where-	type Substructural Right (Tap (t <:.> u)) a = Substructural Right t (u a)-	substructure (extract -> Tap x xs) = Store $-		sub @Right ^. run xs :*: Tag . (\new -> sub @Right .~ new $ Tap x xs)+instance Substructure Tail (Tap t) a where+	type Substructural Tail (Tap t) a = t a+	substructure (extract -> Tap x xs) = Store $ xs :*: Tag . Tap x
Pandora/Paradigm/Structure/Ability.hs view
@@ -5,7 +5,9 @@ import Pandora.Paradigm.Structure.Ability.Substructure as Exports import Pandora.Paradigm.Structure.Ability.Rotatable as Exports import Pandora.Paradigm.Structure.Ability.Insertable as Exports+import Pandora.Paradigm.Structure.Ability.Measurable as Exports import Pandora.Paradigm.Structure.Ability.Focusable as Exports+import Pandora.Paradigm.Structure.Ability.Convertible as Exports import Pandora.Paradigm.Structure.Ability.Nullable as Exports import Pandora.Paradigm.Structure.Ability.Nonempty as Exports import Pandora.Paradigm.Structure.Ability.Comprehension as Exports
Pandora/Paradigm/Structure/Ability/Comprehension.hs view
@@ -3,7 +3,6 @@ module Pandora.Paradigm.Structure.Ability.Comprehension where  import Pandora.Core.Functor (type (:=))-import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Pointable (Pointable (point))@@ -12,9 +11,10 @@ import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+)))-import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))+import Pandora.Paradigm.Primary.Functor.Function ((%)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (Interpreted (Primary, run, unite))+import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>))  newtype Comprehension t a = Comprehension (t <:.> Construction t := a) 
+ Pandora/Paradigm/Structure/Ability/Convertible.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE AllowAmbiguousTypes #-}++module Pandora.Paradigm.Structure.Ability.Convertible where++import Pandora.Pattern.Category ((.))+import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag))++class Convertible f t u a where+	conversion :: Tagged f (t a) -> u a++convert :: forall f t u a . Convertible f t u a => t a -> u a+convert = conversion . Tag @f
+ Pandora/Paradigm/Structure/Ability/Measurable.hs view
@@ -0,0 +1,15 @@+{-# LANGUAGE AllowAmbiguousTypes #-}++module Pandora.Paradigm.Structure.Ability.Measurable where++import Pandora.Pattern.Category ((.))+import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag))++class Measurable f t where+	type Measural (f :: k) (t :: * -> *) a+	measurement :: Tagged f (t a) -> Measural f t a++measure :: forall f t a . Measurable f t => t a -> Measural f t a+measure = measurement . Tag @f++data Scale = Length | Heighth | Depth
Pandora/Paradigm/Structure/Ability/Monotonic.hs view
@@ -1,10 +1,10 @@ module Pandora.Paradigm.Structure.Ability.Monotonic where -import Pandora.Core.Morphism ((!)) import Pandora.Pattern ((.|..)) import Pandora.Pattern.Functor ((<+>)) import Pandora.Pattern.Functor.Pointable (Pointable) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty))+import Pandora.Paradigm.Primary.Functor.Function ((!)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate, satisfy)  class Monotonic a e where
Pandora/Paradigm/Structure/Ability/Substructure.hs view
@@ -8,9 +8,13 @@ import Pandora.Paradigm.Inventory.Optics (type (:-.)) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) -class Substructure f t where-	type Substructural (f :: * -> k) (t :: * -> *) a+class Substructure f t a where+	type Substructural (f :: k) (t :: * -> *) a 	substructure :: Tagged f (t a) :-. Substructural f t a -sub :: forall f t a . Substructure f t => t a :-. Substructural f t a+sub :: forall f t a . Substructure f t a => t a :-. Substructural f t a sub = comap extract . substructure . Tag @f++data Command a = Delete a++data Segment a = All a | First a | Tail a
Pandora/Paradigm/Structure/Binary.hs view
@@ -4,27 +4,34 @@ module Pandora.Paradigm.Structure.Binary where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((&), (%), (!)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), comap))+import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Functor.Extractable (extract)+import Pandora.Pattern.Functor.Avoidable (empty) import Pandora.Pattern.Transformer.Liftable (lift)+import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Chain (Chain ((<=>))) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False)) import Pandora.Paradigm.Primary.Object.Ordering (order)+import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Numerator, Zero))+import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%), (&)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate))-import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))+import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)), attached) import Pandora.Paradigm.Primary.Functor.Wye (Wye (End, Left, Right, Both)) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag)) import Pandora.Paradigm.Primary.Transformer.Construction (Construction (Construct), deconstruct) import Pandora.Paradigm.Schemes (TU (TU), T_ (T_), T_U (T_U), type (<:.>), type (<:*:>)) import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Inventory.State (State, modify) import Pandora.Paradigm.Inventory.Store (Store (Store)) import Pandora.Paradigm.Inventory.Optics (type (:-.), (|>), (%~)) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Focusable (Focusable (Focusing, focusing), Location (Root))+import Pandora.Paradigm.Structure.Ability.Measurable (Measurable (Measural, measurement), Scale (Heighth), measure) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (resolve)) import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert)) import Pandora.Paradigm.Structure.Ability.Rotatable (Rotatable (Rotational, rotation))@@ -49,15 +56,20 @@ 	focusing (run . extract -> Nothing) = Store $ Nothing :*: Tag . TU . comap (Construct % End) 	focusing (run . extract -> Just x) = Store $ Just (extract x) :*: Tag . lift . resolve (Construct % deconstruct x) (rebalance $ deconstruct x) +instance Measurable Heighth Binary where+	type Measural Heighth Binary a = Numerator+	measurement (run . extract -> Just bt) = Numerator $ measure @Heighth bt+	measurement (run . extract -> Nothing) = Zero+ instance Nullable Binary where 	null = Predicate $ \case { TU Nothing -> True ; _ -> False } -instance Substructure Left Binary where+instance Substructure Left Binary a where 	type Substructural Left Binary a = Binary a 	substructure empty_tree@(run . extract -> Nothing) = Store $ extract empty_tree :*: (!) empty_tree 	substructure (run . extract -> Just tree) = Tag . lift <$> (sub @Left |> can_be_empty) tree -instance Substructure Right Binary where+instance Substructure Right Binary a where 	type Substructural Right Binary a = Binary a 	substructure empty_tree@(run . extract -> Nothing) = Store $ extract empty_tree :*: (!) empty_tree 	substructure (run . extract -> Just tree) = Tag . lift <$> (sub @Right |> can_be_empty) tree@@ -65,6 +77,14 @@ can_be_empty :: Maybe (Construction Wye a) :-. Binary a can_be_empty maybe_tree = Store $ TU maybe_tree :*: run +binary :: forall t a . (Traversable t, Chain a) => t a -> Binary a+binary struct = attached $ run @(State (Binary a)) % empty $ struct ->> modify @(Binary a) . insert' where++	insert' :: a -> Binary a -> Binary a+	insert' x (run -> Nothing) = lift . Construct x $ End+	insert' x tree@(run -> Just nonempty) = x <=> extract nonempty & order+		(sub @Left %~ insert' x $ tree) tree (sub @Right %~ insert' x $ tree)+ type instance Nonempty Binary = Construction Wye  instance Focusable Root (Construction Wye) where@@ -75,14 +95,23 @@ 	insert x nonempty = let change = Just . resolve (insert x) (Construct x End) in 		x <=> extract nonempty & order (sub @Left %~ change $ nonempty) nonempty (sub @Right %~ change $ nonempty) -instance Substructure Left (Construction Wye) where+instance Measurable Heighth (Construction Wye) where+	type Measural Heighth (Construction Wye) a = Denumerator+	measurement (deconstruct . extract -> End) = One+	measurement (deconstruct . extract -> Left lst) = One + measure @Heighth lst+	measurement (deconstruct . extract -> Right rst) = One + measure @Heighth rst+	measurement (deconstruct . extract -> Both lst rst) = One ++		let (lm :*: rm) = measure @Heighth lst :*: measure @Heighth rst+		in lm <=> rm & order rm lm lm++instance Substructure Left (Construction Wye) a where 	type Substructural Left (Construction Wye) a = Maybe :. Construction Wye := a 	substructure empty_tree@(extract -> Construct _ End) = Store $ Nothing :*: (empty_tree !) 	substructure (extract -> Construct x (Left lst)) = Store $ Just lst :*: Tag . Construct x . resolve Left End 	substructure (extract -> Construct x (Right rst)) = Store $ Nothing :*: Tag . Construct x . resolve (Both % rst) (Right rst) 	substructure (extract -> Construct x (Both lst rst)) = Store $ Just lst :*: Tag . Construct x . resolve (Both % rst) (Right rst) -instance Substructure Right (Construction Wye) where+instance Substructure Right (Construction Wye) a where 	type Substructural Right (Construction Wye) a = Maybe :. Construction Wye := a 	substructure emtpy_tree@(extract -> Construct _ End) = Store $ Nothing :*: (emtpy_tree !) 	substructure (extract -> Construct x (Left lst)) = Store $ Nothing :*: Tag . Construct x . resolve (Both lst) (Left lst)
Pandora/Paradigm/Structure/Interface/Set.hs view
@@ -1,16 +1,16 @@ module Pandora.Paradigm.Structure.Interface.Set where -import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Traversable (Traversable ((->>))) import Pandora.Pattern.Object.Setoid (Setoid ((/=))) import Pandora.Pattern.Object.Semigroup ((+)) import Pandora.Pattern.Object.Quasiring (one)+import Pandora.Paradigm.Primary.Functor.Function ((!), (%)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Nothing)) import Pandora.Paradigm.Primary.Functor.Predicate (equate) import Pandora.Paradigm.Primary.Functor.Product (attached) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))-import Pandora.Paradigm.Primary.Object.Natural (Natural (Zero))+import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Zero)) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce), find) import Pandora.Paradigm.Inventory.State (State, modify) import Pandora.Paradigm.Controlflow.Effect (run)@@ -21,5 +21,5 @@ subset :: (Monotonic a (t a), Traversable t, Setoid a, Setoid (t a)) => t a -> t a -> Boolean subset ss s = Nothing /= (ss ->> find % s . equate) -cardinality :: Traversable t => t a -> Natural-cardinality s = attached . run @(State _) % Zero $ s ->> (!) (modify @Natural (+ one))+cardinality :: Traversable t => t a -> Numerator+cardinality s = attached . run @(State _) % Zero $ s ->> (!) (modify @Numerator (+ one))
Pandora/Paradigm/Structure/Rose.hs view
@@ -3,13 +3,13 @@ module Pandora.Paradigm.Structure.Rose where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant (comap)) import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Avoidable (Avoidable (empty)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))@@ -36,7 +36,7 @@ instance Nullable Rose where 	null = Predicate $ \case { TU Nothing -> True ; _ -> False } -instance Substructure Just Rose where+instance Substructure Just Rose a where 	type Substructural Just Rose a = Stack :. Construction Stack := a 	substructure (run . extract -> Nothing) = Store $ TU Nothing :*: (Tag (TU Nothing) !) 	substructure (run . extract -> Just (Construct x xs)) = Store $ xs :*: Tag . lift . Construct x@@ -47,6 +47,6 @@ 	type Focusing Root (Construction Stack) a = a 	focusing (Tag rose) = Store $ extract rose :*: Tag . Construct % deconstruct rose -instance Substructure Just (Construction Stack) where+instance Substructure Just (Construction Stack) a where 	type Substructural Just (Construction Stack) a = Stack :. Construction Stack := a 	substructure (extract -> Construct x xs) = Store $ xs :*: Tag . Construct x
Pandora/Paradigm/Structure/Splay.hs view
@@ -3,12 +3,12 @@ module Pandora.Paradigm.Structure.Splay where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category ((.), ($)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Bindable (Bindable ((>>=))) import Pandora.Paradigm.Primary.Functor (left, right, branches)+import Pandora.Paradigm.Primary.Functor.Function ((%)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just)) import Pandora.Paradigm.Primary.Functor.Wye (Wye (Left, Right)) import Pandora.Paradigm.Primary.Functor.Tagged (Tagged (Tag), type (:#))
Pandora/Paradigm/Structure/Stack.hs view
@@ -2,23 +2,25 @@  module Pandora.Paradigm.Structure.Stack where -import Pandora.Core.Functor (type (~>), type (:.), type (:=))-import Pandora.Core.Morphism ((&), (%))+import Pandora.Core.Functor (type (:.), type (:=), type (|->)) import Pandora.Pattern ((.|..))-import Pandora.Pattern.Category ((.), ($))+import Pandora.Pattern.Category ((.), ($), identity) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) import Pandora.Pattern.Functor.Alternative ((<+>)) import Pandora.Pattern.Functor.Pointable (point) import Pandora.Pattern.Functor.Extractable (extract) import Pandora.Pattern.Functor.Traversable (Traversable)-import Pandora.Pattern.Functor.Bindable ((>>=)) import Pandora.Pattern.Functor.Extendable (Extendable ((=>>)))+import Pandora.Pattern.Functor.Bindable (Bindable (join)) import Pandora.Pattern.Transformer.Liftable (lift) import Pandora.Pattern.Object.Setoid (Setoid ((==))) import Pandora.Pattern.Object.Semigroup (Semigroup ((+))) import Pandora.Pattern.Object.Monoid (Monoid (zero)) import Pandora.Paradigm.Primary.Object.Boolean (Boolean (True, False), (?))+import Pandora.Paradigm.Primary.Object.Numerator (Numerator (Numerator))+import Pandora.Paradigm.Primary.Object.Denumerator (Denumerator (One)) import Pandora.Paradigm.Primary.Functor.Delta (Delta ((:^:)))+import Pandora.Paradigm.Primary.Functor.Function ((!), (%), (&)) import Pandora.Paradigm.Primary.Functor.Maybe (Maybe (Just, Nothing)) import Pandora.Paradigm.Primary.Functor.Predicate (Predicate (Predicate)) import Pandora.Paradigm.Primary.Functor.Product (Product ((:*:)))@@ -28,16 +30,18 @@ import Pandora.Paradigm.Primary.Transformer.Tap (Tap (Tap)) import Pandora.Paradigm.Inventory.State (State, fold) import Pandora.Paradigm.Inventory.Store (Store (Store))-import Pandora.Paradigm.Inventory.Optics ((^.))-import Pandora.Paradigm.Controlflow.Effect.Interpreted (run)+import Pandora.Paradigm.Inventory.Optics (view, (^.))+import Pandora.Paradigm.Controlflow.Effect.Interpreted (run, unite) import Pandora.Paradigm.Schemes.TU (TU (TU), type (<:.>)) import Pandora.Paradigm.Structure.Ability.Nonempty (Nonempty) import Pandora.Paradigm.Structure.Ability.Nullable (Nullable (null)) import Pandora.Paradigm.Structure.Ability.Zipper (Zipper) import Pandora.Paradigm.Structure.Ability.Focusable (Focusable (Focusing, focusing), Location (Head), focus) import Pandora.Paradigm.Structure.Ability.Insertable (Insertable (insert))+import Pandora.Paradigm.Structure.Ability.Measurable (Measurable (Measural, measurement), Scale (Length), measure) import Pandora.Paradigm.Structure.Ability.Monotonic (Monotonic (reduce)) import Pandora.Paradigm.Structure.Ability.Rotatable (Rotatable (Rotational, rotation), rotate)+import Pandora.Paradigm.Structure.Ability.Substructure (Substructure (Substructural, substructure), Command (Delete), Segment (All, First, Tail), sub)  -- | Linear data structure that serves as a collection of elements type Stack = Maybe <:.> Construction Maybe@@ -55,24 +59,35 @@  instance Focusable Head Stack where 	type Focusing Head Stack a = Maybe a-	focusing (Tag stack) = Store $ extract <$> run stack :*: \case-		Just x -> stack & pop & insert x & Tag-		Nothing -> Tag $ pop stack+	focusing (extract -> stack) = Store $ extract <$> run stack :*: \case+		Just x -> stack & view (sub @Tail) & insert x & Tag+		Nothing -> Tag $ sub @Tail ^. stack  instance Insertable Stack where-	insert x (TU stack) = TU $ (Construct x . Just <$> stack) <+> (point . point) x+	insert x (run -> stack) = unite $ (Construct x . Just <$> stack) <+> (point . point) x +instance Measurable Length Stack where+	type Measural Length Stack a = Numerator+	measurement (run . extract -> Nothing) = zero+	measurement (run . extract -> Just xs) = Numerator $ measure @Length xs+ instance Nullable Stack where 	null = Predicate $ \case { TU Nothing -> True ; _ -> False } -pop :: Stack ~> Stack-pop (TU stack) = TU $ stack >>= deconstruct+instance Substructure Tail Stack a where+	type Substructural Tail Stack a = Stack a+	substructure (run . extract -> Just ns) = point . unite . Just <$> sub @Tail ns+	substructure (run . extract -> Nothing) = Store $ unite Nothing :*: point . identity -delete :: Setoid a => a -> Stack a -> Stack a-delete _ (TU Nothing) = TU Nothing-delete x (TU (Just (Construct y ys))) = x == y ? TU ys-	$ lift . Construct y . run . delete x $ TU ys+instance Setoid a => Substructure (Delete First) Stack a where+	type Substructural (Delete First) Stack a = a |-> Stack+	substructure (extract -> xs) = Store $ delete % xs :*: (point xs !) where +		delete :: Setoid a => a -> Stack a -> Stack a+		delete _ (TU Nothing) = TU Nothing+		delete x (TU (Just (Construct y ys))) = x == y ? TU ys+			$ lift . Construct y . run . delete x $ TU ys+ filter :: forall a . Predicate a -> Stack a -> Stack a filter (Predicate p) = TU . extract 	. run @(State (Maybe :. Nonempty Stack := a)) % Nothing@@ -86,14 +101,40 @@  instance Focusable Head (Construction Maybe) where 	type Focusing Head (Construction Maybe) a = a-	focusing (Tag stack) = Store $ extract stack :*: Tag . Construct % deconstruct stack+	focusing (extract -> stack) = Store $ extract stack :*: Tag . Construct % deconstruct stack  instance Insertable (Construction Maybe) where 	insert x = Construct x . Just +instance Measurable Length (Construction Maybe) where+	type Measural Length (Construction Maybe) a = Denumerator+	measurement (deconstruct . extract -> Nothing) = One+	measurement (deconstruct . extract -> Just xs) = One + measure @Length xs+ instance Monotonic a (Construction Maybe a) where 	reduce f r ~(Construct x xs) = f x $ reduce f r xs +instance Substructure Tail (Construction Maybe) a where+	type Substructural Tail (Construction Maybe) a = Stack a+	substructure (extract -> Construct x xs) = Store $ unite xs :*: point . Construct x . run++instance Setoid a => Substructure (Delete First) (Construction Maybe) a where+	type Substructural (Delete First) (Construction Maybe) a = a |-> Stack+	substructure (extract -> xs) = Store $ delete % xs :*: (point xs !) where++		delete :: Setoid a => a -> Nonempty Stack a -> Stack a+		delete x (Construct y ys) = x == y ? unite ys+			$ unite $ Construct y . run . delete x <$> ys++instance Setoid a => Substructure (Delete All) (Construction Maybe) a where+	type Substructural (Delete All) (Construction Maybe) a = a |-> Stack+	substructure (extract -> xs) = Store $ delete % xs :*: (point xs !) where++		delete :: Setoid a => a -> Nonempty Stack a -> Stack a+		delete x (Construct y ys) = x == y+			? (unite . join $ run . delete x <$> ys)+			$ (unite $ Construct y . run . delete x <$> ys)+ type instance Zipper Stack = Tap (Delta <:.> Stack)  instance {-# OVERLAPS #-} Extendable (Tap (Delta <:.> Stack)) where@@ -102,11 +143,11 @@  instance Rotatable Left (Tap (Delta <:.> Stack)) where 	type Rotational Left (Tap (Delta <:.> Stack)) a = Maybe :. Zipper Stack := a-	rotation (extract -> Tap x (TU (bs :^: fs))) = Tap % (TU $ pop bs :^: insert x fs) <$> focus @Head ^. bs+	rotation (extract -> Tap x (TU (bs :^: fs))) = Tap % (TU $ sub @Tail ^. bs :^: insert x fs) <$> focus @Head ^. bs  instance Rotatable Right (Tap (Delta <:.> Stack)) where 	type Rotational Right (Tap (Delta <:.> Stack)) a = Maybe :. Zipper Stack := a-	rotation (extract -> Tap x (TU (bs :^: fs))) = Tap % (TU $ insert x bs :^: pop fs) <$> focus @Head ^. fs+	rotation (extract -> Tap x (TU (bs :^: fs))) = Tap % (TU $ insert x bs :^: sub @Tail ^. fs) <$> focus @Head ^. fs  type instance Zipper (Construction Maybe) = Tap (Delta <:.> Construction Maybe) 
Pandora/Pattern/Functor/Adjoint.hs view
@@ -2,11 +2,11 @@  import Pandora.Core.Functor (type (:.), type (:=)) import Pandora.Pattern.Category (identity)-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Covariant (Covariant ((<$>), (<$$>), (<$$$>), (<$$$$>)))  type (-|) = Adjoint -infixl 3 -|, |-, -|$, $|-+infixl 3 -|, |-, -|$, $|-, $$|-, $$$|-, $$$$|-  {- | > When providing a new instance, you should ensure it satisfies the four laws:@@ -39,5 +39,15 @@ 	(-|$) :: Covariant v => v a -> (t a -> b) -> v (u b) 	x -|$ f = (-| f) <$> x +	-- | Versions of `|-` with various nesting levels 	($|-) :: Covariant v => v (t a) -> (a -> u b) -> v b 	x $|- f = (|- f) <$> x+	($$|-) :: (Covariant v, Covariant w) =>+		v :. w :. t := a -> (a -> u b) -> v :. w := b+	x $$|- f = (|- f) <$$> x+	($$$|-) :: (Covariant v, Covariant w, Covariant x) =>+		v :. w :. x :. t := a -> (a -> u b) -> v :. w :. x := b+	x $$$|- f = (|- f) <$$$> x+	($$$$|-) :: (Covariant v, Covariant w, Covariant x, Covariant y) =>+		v :. w :. x :. y :. t := a -> (a -> u b) -> v :. w :. x :. y := b+	x $$$$|- f = (|- f) <$$$$> x
Pandora/Pattern/Functor/Applicative.hs view
@@ -45,6 +45,3 @@ 		-> t :. u :. v :. w := a 		-> t :. u :. v :. w := b 	f <****> x = (<***>) <$> f <*> x--instance Applicative ((->) e) where-	(<*>) f g x = f x (g x)
Pandora/Pattern/Functor/Bindable.hs view
@@ -1,7 +1,6 @@ module Pandora.Pattern.Functor.Bindable where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category (identity) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) @@ -20,7 +19,7 @@  	-- | Flipped version of '>>=', the dual of '<<=' 	(=<<) :: (a -> t b) -> t a -> t b-	(=<<) = (%) (>>=)+	f =<< x = x >>= f 	-- | Prefix and flipped version of '>>=', the dual of 'extend' 	bind :: (a -> t b) -> t a -> t b 	bind f t = t >>= f@@ -32,13 +31,10 @@ 	f >=> g = \x -> f x >>= g 	-- | Right-to-left Kleisli composition 	(<=<) :: (b -> t c) -> (a -> t b) -> (a -> t c)-	(<=<) = (%) (>=>)+	g <=< f  = f >=> g  	($>>=) :: Covariant u => u :. t := a -> (a -> t b) -> u :. t := b 	x $>>= f = (>>= f) <$> x -	(<>>=) :: (t b -> c) -> (a -> t b) -> t a -> c-	f <>>= g = f <$> (>>= g)--instance Bindable ((->) e) where-	f >>= g = \x -> g (f x) x+	-- (<>>=) :: (t b -> c) -> (a -> t b) -> t a -> c+	-- f <>>= g = f <$> (>>= g)
Pandora/Pattern/Functor/Contravariant.hs view
@@ -1,7 +1,6 @@ module Pandora.Pattern.Functor.Contravariant where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((!), (%)) import Pandora.Pattern.Category ((.))  infixl 4 >$<, $<, >$@@ -22,10 +21,15 @@ 	contramap f x = f >$< x 	-- | Replace all locations in the output with the same value 	(>$) :: b -> t b -> t a-	(>$) = contramap . (!)+	(>$) = contramap . (\x _ -> x)+++	-- (a -> b)++	-- (!) :: a -> b -> a 	-- | Flipped version of '>$' 	($<) :: t b -> b -> t a-	($<) = (%) (>$)+	x $< v = v >$ x 	-- | Fill the input of evaluation 	full :: t () -> t a 	full x = () >$ x
Pandora/Pattern/Functor/Covariant.hs view
@@ -1,8 +1,7 @@ module Pandora.Pattern.Functor.Covariant where  import Pandora.Core.Functor (type (:.), type (:=), type (<-|))-import Pandora.Core.Morphism (fix, (!), (%))-import Pandora.Pattern.Category (Category ((.)))+import Pandora.Pattern.Category (Category ((.), ($)))  infixl 4 <$>, <$, $> infixl 3 <$$>@@ -30,16 +29,16 @@ 	comap f x = f <$> x 	-- | Replace all locations in the input with the same value 	(<$) :: a -> t b -> t a-	(<$) = comap . (!)+	(<$) = comap . (\x _ -> x) 	-- | Flipped version of '<$' 	($>) :: t a -> b -> t b-	($>) = (%) (<$)+	x $> v = v <$ x 	-- | Discards the result of evaluation 	void :: t a -> t () 	void x = () <$ x 	-- | Computing a value from a structure of values 	loeb :: t (a <-| t) -> t a-	loeb tt = fix (\f -> (\g -> g f) <$> tt)+	loeb tt = let fix f = let x = f x in x in fix (\f -> ($ f) <$> tt) 	-- | Flipped infix version of 'comap' 	(<&>) :: t a -> (a -> b) -> t b 	x <&> f = f <$> x@@ -63,6 +62,3 @@ 	(<&&&&>) :: (Covariant u, Covariant v, Covariant w) 		=> t :. u :. v :. w := a -> (a -> b) -> t :. u :. v :. w := b 	x <&&&&> f = f <$$$$> x--instance Covariant ((->) a) where-	(<$>) = (.)
Pandora/Pattern/Functor/Distributive.hs view
@@ -1,8 +1,7 @@ module Pandora.Pattern.Functor.Distributive where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((%))-import Pandora.Pattern.Functor.Covariant (Covariant ((<$>)))+import Pandora.Pattern.Functor.Covariant (Covariant) import Pandora.Pattern.Category (identity, (.))  {- |@@ -37,6 +36,3 @@ 	(>>>>>-) :: (Covariant u, Covariant v, Covariant w, Covariant j) 		=> u :. v :. w :. j := a -> (a -> t b) -> t :. u :. v :. w :. j := b 	x >>>>>- f = (collect . collect . collect . collect) f x--instance Distributive ((->) e) where-	g >>- f = \e -> (f % e) <$> g
+ Pandora/Pattern/Functor/Divisible.hs view
@@ -0,0 +1,11 @@+module Pandora.Pattern.Functor.Divisible where++import Pandora.Pattern.Functor.Contravariant (Contravariant)+import Pandora.Paradigm.Primary.Functor.Product (type (:*:))++infixr 5 >*<++class Contravariant t => Divisible t where+	{-# MINIMAL (>*<) #-}++	(>*<) :: t b -> t c -> t (b :*: c)
Pandora/Pattern/Functor/Extendable.hs view
@@ -1,7 +1,6 @@ module Pandora.Pattern.Functor.Extendable where  import Pandora.Core.Functor (type (:.), type (:=))-import Pandora.Core.Morphism ((%)) import Pandora.Pattern.Category (identity, (.)) import Pandora.Pattern.Functor.Covariant (Covariant ((<$>))) @@ -21,7 +20,7 @@  	-- | Flipped version of '>>=', the dual of '=<<' 	(<<=) :: (t a -> b) -> t a -> t b-	(<<=) = (%) (=>>)+	f <<= x = x =>> f 	-- | Prefix and flipped version of '=>>', the dual of 'bind' 	extend :: (t a -> b) -> t a -> t b 	extend f t = t =>> f
Pandora/Pattern/Functor/Extractable.hs view
@@ -2,11 +2,7 @@  import Pandora.Core.Functor (type (<-|)) import Pandora.Pattern.Functor.Covariant (Covariant)-import Pandora.Pattern.Object.Monoid (Monoid (zero))  class Covariant t => Extractable t where 	{-# MINIMAL extract #-} 	extract :: a <-| t--instance Monoid e => Extractable ((->) e) where-	extract f = f zero
Pandora/Pattern/Functor/Pointable.hs view
@@ -1,12 +1,8 @@ module Pandora.Pattern.Functor.Pointable where  import Pandora.Core.Functor (type (|->))-import Pandora.Core.Morphism ((!)) import Pandora.Pattern.Functor.Covariant (Covariant)  class Covariant t => Pointable t where 	{-# MINIMAL point #-} 	point :: a |-> t--instance Pointable ((->) e) where-	point = (!)
Pandora/Pattern/Functor/Representable.hs view
@@ -1,8 +1,6 @@ module Pandora.Pattern.Functor.Representable where  import Pandora.Core.Functor (type (<-|))-import Pandora.Core.Morphism ((%))-import Pandora.Pattern.Category (identity) import Pandora.Pattern.Functor.Pointable (Pointable)  {- |@@ -23,8 +21,3 @@ 	-- | Prefix and flipped version of '<#>' 	index :: t a -> Representation t -> a 	index x r = r <#> x--instance Representable ((->) e) where-	type Representation ((->) e) = e-	(<#>) = (identity %)-	tabulate = identity
Pandora/Pattern/Functor/Traversable.hs view
@@ -11,8 +11,8 @@ > Let p :: (Pointable t, Pointable g) => t a -> u a  > When providing a new instance, you should ensure it satisfies the four laws:-> * Naturality of traversing: g . traverse f ≡ traverse (g . f)-> * Naturality of sequencing: f . sequence = sequence . comap f+> * Numeratority of traversing: g . traverse f ≡ traverse (g . f)+> * Numeratority of sequencing: f . sequence = sequence . comap f > * Preserving point: p (point x) ≡ point x > * Preserving apply: f (x <*> y) ≡ f x <*> f y -}
pandora.cabal view
@@ -1,5 +1,5 @@ name:                pandora-version:             0.3.4+version:             0.3.5 synopsis:            A box of patterns and paradigms description:         Humble attempt to define a library for problem solving based on math abstractions. homepage:            https://github.com/iokasimov/pandora@@ -22,7 +22,6 @@     -- Axioms set     Pandora.Core     Pandora.Core.Functor-    Pandora.Core.Morphism      Pandora.Paradigm     -- Basic constructions@@ -30,8 +29,10 @@     Pandora.Paradigm.Primary.Object     Pandora.Paradigm.Primary.Object.Boolean     Pandora.Paradigm.Primary.Object.Ordering-    Pandora.Paradigm.Primary.Object.Natural+    Pandora.Paradigm.Primary.Object.Numerator+    Pandora.Paradigm.Primary.Object.Denumerator     Pandora.Paradigm.Primary.Functor+    Pandora.Paradigm.Primary.Functor.Function     Pandora.Paradigm.Primary.Functor.Conclusion     Pandora.Paradigm.Primary.Functor.Constant     Pandora.Paradigm.Primary.Functor.Delta@@ -101,8 +102,10 @@     Pandora.Paradigm.Structure.Rose     Pandora.Paradigm.Structure.Ability     Pandora.Paradigm.Structure.Ability.Comprehension+    Pandora.Paradigm.Structure.Ability.Convertible     Pandora.Paradigm.Structure.Ability.Focusable     Pandora.Paradigm.Structure.Ability.Insertable+    Pandora.Paradigm.Structure.Ability.Measurable     Pandora.Paradigm.Structure.Ability.Rotatable     Pandora.Paradigm.Structure.Ability.Substructure     Pandora.Paradigm.Structure.Ability.Nonempty@@ -127,6 +130,7 @@     Pandora.Pattern.Functor.Determinable     Pandora.Pattern.Functor.Distributive     Pandora.Pattern.Functor.Avoidable+    Pandora.Pattern.Functor.Divisible     Pandora.Pattern.Functor.Extendable     Pandora.Pattern.Functor.Extractable     Pandora.Pattern.Functor.Invariant