Re: [Haskell-cafe] Reachable variables exercise

2010-09-16 Thread Carlos Camarao
Ah... now I understand your concern; I should have written something like: where K +_t K' denotes the set of constraints from K plus those from K' that have type variables reachable from t. instead of: where K +_t K' denotes the constraint-set obtained by adding from K' only constraints wi

Fwd: [Haskell-cafe] Reachable variables exercise

2010-09-16 Thread Carlos Camarao
-- Forwarded message -- From: Carlos Camarao Date: Fri, Sep 17, 2010 at 12:01 AM Subject: Re: [Haskell-cafe] Reachable variables exercise To: Luke Palmer boolify o has type Boolable a => Bool under the proposal, then we have ambiguity, type error, right? In general, consi

Re: [Haskell-cafe] Reachable variables exercise

2010-09-16 Thread Luke Palmer
I am not totally sure if I understand your proposal correctly, but if I do, then it has a flaw. Consider: class Boolable a where boolify :: a -> Bool class O a where o :: a main = print $ boolify o It seems like under your proposal this should not be a type error. B

[Haskell-cafe] Reachable variables exercise

2010-09-16 Thread Carlos Camarao
Hi. Consider for example an expression e0 like: fst (True,e) where e is any expression. e0 should have type Bool IMHO irrespectively of the type of e. In Haskell this is the case if e's type is monomorphic, or polymorphic, or constrained and there is a default in the current module that remove