Re: [Haskell-cafe] NFData instance for Numeric.LinearAlgebra Matrix

2011-03-27 Thread Alberto Ruiz
Hello Tad, It can be defined in terms of rwhnf, Matrix is strict: ghci> rwhnf $ [1,2,3,undefined::Double] () ghci> rwhnf $ (2><2) [1,2,3,undefined::Double] *** Exception: Prelude.undefined instance NFData (Matrix t) where rnf = rwhnf ms = [ident 3, (2><2) [1,2,3,undefined::Double]] ghci

[Haskell-cafe] NFData instance for Numeric.LinearAlgebra Matrix

2011-03-26 Thread Tad Doxsee
Hello, Is there already an instance of NFData (from Control.DeepSeq in the deepseq package) for the type Matrix (from Numeric.LinearAlgebra in the hmatrix package) somewhere? If not, how does one define one? (The data declaration for Matrix is in a hidden module, Data.Packed.Internal.Matrix, if t