Safe Haskell | None |
---|---|
Language | Haskell2010 |
Higher-kinded numbers that can be represented with an [Int] index into elements.
Synopsis
- module NumHask.Array.Shape
- module NumHask.Array.Fixed
Shapes
Using [Int
] as the index for an array nicely represents the practical interests and constraints downstream of this high-level API: densely-packed numbers (reals or integrals), indexed and layered.
module NumHask.Array.Shape
Numbers with a fixed shape
A design principle of modern haskell (synonymous with ghc usage) is to push computation into compilation. Representable
is an iconic example. Shape
must ultimately be known at compile-time, but if it is, we can dispense with a large classes of runtime check which slow pipelines. This tends to create computation where shape is abstracted and we fold algorithms in and out of structures.
module NumHask.Array.Fixed
Numbers with a dynamic shape
| In many situations, where shape is being tracked or otherwise only known at runtime, a clear module arrangement is:
>>>
import NumHask.Array.Shape
>>>
import qualified NumHask.Array.Fixed as F
>>>
import qualified NumHask.Array.Dynamic as D
HMatrix API
| hmatrix remains the speed king within haskell, and numhask-array is no exception. If speed matters then:
>>>
import NumHask.Array.Shape
>>>
import qualified NumHask.Array.HMatrix as H
will deliver the NumHask API over a HMatrix representation, and then the current fastest way to multiply matices in boiler-plate haskell.
FIXME: fill out Fixed API