haskell - How do I use Unboxed Vectors? -


i trying implement ray data type using vector type found here: http://www.haskell.org/haskellwiki/numeric_haskell:_a_vector_tutorial#importing_the_library

the vector hold doubles, use unboxed version of vector type.

here code trying compile:

module main      import qualified data.vector.unboxed vector      data ray = ray data.vector.unboxed data.vector.unboxed 

the error is

not in scope: type constructor or class `data.vector.unboxed' failed, modules loaded: none. 

the module data.vector.unboxed exports type constructor vector takes argument type want store. since renamed module vector well, qualified name type vector.vector. assuming want 2 vectors of doubles, should therefore use this:

data ray = ray (vector.vector double) (vector.vector double) 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -