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
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`.
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
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
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,
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
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