performance of monads

2002-01-16 Thread Eric Allen Wohlstadter
I see a lot of literature that says that monads "simulate" the effects of imperative programming concepts. It seems to me that the relative performance of monadic implementations must be equivalant to imperative ones to provide a strong case for functional programming. For example, in the Exceptio

Re: efficiency

2002-01-16 Thread D. Tweed
No-one appears to have responded to this with a definitive answer... On Tue, 15 Jan 2002, Feuer wrote: > I know what you mean. However, if you look at it, > data Empty1 a = E1 > is a datatype with one constructor, and that constructor takes no arguments. > So this is in fact a "phantom" unit ty

Re: performance of monads

2002-01-16 Thread Manuel M. T. Chakravarty
Eric Allen Wohlstadter <[EMAIL PROTECTED]> wrote, > I see a lot of literature that says that monads "simulate" the effects of > imperative programming concepts. It seems to me that the relative > performance of monadic implementations must be equivalant to imperative > ones to provide a strong ca

Re: performance of monads

2002-01-16 Thread William Lee Irwin III
Eric Allen Wohlstadter <[EMAIL PROTECTED]> wrote, >> non-local transfer of control. Similiar is the way State is handled. Do >> compilers for haskell do any sort of optimization on these monadic >> operations or is it all as ineffecient as it looks. On Wed, Jan 16, 2002 at 08:59:14PM +1100, Manue

Re: performance of monads

2002-01-16 Thread Jon Fairbairn
> I see a lot of literature that says that monads "simulate" the effects of > imperative programming concepts. I think that's just bad wording. To take a rather trite point of view, in a language such as C /everything/ is done within a monad, and all types, even int, are really IO something (IO

newtype/datatype (was efficiency)

2002-01-16 Thread Iavor Diatchki
hello, it looks like a lot of Haskell experts are at POPL (prog. language conference) and are not checking their email... so here is my attempt at explaining the differences between data and newtype. data T -- has 1 vale: _|_ data T = T -- has 2 values: _|_, T data T = T (

A View of Monads (Re: performance of monads)

2002-01-16 Thread Eray Ozkural (exa)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Let me offer a differing view of Monads. Monads are a way to write type-safe imperative programs within a functional framework. It's just an advanced version of PROGN kludge in LISP. Since they are based on a linear flow of "commands", they seem to

Re: efficiency

2002-01-16 Thread Marcin 'Qrczak' Kowalczyk
Tue, 15 Jan 2002 13:06:58 +0100, Rijk-Jan van Haaften <[EMAIL PROTECTED]> pisze: > This feature is one I consider among the worst in Haskell. If > a datatype with just a single constructor can be optimized away, It can't. newtype has a different semantics than data, as others explained. It would

Re: newtype/datatype (was efficiency)

2002-01-16 Thread Jan de Wit
Hi, > data T -- has 1 value: _|_ Minor nitpick: that Hugs and GHCi accept it, doesn't mean it's legal Haskell'98. Otherwise we would have existential and universal quantified types as well :-) Cheers, Jan ___ Haskell-Cafe mailing list [

Re: newtype/datatype (was efficiency)

2002-01-16 Thread Ken Shan
A while ago, to help myself understand newtype, data, and strictness, I tried to write down how Haskell types correspond to lifted domains. Here is a cleaned-up version of my attempt. I am not sure that what follows is entirely correct -- please point out any errors. I would also appreciate comm

Re: A View of Monads (Re: performance of monads)

2002-01-16 Thread Artie Gold
"Eray Ozkural (exa)" wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Let me offer a differing view of Monads. > > Monads are a way to write type-safe imperative programs within a functional > framework. It's just an advanced version of PROGN kludge in LISP. > > Since they are ba