<div dir="ltr">Still on the ICFPC 2007 topic<br><br>I am curious about one thing. If I read the file applying hGetContents to a ByteString (Lazy or Strict) or a String, it seems to read much faster than the version where I construct a sequence.<br>
<br><br> main = do <br> (arg1:args)<-getArgs <br> hIn <- openFile arg1 ReadMode<br> c <-BL.hGetContents hIn --Really Fast<br> let dna = c<br> r<-return (process dna)<br>
print (show (r))<br><br><br><br> main = do <br> (arg1:args)<-getArgs <br> hIn <- openFile arg1 ReadMode<br> c <-hGetContents hIn<br> let dna = fromList c --Kind of slow<br>
r<-return (process dna)<br> print (show (r))<br><br><br>I think the "fromList" overhead will be compensated by the O(log(n)) functions on a Seq, against the O(n) counterparts on the strings.<br><br>
<br>What are your considerations about using Data.Sequence?<br><br><br></div>