Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
data Vec (a :: Nat) b where Source Comments #
Instances
Applicative (Vec n) => Applicative (Vec ('S n)) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat pure :: a -> Vec ('S n) a Comments # (<*>) :: Vec ('S n) (a -> b) -> Vec ('S n) a -> Vec ('S n) b Comments # liftA2 :: (a -> b -> c) -> Vec ('S n) a -> Vec ('S n) b -> Vec ('S n) c Comments # (*>) :: Vec ('S n) a -> Vec ('S n) b -> Vec ('S n) b Comments # (<*) :: Vec ('S n) a -> Vec ('S n) b -> Vec ('S n) a Comments # | |
Applicative (Vec 'Z) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat | |
Functor (Vec n) Source Comments # | |
Foldable (Vec n) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat fold :: Monoid m => Vec n m -> m Comments # foldMap :: Monoid m => (a -> m) -> Vec n a -> m Comments # foldMap' :: Monoid m => (a -> m) -> Vec n a -> m Comments # foldr :: (a -> b -> b) -> b -> Vec n a -> b Comments # foldr' :: (a -> b -> b) -> b -> Vec n a -> b Comments # foldl :: (b -> a -> b) -> b -> Vec n a -> b Comments # foldl' :: (b -> a -> b) -> b -> Vec n a -> b Comments # foldr1 :: (a -> a -> a) -> Vec n a -> a Comments # foldl1 :: (a -> a -> a) -> Vec n a -> a Comments # toList :: Vec n a -> [a] Comments # null :: Vec n a -> Bool Comments # length :: Vec n a -> Int Comments # elem :: Eq a => a -> Vec n a -> Bool Comments # maximum :: Ord a => Vec n a -> a Comments # minimum :: Ord a => Vec n a -> a Comments # | |
Traversable (Vec n) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat |
Instances
Num a => Monoidal (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat leftUnitor :: forall (a0 :: MatK a). Ob a0 => ((Unit :: MatK a) ** a0) ~> a0 Source Comments # leftUnitorInv :: forall (a0 :: MatK a). Ob a0 => a0 ~> ((Unit :: MatK a) ** a0) Source Comments # rightUnitor :: forall (a0 :: MatK a). Ob a0 => (a0 ** (Unit :: MatK a)) ~> a0 Source Comments # rightUnitorInv :: forall (a0 :: MatK a). Ob a0 => a0 ~> (a0 ** (Unit :: MatK a)) Source Comments # associator :: forall (a0 :: MatK a) (b :: MatK a) (c :: MatK a). (Ob a0, Ob b, Ob c) => ((a0 ** b) ** c) ~> (a0 ** (b ** c)) Source Comments # associatorInv :: forall (a0 :: MatK a) (b :: MatK a) (c :: MatK a). (Ob a0, Ob b, Ob c) => (a0 ** (b ** c)) ~> ((a0 ** b) ** c) Source Comments # | |||||
Num a => SymMonoidal (MatK a) Source Comments # | |||||
Num a => CategoryOf (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat | |||||
Num a => HasBinaryCoproducts (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat lft :: forall (a0 :: MatK a) (b :: MatK a). (Ob a0, Ob b) => a0 ~> (a0 || b) Source Comments # lft' :: forall (a0 :: MatK a) (a' :: MatK a) (b :: MatK a). (a0 ~> a') -> Obj b -> a0 ~> (a' || b) Source Comments # rgt :: forall (a0 :: MatK a) (b :: MatK a). (Ob a0, Ob b) => b ~> (a0 || b) Source Comments # rgt' :: forall (a0 :: MatK a) (b :: MatK a) (b' :: MatK a). Obj a0 -> (b ~> b') -> b ~> (a0 || b') Source Comments # (|||) :: forall (x :: MatK a) (a0 :: MatK a) (y :: MatK a). (x ~> a0) -> (y ~> a0) -> (x || y) ~> a0 Source Comments # (+++) :: forall (a0 :: MatK a) (b :: MatK a) (x :: MatK a) (y :: MatK a). (a0 ~> x) -> (b ~> y) -> (a0 || b) ~> (x || y) Source Comments # | |||||
Num a => HasBinaryProducts (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat fst :: forall (a0 :: MatK a) (b :: MatK a). (Ob a0, Ob b) => (a0 && b) ~> a0 Source Comments # fst' :: forall (a0 :: MatK a) (a' :: MatK a) (b :: MatK a). (a0 ~> a') -> Obj b -> (a0 && b) ~> a' Source Comments # snd :: forall (a0 :: MatK a) (b :: MatK a). (Ob a0, Ob b) => (a0 && b) ~> b Source Comments # snd' :: forall (a0 :: MatK a) (b :: MatK a) (b' :: MatK a). Obj a0 -> (b ~> b') -> (a0 && b) ~> b' Source Comments # (&&&) :: forall (a0 :: MatK a) (x :: MatK a) (y :: MatK a). (a0 ~> x) -> (a0 ~> y) -> a0 ~> (x && y) Source Comments # (***) :: forall (a0 :: MatK a) (b :: MatK a) (x :: MatK a) (y :: MatK a). (a0 ~> x) -> (b ~> y) -> (a0 && b) ~> (x && y) Source Comments # | |||||
Num a => CompactClosed (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat | |||||
Num a => StarAutonomous (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat | |||||
Num a => Closed (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat curry' :: forall (a0 :: MatK a) (b :: MatK a) (c :: MatK a). Obj a0 -> Obj b -> ((a0 ** b) ~> c) -> a0 ~> (b ~~> c) Source Comments # uncurry' :: forall (b :: MatK a) (c :: MatK a) (a0 :: MatK a). Obj b -> Obj c -> (a0 ~> (b ~~> c)) -> (a0 ** b) ~> c Source Comments # (^^^) :: forall (b :: MatK a) (y :: MatK a) (x :: MatK a) (a0 :: MatK a). (b ~> y) -> (x ~> a0) -> (a0 ~~> b) ~> (x ~~> y) Source Comments # | |||||
Num a => HasInitialObject (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat
| |||||
Num a => HasTerminalObject (MatK a) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat
| |||||
RealFloat a => DaggerProfunctor (Mat :: MatK (Complex a) -> MatK (Complex a) -> Type) Source Comments # | |||||
Num a => DaggerProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |||||
Num a => TracedMonoidalProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat trace :: forall (u :: MatK a) (x :: MatK a) (y :: MatK a). (Ob x, Ob y, Ob u) => Mat (x ** u) (y ** u) -> Mat x y Source Comments # trace' :: forall (x :: MatK a) (x' :: MatK a) (y :: MatK a) (y' :: MatK a) (u :: MatK a) (u' :: MatK a). (x ~> x') -> (y ~> y') -> (u ~> u') -> Mat (x' ** u') (y ** u) -> Mat x y' Source Comments # | |||||
Num a => Promonad (Mat :: MatK a -> MatK a -> Type) Source Comments # | |||||
Num a => MonoidalProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |||||
Num a => Profunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |||||
type UN ('M :: Nat -> MatK a) ('M n :: MatK a) Source Comments # | |||||
type Unit Source Comments # | |||||
type (~>) Source Comments # | |||||
type Bottom Source Comments # | |||||
type InitialObject Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat | |||||
type TerminalObject Source Comments # | |||||
Defined in Proarrow.Category.Instance.Mat | |||||
type Ob (n :: MatK a) Source Comments # | |||||
type ('M x :: MatK a) ** ('M y :: MatK a) Source Comments # | |||||
type ('M x :: MatK a) || ('M y :: MatK a) Source Comments # | |||||
type ('M x :: MatK a) && ('M y :: MatK a) Source Comments # | |||||
type ('M x :: MatK a) ~~> ('M y :: MatK a) Source Comments # | |||||
data Mat (b :: MatK a) (c :: MatK a) where Source Comments #
Mat :: forall {a} {b :: MatK a} {c :: MatK a} (m :: Nat) (n :: Nat). (Ob b, Ob c, b ~ ('M m :: MatK a), c ~ ('M n :: MatK a)) => Vec n (Vec m a) -> Mat b c |
Instances
RealFloat a => DaggerProfunctor (Mat :: MatK (Complex a) -> MatK (Complex a) -> Type) Source Comments # | |
Num a => DaggerProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |
Num a => TracedMonoidalProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat trace :: forall (u :: MatK a) (x :: MatK a) (y :: MatK a). (Ob x, Ob y, Ob u) => Mat (x ** u) (y ** u) -> Mat x y Source Comments # trace' :: forall (x :: MatK a) (x' :: MatK a) (y :: MatK a) (y' :: MatK a) (u :: MatK a) (u' :: MatK a). (x ~> x') -> (y ~> y') -> (u ~> u') -> Mat (x' ** u') (y ** u) -> Mat x y' Source Comments # | |
Num a => Promonad (Mat :: MatK a -> MatK a -> Type) Source Comments # | |
Num a => MonoidalProfunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |
Num a => Profunctor (Mat :: MatK a -> MatK a -> Type) Source Comments # | |
apply :: forall a (m :: Nat) (n :: Nat). (Num a, Applicative (Vec m)) => Vec n (Vec m a) -> Vec m a -> Vec n a Source Comments #
class (Applicative (Vec n), (n + 'Z) ~ n, (n * 'Z) ~ 'Z, (n * 'S 'Z) ~ n) => IsNat (n :: Nat) where Source Comments #
matId :: Num a => Vec n (Vec n a) Source Comments #
zero :: Num a => Vec n a Source Comments #
append :: forall a (m :: Nat). Vec n a -> Vec m a -> Vec (n + m) a Source Comments #
split :: forall (m :: Nat) a. Vec (n + m) a -> (Vec n a, Vec m a) Source Comments #
concatMap :: forall (m :: Nat) a b. IsNat m => (a -> Vec m b) -> Vec n a -> Vec (n * m) b Source Comments #
unConcatMap :: forall (m :: Nat) b a. IsNat m => (Vec m b -> a) -> Vec (n * m) b -> Vec n a Source Comments #
withPlusNat :: forall (m :: Nat) r. IsNat m => (IsNat (n + m) => r) -> r Source Comments #
withMultNat :: forall (m :: Nat) r. IsNat m => (IsNat (n * m) => r) -> r Source Comments #
withPlusSucc :: forall (m :: Nat) r. IsNat m => ((n + 'S m) ~ 'S (n + m) => r) -> r Source Comments #
withMultSucc :: forall (m :: Nat) r. IsNat m => ((n * 'S m) ~ (n + (n * m)) => r) -> r Source Comments #
withPlusSym :: forall (m :: Nat) r. IsNat m => ((n + m) ~ (m + n) => r) -> r Source Comments #
withMultSym :: forall (m :: Nat) r. IsNat m => ((n * m) ~ (m * n) => r) -> r Source Comments #
withAssocPlus :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => (((n + m) + o) ~ (n + (m + o)) => r) -> r Source Comments #
withAssocMult :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => (((n * m) * o) ~ (n * (m * o)) => r) -> r Source Comments #
withDist :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => (((n + m) * o) ~ ((n * o) + (m * o)) => r) -> r Source Comments #
Instances
IsNat 'Z Source Comments # | |
Defined in Proarrow.Category.Instance.Mat matId :: Num a => Vec 'Z (Vec 'Z a) Source Comments # zero :: Num a => Vec 'Z a Source Comments # append :: forall a (m :: Nat). Vec 'Z a -> Vec m a -> Vec ('Z + m) a Source Comments # split :: forall (m :: Nat) a. Vec ('Z + m) a -> (Vec 'Z a, Vec m a) Source Comments # concatMap :: forall (m :: Nat) a b. IsNat m => (a -> Vec m b) -> Vec 'Z a -> Vec ('Z * m) b Source Comments # unConcatMap :: forall (m :: Nat) b a. IsNat m => (Vec m b -> a) -> Vec ('Z * m) b -> Vec 'Z a Source Comments # withPlusNat :: forall (m :: Nat) r. IsNat m => (IsNat ('Z + m) => r) -> r Source Comments # withMultNat :: forall (m :: Nat) r. IsNat m => (IsNat ('Z * m) => r) -> r Source Comments # withPlusSucc :: forall (m :: Nat) r. IsNat m => (('Z + 'S m) ~ 'S ('Z + m) => r) -> r Source Comments # withMultSucc :: forall (m :: Nat) r. IsNat m => (('Z * 'S m) ~ ('Z + ('Z * m)) => r) -> r Source Comments # withPlusSym :: forall (m :: Nat) r. IsNat m => (('Z + m) ~ (m + 'Z) => r) -> r Source Comments # withMultSym :: forall (m :: Nat) r. IsNat m => (('Z * m) ~ (m * 'Z) => r) -> r Source Comments # withAssocPlus :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('Z + m) + o) ~ ('Z + (m + o)) => r) -> r Source Comments # withAssocMult :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('Z * m) * o) ~ ('Z * (m * o)) => r) -> r Source Comments # withDist :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('Z + m) * o) ~ (('Z * o) + (m * o)) => r) -> r Source Comments # | |
IsNat n => IsNat ('S n) Source Comments # | |
Defined in Proarrow.Category.Instance.Mat matId :: Num a => Vec ('S n) (Vec ('S n) a) Source Comments # zero :: Num a => Vec ('S n) a Source Comments # append :: forall a (m :: Nat). Vec ('S n) a -> Vec m a -> Vec ('S n + m) a Source Comments # split :: forall (m :: Nat) a. Vec ('S n + m) a -> (Vec ('S n) a, Vec m a) Source Comments # concatMap :: forall (m :: Nat) a b. IsNat m => (a -> Vec m b) -> Vec ('S n) a -> Vec ('S n * m) b Source Comments # unConcatMap :: forall (m :: Nat) b a. IsNat m => (Vec m b -> a) -> Vec ('S n * m) b -> Vec ('S n) a Source Comments # withPlusNat :: forall (m :: Nat) r. IsNat m => (IsNat ('S n + m) => r) -> r Source Comments # withMultNat :: forall (m :: Nat) r. IsNat m => (IsNat ('S n * m) => r) -> r Source Comments # withPlusSucc :: forall (m :: Nat) r. IsNat m => (('S n + 'S m) ~ 'S ('S n + m) => r) -> r Source Comments # withMultSucc :: forall (m :: Nat) r. IsNat m => (('S n * 'S m) ~ ('S n + ('S n * m)) => r) -> r Source Comments # withPlusSym :: forall (m :: Nat) r. IsNat m => (('S n + m) ~ (m + 'S n) => r) -> r Source Comments # withMultSym :: forall (m :: Nat) r. IsNat m => (('S n * m) ~ (m * 'S n) => r) -> r Source Comments # withAssocPlus :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('S n + m) + o) ~ ('S n + (m + o)) => r) -> r Source Comments # withAssocMult :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('S n * m) * o) ~ ('S n * (m * o)) => r) -> r Source Comments # withDist :: forall (m :: Nat) (o :: Nat) r. (IsNat m, IsNat o) => ((('S n + m) * o) ~ (('S n * o) + (m * o)) => r) -> r Source Comments # |