[Haskell-cafe] Re: Positive integers
dthurston at barnard.edu
Mon Mar 27 11:09:41 EST 2006
On Mon, Mar 27, 2006 at 05:02:20AM -0800, John Meacham wrote:
> well, in interfaces you are going to end up with some specific class or
> another concretely mentioned in your type signatures, which means you
> can't interact with code that only knows about the alternate class. like
> genericLength :: Integral a => [b] -> a
> if you have a different 'Integral' you can't call genericLength with it,
> or anything built up on genericLength. basically there would be no way
> for 'new' and 'old' polymorphic code to interact.
I think the idea would be that the source for genericLength would
compile using either class hierarchy with no change. For the case of
genericLength, this is true for the proposed alternate prelude Hennig
Theilemann pointed to. It would be mostly true in general for that
proposal, with the exception that you would sometimes need to add Show
or Eq instances.
> the inability to evolve the class hierarchy is a serious issue, enough
> that it very well could be impractical for haskell' unless something
> like class aliases were widely adopted.
I think that as long as you're not defining classes source compatibility
would not be hard. Of course you couldn't hope to link code written
with one hierarchy against another.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20060327/c2badd95/attachment.bin
More information about the Haskell-Cafe