[Haskell-cafe] ghc does not link after compiling

2009-06-17 Thread Nico Rolle
hi

I wanted to compile my little test programm so it can take advantage
of a multicore system.
But when i call the compiler with

ghc -O2 --make Benchmark.hs -threaded

it just produces a acouple of .hi and .o files but no executable.
But in the documantation was written that i just need to call ghc like
that and it will produce my desired executable.
My version of ghc is 6.10.3
regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ghc does not link after compiling

2009-06-17 Thread Nico Rolle
oh sry now it works
thank you

2009/6/17 Deniz Dogan deniz.a.m.do...@gmail.com:
 2009/6/17 Nico Rolle nro...@web.de:
 hi

 I wanted to compile my little test programm so it can take advantage
 of a multicore system.
 But when i call the compiler with

 ghc -O2 --make Benchmark.hs -threaded

 it just produces a acouple of .hi and .o files but no executable.
 But in the documantation was written that i just need to call ghc like
 that and it will produce my desired executable.
 My version of ghc is 6.10.3
 regards
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


 Is the module name Main?

 --
 Deniz Dogan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] measuring time differences between functions

2009-06-17 Thread Nico Rolle
Hi everyone.
I made parallel versions of my functions projection selection and sort
and i wanted to test the difference in runtime.
But he only printed 0.00 twice.
Maybe hes just too fast?
Or is it because of lazy evaluation?
or is there a better way to mesure performance in execution time?
regards

main = do
xs - readCSV dataconvert/lineitem.tbl '|'
start - getCurrentTime
let pnp = projection [5] xs
let snp = selection (\x - (x!!0)  (Int 17000)) pnp
let sortnp = sort [0] [ASC] snp
end - getCurrentTime
putStrLn $ show (end `diffUTCTime` start)
start2 - getCurrentTime
let pp = pProjection [5] xs
let sp = pSelection (\x - (x!!0)  (Int 17000)) pp
let sortp = pSort [0] [ASC] sp
end2 - getCurrentTime
putStrLn $ show (end2 `diffUTCTime` start2)
return snp
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] force evaluation beginners question

2009-06-15 Thread Nico Rolle
Hi there

I'm trying to compile a code snipped that i've go from a tutorial
which uses the function force.
But when I'm trying to compile it ghc reports an error that it
couldn't find the defenition of force.
my ghc verion is 6.10.3
Did they moved force out of Prelude in one of the latest updates?

regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] force evaluation beginners question

2009-06-15 Thread Nico Rolle
big sry.
this function was defined by the tutorial guys

2009/6/15 Chaddaï Fouché chaddai.fou...@gmail.com:
 On Mon, Jun 15, 2009 at 6:46 PM, Nico Rollenro...@web.de wrote:
 Hi there

 I'm trying to compile a code snipped that i've go from a tutorial
 which uses the function force.
 But when I'm trying to compile it ghc reports an error that it
 couldn't find the defenition of force.
 my ghc verion is 6.10.3
 Did they moved force out of Prelude in one of the latest updates?


 As far as I know there never was a force function in the Prelude of
 Haskell98, this is probably a function specific to your tutorial, we
 could help more if we had the code snippet or at least the tutorial
 name.

 By the way, while it's absolutely not inappropriate to post this
 question here, there is a haskell-beginner mailing list more suited to
 this kind of thing (you could also get very fast and friendly help
 from the #haskell channel on irc.freenode.net).

 --
 Jedaï

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] measure a function in ghci

2009-06-03 Thread Nico Rolle
hi there

is there a quick way to check which function is doing the job quicker?
i have 2 functions which i want to compare.
both give the same output but they do it in different manner.
i want to test which one is faster.
i use ghci.

thanks

regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] beginners question about fromMaybe

2009-06-02 Thread Nico Rolle
hi there

heres a code snipped, don't care about the parameters.
the thing is i make a lookup on my map m and then branch on that return value

probePhase is sc [] m = []
probePhase is sc (x:xs) m
| val == Nothing  = probePhase is sc xs m
| otherwise   = jr ++ probePhase is sc xs m
where
jr  = joinTuples sc x (fromMaybe [] val)
key = getPartialTuple is x
val = Map.lookup key m


