
17 Sep
2009
17 Sep
'09
4:01 p.m.
On 17 Sep 2009, at 16:50, Daniel Fischer wrote:
Yes, the second appearance of 'constructors' is at an unspecified type.
instance (Enumerated a) => Target a where convert n | n < 0 = Nothing | otherwise = case drop n constructors of (x:_) -> Just x _ -> Nothing
would make it compile.
Neat trick. It works: thanks!
But there'd be a risk that Target is unusable, depending on how instance resolution is done.
Unusable? How so? Sorry, but I don't follow... -Andy