Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > Hi all, > > I'm working through the "Haskell for C programmers" tutorial > and in this section": This section http://www.haskell.org/~pairwise/intro/section4.html#part1 doing the calcMassesOverDists could also do with some work. The code listed does not seem t

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Cale Gibbard wrote: > You shouldn't have to flush output manually. Which implementation are > you using? I'm using GHC. > Try importing System.IO and doing: > hGetBuffering stdout >>= print > and see what gets printed. It should be "NoBuffering". Nope, it says "LineBuffering". > If for whateve

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > Hi all, > > I'm working through the "Haskell for C programmers" tutorial > and in this section": http://www.haskell.org/~pairwise/intro/section3.html#part8 has a broken links to: http://www.haskell.org/ghc/docs/latest/html/libraries/base/System.IO.html#20 E

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Cale Gibbard
You shouldn't have to flush output manually. Which implementation are you using? Try importing System.IO and doing: hGetBuffering stdout >>= print and see what gets printed. It should be "NoBuffering". If for whatever reason it's not, you can set it to that at the start of your programs with hSetBu

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > Hi all, > > I'm working through the "Haskell for C programmers" tutorial > and in this section": http://www.haskell.org/~pairwise/intro/section3.html#part7 has: main = do putStr "prompt 1" a <- getLine putStr "prompt 2" b <-

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Cale Gibbard
Yes, it's a bug in the tutorial, on both accounts. Hopefully Eric is reading this list :) - Cale On 31/12/05, Erik de Castro Lopo <[EMAIL PROTECTED]> wrote: > Erik de Castro Lopo wrote: > > > Hi all, > > > > I'm working through the "Haskell for C programmers" tutorial > > and in this section": >

Re: [Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > Hi all, > > I'm working through the "Haskell for C programmers" tutorial > and in this section": Now : http://www.haskell.org/~pairwise/intro/section3.html#part3 has the following: showLen :: [a] -> String showLen lst = (show (theLen)) ++ (if theLen ==

[Haskell-cafe] Bug in "Haskell for C programmers" tutorial?

2005-12-31 Thread Erik de Castro Lopo
Hi all, I'm working through the "Haskell for C programmers" tutorial and in this section": http://www.haskell.org/~pairwise/intro/section2.html#part3 it has: fib :: Num a, Num b => a -> b fib n = fibGen 0 1 n fibGen :: Num a, Num b => b -> b -> a -> b fibGen a b n = case n

Re: [Haskell-cafe] expanding do notation / StateMonad example from tutorial all about monads

2005-12-31 Thread Lemmih
On 12/31/05, Marc Weber <[EMAIL PROTECTED]> wrote: > Hi.. I'm still struggling with monads ;-) > > In the tutorial "All about monads" there is the function getOne used: > > getOne:: (Random a) => (a,a) -> State StdGen a > getOne bound = do g <-get > (x,g')= return $ randomR bounds

[Haskell-cafe] expanding do notation / StateMonad example from tutorial all about monads

2005-12-31 Thread Marc Weber
Hi.. I'm still struggling with monads ;-) In the tutorial "All about monads" there is the function getOne used: getOne:: (Random a) => (a,a) -> State StdGen a getOne bound = do g <-get (x,g')= return $ randomR bounds g put g' return x In the

Re: [Haskell-cafe] Re: OpenAL bindings / compiling ghc 6.5

2005-12-31 Thread Michael Benfield
On Dec 29, 2005, at 5:01 AM, Simon Marlow wrote: This may be due to using an older version of GNU make. Try upgrading your make and Thank you, this was the problem! Now, though, I've got another problem, and it would be great if someone could help me here. I'm on Mac OS 10.3.9. I can

Re[4]: [Haskell-cafe] Re: Haskell Speed

2005-12-31 Thread Bulat Ziganshin
Hello Branimir, Saturday, December 31, 2005, 4:55:51 AM, you wrote: >>IOArrays is second-class citizens in GHC/Haskell. they are scanned on >>_each_ GC, and this can substantially slow down program which uses >>large IOArrays. BM> Hm, there is Hans Boehm GC for C and C++ and I have gcmalloc and B

[Haskell-cafe] Testing serialization/deserialization.

2005-12-31 Thread Pupeno
Hello, I am working with NewBinary, I have made a lot of datatypes which are Binary instances. Now I want to write some testing for the serialization/de-serialization. I've started with QuickCheck but it seems I can't do IO inside a property of QuickCheck, am I right ? If not, how is it done ? N