[Haskell-cafe] Arrays in Clean and Haskell

Philippos Apolinarius phi500ac at yahoo.ca
Wed Nov 4 22:52:25 EST 2009


Let me see whether I understoodnd you correctly... If I read the contents of a file, the string will may be lazy (or something like that) and  not consume memory? In fewer words,  will the string behave like the infinite list of random numbers that I have used in the examples I posted?



--- On Wed, 11/4/09, Jason Dusek <jason.dusek at gmail.com> wrote:

From: Jason Dusek <jason.dusek at gmail.com>
Subject: Re: [Haskell-cafe] Arrays in Clean and Haskell
To: "Philippos Apolinarius" <phi500ac at yahoo.ca>
Cc: haskell-cafe at haskell.org
Received: Wednesday, November 4, 2009, 2:22 PM

2009/11/4 Philippos Apolinarius <phi500ac at yahoo.ca>
> Jason Dusek wrote:
> > How do you read in the IOUArray? By parsing a character
> > string or do you treat the file as binary numbers or ... ?
>
> I always pare the file. Parsing the file has the advantage of
> alowing me to have files of any format.

  From this description, it's hard for me to see what is hard
  for you. When you "parse the file" I imagine you in face
  "parse a String" or "parse a lazy ByteString" (a much better
  idea). Take that `String` or `ByteString` and pass it to an
  `ST` computation that parses it to make an `ST` array and then
  operates on the array.

--
Jason Dusek



      __________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091104/a3211a90/attachment.html


More information about the Haskell-Cafe mailing list