Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class NatKind k => Vec v where
- class Nesting w c v where
- class Nesting1 w c v where
- nesting1Every :: forall p w c v as. Nesting1 w c v => p v -> Prod w as -> Wit (Every c (v <$> as))
- data Nested :: (k -> Type -> Type) -> [k] -> Type -> Type
- genNested :: Vec (v :: k -> Type -> Type) => Sing ns -> (Prod (IndexN k) ns -> a) -> Nested v ns a
- genNestedA :: (Vec (v :: k -> Type -> Type), Applicative f) => Sing ns -> (Prod (IndexN k) ns -> f a) -> f (Nested v ns a)
- indexNested :: Vec (v :: k -> Type -> Type) => Prod (IndexN k) ns -> Nested v ns a -> a
- indexNested' :: Vec (v :: k -> Type -> Type) => Prod (IndexN k) ms -> Nested v (ms ++ ns) a -> Nested v ns a
- transpose :: forall v os a. (Nesting1 Proxy Functor v, Nesting1 Proxy Foldable v, Nesting1 Proxy Traversable v, Nesting1 Sing Distributive v) => Sing os -> Nested v os a -> Nested v (Reverse os) a
- transpose' :: Vec v => Length os -> Sing (Reverse os) -> Nested v os a -> Nested v (Reverse os) a
- gmul' :: forall ms os ns v a. (Nesting1 Proxy Functor v, Nesting1 Sing Applicative v, SingI ns, Num a, Vec v) => Length ms -> Length os -> Length ns -> Nested v (ms ++ os) a -> Nested v (Reverse os ++ ns) a -> Nested v (ms ++ ns) a
- diagNV :: (Vec v, Nesting1 Proxy Functor v) => Sing n -> Uniform n ms -> Nested v (n ': (n ': ms)) a -> Nested v '[n] a
- joinNested :: forall v ns ms a. Nesting1 Proxy Functor v => Nested v ns (Nested v ms a) -> Nested v (ns ++ ms) a
- mapNVecSlices :: forall v ns ms a b. Nesting1 Proxy Functor v => (Nested v ms a -> b) -> Length ns -> Nested v (ns ++ ms) a -> Nested v ns b
- nIxRows :: forall k v ns ms a b f. (Nesting1 Proxy Functor v, Applicative f, Vec v) => Length ns -> (Prod (IndexN k) ns -> Nested v ms a -> f b) -> Nested v (ns ++ ms) a -> f (Nested v ns b)
- vGen :: Vec (v :: k -> Type -> Type) => Sing j -> (IndexN k j -> a) -> v j a
- vIFoldMap :: (Monoid m, Vec v) => (IndexN k j -> a -> m) -> v j a -> m
- itraverseNested :: forall k v ns a b f. (Applicative f, Vec v) => (Prod (IndexN k) ns -> a -> f b) -> Nested v ns a -> f (Nested v ns b)
- liftNested :: Distributive (Nested v ns) => (Vec n a -> a) -> Vec n (Nested v ns a) -> Nested v ns a
- unScalar :: Nested v '[] a -> a
- unNest :: Nested v (j ': js) a -> v j (Nested v js a)
- unVector :: Functor (v j) => Nested v '[j] a -> v j a
- sumRowsNested :: forall v n ns a. (Foldable (v n), Num a, SingI ns, Nesting1 Proxy Functor v, Nesting1 Sing Applicative v) => Nested v (n ': ns) a -> Nested v ns a
Documentation
class NatKind k => Vec v where Source #
vHead :: p j -> v (Succ j) a -> a Source #
vTail :: v (Succ j) a -> v j a Source #
vGenA :: Applicative f => Sing j -> (IndexN k j -> f a) -> f (v j a) Source #
vIndex :: IndexN k j -> v j a -> a Source #
vUncons :: Sing j -> v j a -> Uncons v j a Source #
vEmpty :: v (FromNat 0) a Source #
vCons :: a -> v j a -> v (Succ j) a Source #
vITraverse :: Applicative f => (IndexN k j -> a -> f b) -> v j a -> f (v j b) Source #
nesting1Every :: forall p w c v as. Nesting1 w c v => p v -> Prod w as -> Wit (Every c (v <$> as)) Source #
data Nested :: (k -> Type -> Type) -> [k] -> Type -> Type Source #
Nesting1 (* -> *) k (Proxy k) Functor v => Functor (Nested k v js) Source # | |
(SingI [k] js, Nesting1 (* -> *) k (Sing k) Applicative v, Nesting1 (* -> *) k (Proxy k) Functor v) => Applicative (Nested k v js) Source # | |
Nesting1 (* -> *) k (Proxy k) Foldable v => Foldable (Nested k v js) Source # | |
(Nesting1 (* -> *) k (Proxy k) Functor v, Nesting1 (* -> *) k (Proxy k) Foldable v, Nesting1 (* -> *) k (Proxy k) Traversable v) => Traversable (Nested k v js) Source # | |
(Vec k v, SingI [k] js, Nesting1 (* -> *) k (Proxy k) Functor v) => Distributive (Nested k v js) Source # | |
(Num a, Applicative (Nested k v js)) => Num (Nested k v js a) Source # | |
(NFData a, Nesting * k (Proxy k) NFData v) => NFData (Nested k v js a) Source # | |
genNested :: Vec (v :: k -> Type -> Type) => Sing ns -> (Prod (IndexN k) ns -> a) -> Nested v ns a Source #
genNestedA :: (Vec (v :: k -> Type -> Type), Applicative f) => Sing ns -> (Prod (IndexN k) ns -> f a) -> f (Nested v ns a) Source #
indexNested' :: Vec (v :: k -> Type -> Type) => Prod (IndexN k) ms -> Nested v (ms ++ ns) a -> Nested v ns a Source #
transpose :: forall v os a. (Nesting1 Proxy Functor v, Nesting1 Proxy Foldable v, Nesting1 Proxy Traversable v, Nesting1 Sing Distributive v) => Sing os -> Nested v os a -> Nested v (Reverse os) a Source #
Transpose by iteratively sequencing/distributing layers
transpose' :: Vec v => Length os -> Sing (Reverse os) -> Nested v os a -> Nested v (Reverse os) a Source #
Transpose by populating a new Nested
from scratch
gmul' :: forall ms os ns v a. (Nesting1 Proxy Functor v, Nesting1 Sing Applicative v, SingI ns, Num a, Vec v) => Length ms -> Length os -> Length ns -> Nested v (ms ++ os) a -> Nested v (Reverse os ++ ns) a -> Nested v (ms ++ ns) a Source #
diagNV :: (Vec v, Nesting1 Proxy Functor v) => Sing n -> Uniform n ms -> Nested v (n ': (n ': ms)) a -> Nested v '[n] a Source #
joinNested :: forall v ns ms a. Nesting1 Proxy Functor v => Nested v ns (Nested v ms a) -> Nested v (ns ++ ms) a Source #
mapNVecSlices :: forall v ns ms a b. Nesting1 Proxy Functor v => (Nested v ms a -> b) -> Length ns -> Nested v (ns ++ ms) a -> Nested v ns b Source #
nIxRows :: forall k v ns ms a b f. (Nesting1 Proxy Functor v, Applicative f, Vec v) => Length ns -> (Prod (IndexN k) ns -> Nested v ms a -> f b) -> Nested v (ns ++ ms) a -> f (Nested v ns b) Source #
itraverseNested :: forall k v ns a b f. (Applicative f, Vec v) => (Prod (IndexN k) ns -> a -> f b) -> Nested v ns a -> f (Nested v ns b) Source #
liftNested :: Distributive (Nested v ns) => (Vec n a -> a) -> Vec n (Nested v ns a) -> Nested v ns a Source #