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
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
>
> 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
> 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
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