Re: Monads

2001-05-18 Thread Jerzy Karczmarczuk
Rijk-Jan van Haaften = Hannah Schroeter: ... However, not using the Monadic do syntax results in hardly-readible code. I don't really think so. The operator precedences for and = are quite okay, especially combined to the precedence of lambda binding. ... main = do putStr

Monomorphize, was: Re: Proposal for generalized function partitionin List-library

2001-05-18 Thread Josef Svenningsson
John, On Thu, 17 May 2001, John Meacham wrote: [..] namely that you don't necisarilly know all of the types of polymorphic functions when they are in a module that is compiled seperately from the rest of the program. the solution used by many C++ compilers is to inline all polymorphic code

Re: Monomorphize, was: Re: Proposal for generalized function partitionin List-library

2001-05-18 Thread Lennart Augustsson
Josef Svenningsson wrote: John, On Thu, 17 May 2001, John Meacham wrote: [..] namely that you don't necisarilly know all of the types of polymorphic functions when they are in a module that is compiled seperately from the rest of the program. the solution used by many C++ compilers is

Templates in FPL?

2001-05-18 Thread Jerzy Karczmarczuk
Maestri, Primaballerine, I have a really provocative question. One of my student posed it, and I could not respond in a satisfactory manner, especially for myself it was really unsatisfactory. We know that a good part of top-down polymorphism (don't ask me what do I mean by that...) in C++ is

RE: Questions about Trie

2001-05-18 Thread Simon Peyton-Jones
Perhaps this monads discussion might move to [EMAIL PROTECTED]? It's a good discussion, but it's just what haskell-cafe is for. http://www.haskell.org/mailinglist.html Simon | -Original Message- | From: Arthur H. Gold [mailto:[EMAIL PROTECTED]] | Sent: 17 May 2001 22:21 | To:

Re: Templates in FPL?

2001-05-18 Thread D. Tweed
(This response comes from the context of someone who like FP but has a day job writing in C++.) On Fri, 18 May 2001, Jerzy Karczmarczuk wrote: We know that a good part of top-down polymorphism (don't ask me what do I mean by that...) in C++ is emulated using templates. Umm... what do you

Re: MVar Problem (Concurrent Hugs)

2001-05-18 Thread Dean Herington
Andreas Gruenbacher wrote: Hello, I was trying to write an abstraction for bidirectional communication between two threads. For some reason, MVars seem to break: --- class Cords c t u where newCord :: IO (c t u) listen :: c t u - IO t

Re: MVar Problem (Concurrent Hugs)

2001-05-18 Thread Andreas Gruenbacher
On Fri, 18 May 2001, Dean Herington wrote: You are creating a new MVar with each listen and speak. As a result, the two threads never agree on an MVar, so deadlock occurs. Instead, you should create the pair of MVars in newCord. Try the code below. [...] Thanks, this works. Thanks!

Re: Templates in FPL?

2001-05-18 Thread George Russell
The MLj compiler from ML to the Java Virtual Machine (which is being actively worked on by the geniuses at Microsoft as we speak) expands out all polymorphism. I helped develop this compiler and I believe this approach to be a good one. There are particular reasons why it's good for this

Re: Templates in FPL?

2001-05-18 Thread Anton Moscal
On Fri, 18 May 2001, Jerzy Karczmarczuk wrote: We know that a good part of top-down polymorphism (don't ask me what do I mean by that...) in C++ is emulated using templates. Always when somebody mentions templates in presence of a True Functionalist Sectarian, the reaction is What!?

Re: Monads

2001-05-18 Thread Ken Shan
On 2001-05-18T08:56:57+0200, Jerzy Karczmarczuk wrote: The examples are already in the Wadler's Essence. Imagine the construction of a small interpreter, a virtual machine which not only evaluates the expressions (belonging to a trivial Monad), but perform some side effects, or provides for

Re: Templates in FPL?

2001-05-18 Thread Marcin 'Qrczak' Kowalczyk
Fri, 18 May 2001 11:25:14 +0200, Jerzy Karczmarczuk [EMAIL PROTECTED] pisze: Always when somebody mentions templates in presence of a True Functionalist Sectarian, the reaction is What!? Abomination!!. They aren't that wrong, but they have some problems: * It's not specified what interface

Re: Monomorphize, was: Re: Proposal for generalized function partition in List-library

2001-05-18 Thread John Meacham
this is interesting, could someone give an example of how polymorphic recursion would disallow specialization of a function? i mean, it seems to me that even if you had recursion, you still have to actually call the function at some point with some real type and at that point you can decide

Re: Templates in FPL?

2001-05-18 Thread Michal Gajda
On Fri, 18 May 2001, George Russell wrote: The minus points are thuswise, so far as I know: (1) the compiled code is bigger. (...) (2) It takes much longer to compile. (...) As it is very aggressive optimization, I strongly suggest explicit(non-default) compiler switch Greetings :-)

Re: Monomorphize, was: Re: Proposal for generalized function partition in List-library

2001-05-18 Thread Marcin 'Qrczak' Kowalczyk
Fri, 18 May 2001 12:32:11 -0700, John Meacham [EMAIL PROTECTED] pisze: this is interesting, could someone give an example of how polymorphic recursion would disallow specialization of a function? test:: Show a = a - [String] test x = show x : test [x] -- __( Marcin Kowalczyk * [EMAIL

Re: Endangered I/O operations

2001-05-18 Thread Sigbjorn Finne
Simon Marlow [EMAIL PROTECTED] writes: I'm currently re-implementing GHC's I/O library, and I'd like to get people's opinions on the following I/O extensions currently provided by GHC - should we continue to provide them or not. 1. IOExts.hConnectTo This was designed to be a way to