
24 Nov
2011
24 Nov
'11
10:34 a.m.
On Thu, Nov 24, 2011 at 3:32 AM, Alia
extract :: Question' -> Question a extract q = case q of QuestionS x -> extractQString q QuestionI x -> extractQInt q QuestionD x -> extractQDouble q
What is a caller supposed to do with this function? How were you imagining it would be called? In Haskell98 (or Haskell2010), the type signature `Question' -> Question a` would mean that the function returns a `Question` of whatever type the caller chooses. Since this is not what the function in fact does, the compiler rejects it. Antoine