
8 Sep
2010
8 Sep
'10
1:15 p.m.
2010/9/8 Gábor Lehel
Oh. Hmm. That makes sense. So I gather there's absolutely no way to specify which instance you mean, and hence to use `value` as any concrete type?
Here's one way to indicate which value you are referring to. Anthony {-# LANGUAGE EmptyDataDecls, TypeFamilies #-} data True data False class TypeValue a where type ValueTypeOf a value :: a -> ValueTypeOf a instance TypeValue True where type ValueTypeOf True = Bool value _ = True instance TypeValue False where type ValueTypeOf False = Bool value _ = False main = print (value (undefined::True))