[Haskell-cafe] Identity type

John Meacham john at repetae.net
Wed Dec 22 23:45:16 CET 2010


On Tue, Dec 14, 2010 at 10:31 AM, Pierre-Etienne Meunier
<pierreetienne.meunier at gmail.com> wrote:
> Is there something like an identity type, transparent to the type-checker, in haskell ?
> For instance, I'm defining an interval arithmetic, with polynomials, matrices, and all that... defined with intervals. The types are :

No, such a thing doesn't exist. In fact, it would make the type system
undecidable if it did exist. I only know this because a long while ago
I really wanted such a thing to exist then tried to work out the
consequences and realized it would break the type system. I have found
liberal use of 'newtype-deriving' has mitigated my need for it in the
specific cases I was interested in.

    John



More information about the Haskell-Cafe mailing list