data vs. newtype, abstractly

Dean Herington heringto@cs.unc.edu
Sun, 9 Mar 2003 18:10:47 -0500 (EST)


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 always defined.

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`.  Perhaps I'll use:

    type Foo a  -- abstract

Does that disturb anyone?  Any other ideas?

Dean