Re: 'polymorphism restriction' anyone?

From: Wolfgang Lux <wlux_at_uni-muenster.de>
Date: Mon, 18 Dec 2006 12:04:36 +0100

Wolfgang Lux wrote:

> [...] I admit that this is not the most general
> type that could be inferred for bot, but it is the most general
> type that
> can safely be inferred for bot without using a groundness analysis (or
> adding just a special case for local definitions of the form x = x).

I have to correct myself (once more). It turns out that adopting ML's
value restriction is sufficient in order to infer type forall a.a for
bot in a local definition. Here is the output of a session with the
patched type checker.

   wlux_at_Onyx:wlux % ~/Projects/curry/build.noindex/cyi
       _____ __ __
      / ___/ | / _ Muenster Curry Compiler
     / / | / | | Version 0.9.10, Copyright (c)
1998-2006
    / /___ / / | |
    \____/ /_/ |_| Type :h for help

   Default options set to -Whaskell -Wunused -Woverlap
   Prelude> :t let bot :: a; bot = bot in (1:bot, 'a':bot)
   ([Int], [Char])
   Prelude> :q
   [Leaving cyi]

Regards
Wolfgang


_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Dez 18 2006 - 13:18:41 CET

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:07 CET