Re: data vs. newtype, abstractly

2003-03-18 Thread Fergus Henderson
On 09-Mar-2003, Hal Daume III <[EMAIL PROTECTED]> wrote: > well, yes, but if you export: > > mkN :: Int -> N > mkD :: Int -> D > > or something like that, then they'll still bea ble to tell the difference, > right? Not necessarily. For example mkD could be defined as mkD x = x `seq` D

Re: data vs. newtype, abstractly

2003-03-09 Thread Tom Pledger
Dean Herington writes: : | My question came up in the context of describing such an abstract type for | users of the type. Like many others, I like to include actual Haskell | code where appropriate in the documentation. It didn't seem right to | commit there to either `data` or `newtype`.

Re: data vs. newtype, abstractly

2003-03-09 Thread Dean Herington
On Sun, 9 Mar 2003, Hal Daume III wrote: > well, yes, but if you export: > > mkN :: Int -> N > mkD :: Int -> D > > or something like that, then they'll still bea ble to tell the difference, > right? Well, yes, but I don't. In fact the type in question is an MVar which my abstraction ensures is

Re: data vs. newtype, abstractly

2003-03-09 Thread John Meacham
my guess is no too. An informal argument to that: imagine the datatype is abstract and no functions which act on it are exported .call it 'Type'. since there are no non-bottom values of this type that are exported, the only way to create them is with bottom as in: (undefined :: Type) (or an equiva

Re: data vs. newtype, abstractly

2003-03-09 Thread Hal Daume III
well, yes, but if you export: mkN :: Int -> N mkD :: Int -> D or something like that, then they'll still bea ble to tell the difference, right? -- Hal Daume III | [EMAIL PROTECTED] "Arrest this man, he talks in maths." | www.isi.edu/~hdaume On Sun,

Re: data vs. newtype, abstractly

2003-03-09 Thread Koen Claessen
Hal Daume III wrote: | there is a difference between | | (N undefined) `seq` () | | and | | (D undefined) `seq` () The question stated "without its constructor". My guess is "no". /K ___ Haskell mailing list [EMAIL PROTECTED] http://www.has

Re: data vs. newtype, abstractly

2003-03-08 Thread Hal Daume III
yes. > data D = D Int > newtype N = N Int there is a difference between (N undefined) `seq` () and (D undefined) `seq` () there has been a lot of discussion about this on the mailing list, probably under a title of something like "difference between data and newtype". -- Hal Daume III