Mark Engelberg wrote:
> 3. It appears that there are significant speed gains when you explicitly
> describe the types. I don't really understand yet how the Haskell type
> system works; I glossed over it because the tutorial implied that most of
> the time declaring types was optional -- Haskell can infer if you leave it
> out. So I left out all type declarations, and it looks like that's a big
> reason the program ran slowly.
Well, with most compilers type signaturs make a speed difference if you
compile without optimization, but not with optimization. The simple explanation
is that when you use an operation like `+' the compiler can't always know which
plus you when (Int, Double, Rational, ...) so it generates the most general code,
but a type signature clears it up
>
> 4. Andy Gill's general solution is most impressive, and I hope that I
> eventually get to the point where his program makes sense to me. I don't
> quite understand Monads and some of the built-in functions enough to follow
> it. (Monads are Haskell's way of making imperative and mutative programming
> harder to do so that programmers are less likely to do it, right? :))
That's right! :)
--
-- Lennart