Safe Haskell | None |
---|---|
Language | Haskell2010 |
Mapping of basic Matlab types to Haskell types.
- type MIO a = IO a
- data MXClass
- type MChar = Char
- type MLogical = Bool
- class MScalar a
- class (MScalar a, Num a) => MNumeric a
- type MDouble = Double
- type MSingle = Float
- type MInt8 = Int8
- type MInt16 = Int16
- type MInt32 = Int32
- type MInt64 = Int64
- type MUint8 = Word8
- type MUint16 = Word16
- type MUint32 = Word32
- type MUint64 = Word64
- type MComplex = Complex
- type MSize = [Int]
- type MSubs = [Int]
- newtype MIndex = MSubs MSubs
- mStart :: MIndex
- mOffset :: Int -> MIndex
- mSizeRange :: MSize -> (MIndex, MIndex)
- mRangeSize :: (MIndex, MIndex) -> MSize
- normMSize :: MSize -> MSize
- realMSize :: MSize -> MSize
- data MXArray a
- type MAnyArray = MXArray MAny
- newtype MCell = MCell {}
- data MStruct
- type MFun = [MAnyArray] -> Int -> IO [MAnyArray]
Representations of Matlab types
Most types are simple aliases of Haskell types, given simply to identify them and provide a consistent naming scheme.
The class of types which are simple Matlab scalars and can be array elements
Numeric types
Array indexing
The type of array sizes, which are the column-major lengths of each dimensions
The type of array index subscripts, which are the column-major, 0-based indices in each dimension with normal Matlab semantics (flatten along last dimension)
Ways to index an array. Using Matlab semantics, a singleton MSubs [n] is equivalent to a raw 0-based offset (MOffset n).
mSizeRange :: MSize -> (MIndex, MIndex) Source
Convert an array size to an index range, which will be of the form ((0,0,0...),(i-1,j-1,k-1,...))
mRangeSize :: (MIndex, MIndex) -> MSize Source
Convert an index range to an array size
Opaque types
type MAnyArray = MXArray MAny Source
A generic, untyped (void) array, which must be cast (using castMXArray
)
A wrapper for a member of a cell array, which itself simply any other array
A single struct in an array, represented by an (ordered) list of key-value pairs