Mon, 28 May 2001 17:53:38 -0700, Juan Carlos Arevalo Baeza <[EMAIL PROTECTED]> pisze:
> Uncommenting the type expression above clears the error.
> But, why can't the compiler deduce it by itself?
Monomorphism restriction strikes again. See section 4.5.5 in the
Haskell 98 Report. A pattern bindin
Mark Carroll <[EMAIL PROTECTED]> wrote,
> One of the projects I have coming up is a multi-threaded server that
> manages many clients in performing a distributed computation using a
> number of computers. So, we care about state, and control flow has some
> concurrent threads and is partially eve
I'm having a little of a problem with a project of mine. Just check out
this, which is the minimum piece of code that will show this problem:
type MyType a = a
(+++) :: MyType a -> MyType a -> MyType a
a +++ b = a
class MyClass a where
baseVal :: a
val1 :: MyClass a => MyType a
Ah, thank you for pointing out concat to me. (Oddly, without knowing about
concat, I had tried foldr1 (++) and also foldl1 (++) but got the same space
problem and so tried to 'factor it out'.)
OK, now I see what's going on - your explanation is good, thanks.
Which of the various tools built-in
Michal Gajda writes:
| On Tue, 29 May 2001, Tom Pledger wrote:
:
| > When you consume the (3N)th cell of v, you can't yet garbage collect
| > the Nth cell because it will be needed for generating the (3N+1)th,
| > (3N+2)th and (3N+3)th.
| >
| > So, as you proceed along the list, about two
On Tue, 29 May 2001, Tom Pledger wrote:
> David Bakin writes:
>
> a) Look at how much of the list needs to exist at any one time.
>
> | -- This has a space leak, e.g., when reducing (length (foo1 100))
> | foo1 m
> | = take m v
> | where
> | v = 1 : flatten (map triple v)
>
David Bakin writes:
:
| I have been puzzling over this for nearly a full day (getting this
| reduced version from my own code which wasn't working). In
| general, how can I either a) analyze code looking for a space leak
| or b) experiment (e.g., using Hugs) to find a space leak? Thanks!
|
On Mon, 28 May 2001, Simon Peyton-Jones wrote:
(snip)
> http://research.microsoft.com/~simonpj/papers/marktoberdorf.htm
>
> Haskell is a great language for writing concurrent applications.
Thanks! That's very interesting. In a way, I guess I'm taking something of
a leap of faith: if everyt
| (c) Haskell's monads, concurrency stuff and TCP/IP libraries
| are really quite powerful and useful, and I'll be happy I
| picked Haskell for the task.
Definitely (c). See Simon Marlow's paper about his experience
of writing a web server (highly concurrent), and my tutorial
"Tackling the awk
Mark Carroll wrote:
> One of the projects I have coming up is a multi-threaded server that
> manages many clients in performing a distributed computation using a
> number of computers. [...]
>
> (a) This really isn't what Haskell was designed for, and if I try to write
> this in Haskell I'll nev
Mon, 28 May 2001 10:23:58 +0100, Malcolm Wallace <[EMAIL PROTECTED]> pisze:
> It seems that right-associativity is so intuitive that even the
> person proposing it doesn't get it right. :-)
And even those who correct them :-)
>> f x (foldr1 f xs)f x foldr1 f xs
>
> Wouldn'
On 2001-05-27T22:46:37-0500, Jay Cox wrote:
> >data S m a = Nil | Cons a (m (S m a))
>
> >instance (Show a, Show (m (S m a))) => Show (S m a) where
> > show Nil = "Nil"
> > show (Cons x y) = "Cons " ++ show x ++ " " ++ show y
Here's how I've been handling such situations:
data S m a = Ni
Often I've found that quite how wonderful a programming language is isn't
clear until you've used it for a non-trivial project. So, I'm still
battling on with Haskell.
One of the projects I have coming up is a multi-threaded server that
manages many clients in performing a distributed computation
You need a language extension.
Check out Section 7 of "Derivable type classes"
http://research.microsoft.com/~simonpj/Papers/derive.htm
Alas, I have not implemented the idea yet.
(Partly because no one ever reports it as a problem; you
are the first!)
Simon
| One day I was playing ar
It seems that right-associativity is so intuitive that even the person
proposing it doesn't get it right. :-) Partial applications are a
particular problem:
> Haskell Non-Haskell
> Left Associative Right Associative
> From Prelude--
15 matches
Mail list logo