0

This is my package.yaml:

   dependencies:
      - base >= 4.7 && < 5
      - hmatrix
      - vector

my imports:

import Prelude hiding ( (<>) )

import Numeric.LinearAlgebra
import **Data.Packed.Matrix**
import qualified Data.Vector as V

I would like to import Data.Packed.Matrix to use the @@> accessor, GHC is complaining: Could not find module `Data.Packed.Matrix'

I googled with no success, probably I must be doing a stupid error. Data.Packed.Matrix is referred in the hmatrix package a simple import should be enough.

user3680029
  • 179
  • 8
  • 4
    Browsing through the versions and the changelog at http://hackage.haskell.org/package/hmatrix it looks like the `Data.Packed.*` modules were removed in 0.17 (having been kept only for backwards compatibility for a few versions before that). Looks like you'll have to use an earlier version, or find another way of doing what you want. (I'm not familiar with the package so can't help with that.) – Robin Zigmond Oct 08 '19 at 07:02
  • I didn't noticed that, ok that's explaining why. I will search for another package if I fail to access matrix position. – user3680029 Oct 08 '19 at 07:55
  • That shouldn't be necessary – I'm sure you _can_ get the functionality with newer hmatrix versions as well. That said, do search for other packages as well. I'm not a fan on hmatrix, it is rather un-Haskellish, more like Matlab or R as a library. If you don't need linear algebra but just matrices as 2d arrays, [repa](http://hackage.haskell.org/package/repa) should do. If you want “classical matrix LA”, [lapack](http://hackage.haskell.org/package/lapack) might be a better choice. ... – leftaroundabout Oct 08 '19 at 10:45
  • 1
    ... And if you want to delve into _really_ Haskell-ish approaches, note that it can be a good idea to get rid of the standard plain-matrix view entirely. The [linear](http://hackage.haskell.org/package/linear) package deals with free vector spaces as representable functors. The [vector-space](http://hackage.haskell.org/package/vector-space) and [linearmap-category](http://hackage.haskell.org/package/linearmap-category) abandon the idea of freeness / finite basis entirely, and do abstract functional analysis. – leftaroundabout Oct 08 '19 at 10:45
  • Ok. Thx. My idea is to play a little bit with neural network with haskell biuld some intuition around them at a rather low level but not to much. – user3680029 Oct 08 '19 at 10:50
  • Then you could of course also look into something ready-built like [grenade](http://hackage.haskell.org/package/grenade) (based on hmatrix) – either as a library or as a reference. – leftaroundabout Oct 08 '19 at 11:14
  • Just to through it out there, another option for a high performance array library is [massiv](https://github.com/lehins/massiv). Bogdan Penkovsky has been experimenting recently with it for dealing with neural networks: http://penkovsky.com/post/neural-networks-4/ – lehins Oct 08 '19 at 16:31

0 Answers0