| Copyright | (c) Huw Campbell 2016-2017 |
|---|---|
| License | BSD2 |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell98 |
Grenade.Core.Shape
Description
- data Shape
- data S n where
- data family Sing k (a :: k) :: *
- randomOfShape :: forall x m. (MonadRandom m, SingI x) => m (S x)
- fromStorable :: forall x. SingI x => Vector Double -> Maybe (S x)
Documentation
The current shapes we accept. at the moment this is just one, two, and three dimensional Vectors/Matricies.
These are only used with DataKinds, as Kind Shape, with Types 'D1, 'D2, 'D3.
Constructors
| D1 Nat | One dimensional vector |
| D2 Nat Nat | Two dimensional matrix. Row, Column. |
| D3 Nat Nat Nat | Three dimensional matrix. Row, Column, Channels. |
Instances
Concrete data structures for a Shape.
All shapes are held in contiguous memory. 3D is held in a matrix (usually row oriented) which has height depth * rows.
data family Sing k (a :: k) :: * #
The singleton kind-indexed data family.
Instances
| data Sing Bool | |
| data Sing Ordering | |
| data Sing Nat | |
| data Sing Symbol | |
| data Sing () | |
| data Sing Shape # | |
| data Sing [a0] | |
| data Sing (Maybe a0) | |
| data Sing (NonEmpty a0) | |
| data Sing (Either a0 b0) | |
| data Sing (a0, b0) | |
| data Sing ((~>) k1 k2) | |
| data Sing (a0, b0, c0) | |
| data Sing (a0, b0, c0, d0) | |
| data Sing (a0, b0, c0, d0, e0) | |
| data Sing (a0, b0, c0, d0, e0, f0) | |
| data Sing (a0, b0, c0, d0, e0, f0, g0) | |
randomOfShape :: forall x m. (MonadRandom m, SingI x) => m (S x) Source #
Generate random data of the desired shape