the line jr  = joinTuples sc x (fromMaybe [] val) is kind of ugly
because i know that it is not Nothing.
is there a better way to solve this?
regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Data.Map.Map Pattern Matching

2009-05-13 Thread Nico Rolle
Hi

I tried this but it diddn't work in ghci:

import qualified Data.Map as Map

test :: Map.Map [Int] [[Int]] - Bool
test (fromList[((i:is), (j:js))]) = [i] == j

i get the : Parse error in pattern
Failed. error.

regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Data.Map lookup signature

2009-05-12 Thread Nico Rolle
Hi everyone.

The docs in the web on http://www.haskell.org/ghc/docs
define Data.Map.lookup as follows:
http://www.haskell.org/ghc/docs
lookup :: Ord k = k - Map k a - Maybe a
but my version of ghci does i like that:
Data.Map.lookup :: (Ord k, Monad m) = k - Data.Map.Map k a - m a
but i need the 1. one.
my version of ghci is 6.8.2
regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Data.Map lookup signature

2009-05-12 Thread Nico Rolle
Oh sorry.
It was probalby changed in one of the latest versions
I downloaded the latest and now i'm finde.

2009/5/11 Nico Rolle nro...@web.de:
 Hi everyone.

 The docs in the web on http://www.haskell.org/ghc/docs
 define Data.Map.lookup as follows:
 http://www.haskell.org/ghc/docs
 lookup :: Ord k = k - Map k a - Maybe a
 but my version of ghci does i like that:
 Data.Map.lookup :: (Ord k, Monad m) = k - Data.Map.Map k a - m a
 but i need the 1. one.
 my version of ghci is 6.8.2
 regards

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] calling a variable length parameter lambda expression

2009-05-06 Thread Nico Rolle
super nice.
best solution for me so far.
big thanks.
regards

2009/5/6 Victor Nazarov asviraspossi...@gmail.com:
 On Tue, May 5, 2009 at 8:49 PM, Nico Rolle nro...@web.de wrote:

 Hi everyone.

 I have a problem.
 A function is recieving a lambda expression like this:
 (\ x y - x  y)
 or like this
 (\ x y z a - (x  y)  (z  a)

 my problem is now i know i have a list filled with the parameters for
 the lambda expression.
 but how can i call that expression?
 [parameters] is my list of parameters for the lambda expression.
 lambda_ex is my lambda expression

 is there a function wich can do smth like that?

 lambda _ex (unfold_parameters parameters)

 Why not:

 lam1 = \[x, y] - x  y
 lam2 = \[x, y, z, a] - (x  y)  (z  a)

 doLam :: Ord a = ([a] - Bool) - [a] - Bool
 doLam lam params = lam params

 So, this will work fine:

 doLam lam1 [1, 2]
 doLam lam2 [1,2,3,4]

 --
 Victor Nazarov

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Nico Rolle
hi
why does this don't work?

test = let a = ()
in 1 `a` 2

regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] beginner question: assigning local variable to a function

2009-05-06 Thread Nico Rolle
Oh sorry guys was rlly a stupid indentation mistake
next time i'll post the error message too
thanks
regards

2009/5/6 Brandon S. Allbery KF8NH allb...@ece.cmu.edu:
 On May 6, 2009, at 12:18 , Nico Rolle wrote:

 why does this don't work?

 test = let a = ()
   in 1 `a` 2


 Works fine here once I correct your indentation (the in needs to be
 indented at least as far as the l in let).

 --
 brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
 system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
 electrical and computer engineering, carnegie mellon university    KF8NH



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] calling a variable length parameter lambda expression

2009-05-05 Thread Nico Rolle
Hi everyone.

I have a problem.
A function is recieving a lambda expression like this:
(\ x y - x  y)
or like this
(\ x y z a - (x  y)  (z  a)

my problem is now i know i have a list filled with the parameters for
the lambda expression.
but how can i call that expression?
[parameters] is my list of parameters for the lambda expression.
lambda_ex is my lambda expression

is there a function wich can do smth like that?

lambda _ex (unfold_parameters parameters)

best regards
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe