it really was an indentation error<br>i configured my editor to expand tabs into spaces but somehow he did a real tab on line 9 and 10<br>thank you<br><br><div class="gmail_quote">2009/6/16 Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Am Dienstag 16 Juni 2009 22:35:17 schrieb Nico Rolle:<br>
<div class="im">> Hi<br>
><br>
> Heres my code snippet.<br>
> It reports that my error is in line 9 right after the main definition.<br>
> All functions that i call work under normal circumstances.<br>
> Thanks<br>
<br>
</div>Must be the indentation, probably the xs is indented further than the following line<br>
(though that's not the case for the code copy-pasted from the mail to an editor).<br>
<br>
But note that this will most likely print out 0 twice.<br>
The let pnp = ... bindings don't cause any computation to occur.<br>
To measure the time the computations take, you must force them to occur between the two<br>
calls to getCurrentTime.<br>
<div class="im"><br>
><br>
><br>
> module Benchmark<br>
> where<br>
><br>
> import ReadCSV<br>
> import Operators<br>
> import Data.Time.Clock (diffUTCTime, getCurrentTime)<br>
><br>
> main = do<br>
> xs <- readCSV "dataconvert/lineitem.tbl" '|'<br>
> start <- getCurrentTime<br>
> let pnp = projection [5] xs<br>
> let snp = selection (\x -> (x!!0) > (Int 17000)) pnp<br>
> end <- getCurrentTime<br>
> putStrLn $ show (end `diffUTCTime` start)<br>
> start2 <- getCurrentTime<br>
> let pp = pProjection [5] xs<br>
> let sp = pSelection (\x -> (x!!0) > (Int 17000)) pp<br>
> end2 <- getCurrentTime<br>
> putStrLn $ show (end2 `diffUTCTime` start2)<br>
> return xs<br>
<br>
</div>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>