[Haskell-beginners] How does one sort with Data.Vector.Generic.Mutable?

max smith maxrichsmith at yahoo.com
Thu Sep 2 21:00:54 EDT 2010


Hi,
I have been trying to use Haskell to sort a long list of data (strings, floats etc) that is read from a large file (say a few million lines).  I've been trying to use a Data.Vector.Generic.Mutable object and a sort algorithm from Data.Vector.Algorithms but I've been unable to get it to work since I haven't been able to find or create my own examples.  The examples in the excellent Vector tutorial, cover filling a vector with random numbers but due to my limited understanding of monads, I can't figure out how to use the IO monad and fill a vector from a file.  Does anyone have an example of how to do this.
 
Also, is Data.Vector.Generic.Mutable the best way to read a large amount of data from a file and sort it?
Thanks for any help,
Max




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20100902/4a8cad1e/attachment.html


More information about the Beginners mailing list