Re: [Haskell-cafe] computational overhead of the "data" declarations

2008-10-28 Thread wren ng thornton
Brent Yorgey wrote: Daryoush Mehrtash wrote: > What is (or where do you see) the computational overhead of the "data" > declrations? So, to answer your question, the only computational overhead with a data declaration is the extra memory and time to store and process the constructor tags. It us

Re: [Haskell-cafe] computational overhead of the "data" declarations

2008-10-28 Thread Don Stewart
eford: > > So, to answer your question, the only computational overhead with a > > data declaration is the extra memory and time to store and process the > > constructor tags. It usually isn't noticeable, but sometimes the > > difference can be important. > > Is there also potentially overhead du

Re: [Haskell-cafe] computational overhead of the "data" declarations

2008-10-28 Thread Daryoush Mehrtash
> > newtype Good = Good Int > > Now, when a value of type Bad is stored at runtime, it will simply > store an Int, with no tag > Did you mean to say Good in the above sentence? What are the run time implication of newtype vs data where types are unwrapped and wrapped from on type to another? T

RE: [Haskell-cafe] computational overhead of the "data" declarations

2008-10-28 Thread Eli Ford
> So, to answer your question, the only computational overhead with a > data declaration is the extra memory and time to store and process the > constructor tags. It usually isn't noticeable, but sometimes the > difference can be important. Is there also potentially overhead due to laziness? I m

Re: [Haskell-cafe] computational overhead of the "data" declarations

2008-10-28 Thread Brent Yorgey
On Tue, Oct 28, 2008 at 12:13:11PM -0700, Daryoush Mehrtash wrote: > I Haskell School of Expression (p172), it says: > > A newtype declaration is just like a data declaration, except that it can > > only be used to defined data types with single constructor. The new data > > type is different fr