numhask-0.0.1: A numeric prelude

Safe HaskellSafe
LanguageHaskell2010

NumHask.HasShape

Description

multi-dimensional numbers with a shape

Synopsis

Documentation

class HasShape f where Source #

Could possibly be integrated with Representable instance creation

Minimal complete definition

shape, ndim

Associated Types

type Shape f Source #

Methods

shape :: HasShape f => f -> Shape f Source #

ndim :: HasShape f => f -> Int Source #

Instances

HasShape (SomeTensor a) Source # 

Associated Types

type Shape (SomeTensor a) :: * Source #

HasShape (SomeVector a) Source # 

Associated Types

type Shape (SomeVector a) :: * Source #

HasShape (SomeMatrix a) Source # 

Associated Types

type Shape (SomeMatrix a) :: * Source #

KnownNat r => HasShape (Vector r a) Source # 

Associated Types

type Shape (Vector r a) :: * Source #

Methods

shape :: Vector r a -> Shape (Vector r a) Source #

ndim :: Vector r a -> Int Source #

SingI [Nat] r => HasShape (Tensor [Nat] r a) Source # 

Associated Types

type Shape (Tensor [Nat] r a) :: * Source #

Methods

shape :: Tensor [Nat] r a -> Shape (Tensor [Nat] r a) Source #

ndim :: Tensor [Nat] r a -> Int Source #

(KnownNat m, KnownNat n) => HasShape (Matrix Nat Nat m n a) Source # 

Associated Types

type Shape (Matrix Nat Nat m n a) :: * Source #

Methods

shape :: Matrix Nat Nat m n a -> Shape (Matrix Nat Nat m n a) Source #

ndim :: Matrix Nat Nat m n a -> Int Source #