[Haskell-cafe] clonetype

Harendra Kumar harendra.kumar at gmail.com
Mon Sep 24 14:06:08 UTC 2018


On Mon, 24 Sep 2018 at 18:17, Oleg Grenrus <oleg.grenrus at iki.fi> wrote:

> The problem is that "All instances" is hard to pin point. We have open
> world assumption, so instances can be added later (in the dependency tree).
> Should they be cloned too? And even of you restrict to "instances visible
> at clonetype definition", that's IMHO not a good idea either, as it's
> implicit and volatile set (editing imports changes may change the set).
>

A clone type says "both the types are exactly the same in all semantics
except that they cannot be used interchangeably", it is just like "type"
except that the types are treated as being different. The way visible
instances change for the original type by editing imports, the same way
they change for the clone type as well, I do not see a problem there.
However, the two types may diverge if we define more instances for any of
them after cloning and that may potentially be a source of confusion?


> Haskell's heavy type machinery exists so we can explicitly and exactly say
> what we need or want.
>

Mortal programmers would love to have "conveniently" added to that list :-)

-harendra

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20180924/59961ee8/attachment.html>


More information about the Haskell-Cafe mailing list