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

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to