[Haskell-cafe] Error on instance of Control.Exception.Exception

Maurí­cio briqueabraque at yahoo.com
Sun Feb 22 19:41:37 EST 2009


Hi,

I read here:

www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html

that this is declared:

---
class (Typeable e, Show e) => Exception e where
   toException :: e -> SomeException
   fromException :: SomeException -> Maybe e
---

I understand this means Excepton is a class. But
after I try:

---
instance Exception DbError where
---

GHC says:

Type constructor `Exception' used as a class
In the instance declaration for `Exception DbError'

Isn't Exception a class? If it is, what is the proper
way to have an Exception instance for my type?

Thanks,
Maurício



More information about the Haskell-Cafe mailing list