Re: [Haskell-cafe] Typing with co/contra-variance.

2008-04-03 Thread Aaron Tomb
On Apr 3, 2008, at 10:41 AM, Luke Palmer wrote: On Thu, Apr 3, 2008 at 9:58 AM, Ben Lippmeier <[EMAIL PROTECTED] > wrote: Questions: 1) Could I perhaps wave my arms around and say something about the Int in the type of isEven being in a contra-variant position? Is this what is actually ha

Re: [Haskell-cafe] Typing with co/contra-variance.

2008-04-03 Thread Luke Palmer
On Thu, Apr 3, 2008 at 9:58 AM, Ben Lippmeier <[EMAIL PROTECTED]> wrote: > Hi all, > I have some quick questions for the type theory people: > > If I write an expression: > (if .. then 23 else "Erk") > > In Haskell this would be an error, but perhaps I can assign it the type > 'Top' (or 'Any')

[Haskell-cafe] Typing with co/contra-variance.

2008-04-03 Thread Ben Lippmeier
Hi all, I have some quick questions for the type theory people: If I write an expression: (if .. then 23 else "Erk") In Haskell this would be an error, but perhaps I can assign it the type 'Top' (or 'Any') and then use reflection ala Data.Dynamic to inspect the type of this object at runtime